refactor(arabot): updated deprecated commands

This commit is contained in:
Anthony Berg 2024-01-04 10:38:39 +00:00
parent 3f82f87317
commit bb6ac8aef0
87 changed files with 110 additions and 107 deletions

View File

@ -22,7 +22,7 @@ import { ChannelType } from 'discord.js';
import IDs from '#utils/ids';
export class AccessCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'access',

View File

@ -22,7 +22,7 @@ import type { Message } from 'discord.js';
import { ChannelType, TextChannel } from 'discord.js';
export class AnonymousCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'anonymous',

View File

@ -21,7 +21,7 @@ import { Args, Command, RegisterBehavior } from '@sapphire/framework';
import type { Message } from 'discord.js';
export class ClearCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'clear',

View File

@ -31,7 +31,7 @@ import {
import IDs from '#utils/ids';
export class PrivateCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
public constructor(context: Subcommand.LoaderContext, options: Subcommand.Options) {
super(context, {
...options,
name: 'private',

View File

@ -24,7 +24,7 @@ import { getBalance } from '#utils/database/economy';
import { EmbedBuilder } from 'discord.js';
export class BalanceCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'balance',

View File

@ -26,7 +26,7 @@ import { EmbedBuilder } from 'discord.js';
import IDs from '#utils/ids';
export class DailyCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'daily',

View File

@ -25,7 +25,7 @@ import { EmbedBuilder, TextChannel } from 'discord.js';
import IDs from '#utils/ids';
export class BalanceCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'pay',

View File

@ -23,7 +23,7 @@ import { N1984 } from '#utils/gifs';
import { addFunLog, countTotal } from '#utils/database/fun';
export class N1984Command extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: '1984',

View File

@ -23,7 +23,7 @@ import { Cringe } from '#utils/gifs';
import { addFunLog, countTotal } from '#utils/database/fun';
export class CringeCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'cringe',

View File

@ -22,7 +22,7 @@ import { EmbedBuilder } from 'discord.js';
import { Happy } from '#utils/gifs';
export class HappyCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'happy',

View File

@ -23,7 +23,7 @@ import { Hugs } from '#utils/gifs';
import { addFunLog, countTotal } from '#utils/database/fun';
export class HugCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'hug',

View File

@ -23,7 +23,7 @@ import { Kill } from '#utils/gifs';
import { addFunLog, countTotal } from '#utils/database/fun';
export class KillCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'kill',

View File

@ -23,7 +23,7 @@ import { Poke } from '#utils/gifs';
import { addFunLog, countTotal } from '#utils/database/fun';
export class PokeCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'poke',

View File

@ -22,7 +22,7 @@ import { EmbedBuilder } from 'discord.js';
import { Sad } from '#utils/gifs';
export class SadCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'sad',

View File

@ -22,7 +22,7 @@ import { EmbedBuilder } from 'discord.js';
import { Shrug } from '#utils/gifs';
export class ShrugCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'shrug',

View File

@ -26,7 +26,7 @@ import { addEmptyUser, updateUser } from '#utils/database/dbExistingUser';
import { checkTempBan, removeTempBan } from '#utils/database/tempBan';
export class BanCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'ban',

View File

@ -26,7 +26,7 @@ import { addTempBan, checkTempBan } from '#utils/database/tempBan';
import { addEmptyUser, updateUser } from '#utils/database/dbExistingUser';
export class TempBanCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'tempban',
@ -258,14 +258,14 @@ export class TempBanCommand extends Command {
await addTempBan(userId, modId, time.fromNow, reason);
// Create scheduled task to unban
this.container.tasks.create(
'tempBan',
{
this.container.tasks.create({
name: 'tempBan',
payload: {
userId: user.id,
guildId: guild.id,
},
time.offset,
);
delay: time.offset,
});
info.message = `${user} has been temporarily banned for ${banLength}.`;
info.success = true;

View File

@ -33,7 +33,7 @@ import { checkTempBan, removeTempBan } from '#utils/database/tempBan';
import { addEmptyUser, addExistingUser } from '#utils/database/dbExistingUser';
export class UnbanCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'unban',

View File

@ -31,7 +31,7 @@ import type { TextChannel, Snowflake } from 'discord.js';
import IDs from '#utils/ids';
export class DiversityCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
public constructor(context: Subcommand.LoaderContext, options: Subcommand.Options) {
super(context, {
...options,
name: 'diversity',

View File

@ -25,7 +25,7 @@ import type { Message } from 'discord.js';
import { ChannelType } from 'discord.js';
export class MoveAllCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'moveall',

View File

@ -21,7 +21,7 @@ import { Args, Command, RegisterBehavior } from '@sapphire/framework';
import type { GuildMember, Message } from 'discord.js';
export class RenameUserCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'rename',

View File

@ -277,7 +277,7 @@ export async function restrictRun(
}
export class RestrictCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'restrict',

View File

@ -25,7 +25,7 @@ import { getRestrictions } from '#utils/database/restriction';
import { checkStaff } from '#utils/checker';
export class RestrictLogsCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'restrictlogs',

View File

@ -22,7 +22,7 @@ import type { User, Message } from 'discord.js';
import { restrictRun } from './restrict';
export class RestrictToleranceCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'restricttolerance',

View File

@ -24,7 +24,7 @@ import { CategoryChannel, ChannelType } from 'discord.js';
import IDs from '#utils/ids';
export class RestrictToolsCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
public constructor(context: Subcommand.LoaderContext, options: Subcommand.Options) {
super(context, {
...options,
name: 'restricttools',

View File

@ -29,7 +29,7 @@ import {
} from '#utils/database/restriction';
export class UnRestrictCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'unrestrict',

View File

@ -24,7 +24,7 @@ import { Duration, DurationFormatter } from '@sapphire/time-utilities';
import { isNumber } from '#utils/maths';
export class SlowmodeCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'slowmode',

View File

@ -22,7 +22,7 @@ import type { GuildMember, Message } from 'discord.js';
import IDs from '#utils/ids';
export class SoftMuteCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'softmute',

View File

@ -43,7 +43,7 @@ import IDs from '#utils/ids';
// TODO add a check when they join the server to give the user the sus role again
export class SusCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
public constructor(context: Subcommand.LoaderContext, options: Subcommand.Options) {
super(context, {
...options,
name: 'sus',

View File

@ -23,7 +23,7 @@ import { addMute, removeMute, checkActive } from '#utils/database/vcMute';
import { addExistingUser } from '#utils/database/dbExistingUser';
export class VCMuteCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'vcmute',

View File

@ -28,7 +28,7 @@ import { addWarn } from '#utils/database/warnings';
mean we would have a lot of the warns already in the database.
*/
export class WarnCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'warn',

View File

@ -38,7 +38,7 @@ import IDs from '#utils/ids';
import { EmbedBuilder } from 'discord.js';
export class OutreachCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
public constructor(context: Subcommand.LoaderContext, options: Subcommand.Options) {
super(context, {
...options,
name: 'outreach',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class BookClubCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'bookclub',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class DebateHostCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'debatehost',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class GameNightHostCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'gamenight',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class GuestCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'guest',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class MentorCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'mentor',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class ModCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'mod',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class RestrictedAccessCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'restrictedaccess',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class StageHostCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'stagehost',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class TrialModCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'trialmod',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class TrialVerifierCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'trialverifier',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class VerifierCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'verifier',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class ActivistCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'activist',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class ARAVeganCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'aravegan',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class ConvincedCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'convinced',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class PlusCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'plus',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class TrustedCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'trusted',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class VeganCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'vegan',

View File

@ -23,7 +23,7 @@ import IDs from '#utils/ids';
import { roleAddLog, roleRemoveLog } from '#utils/logging/role';
export class VegCuriousCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'vegcurious',

View File

@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
import type { Message } from 'discord.js';
export class ApplyCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'apply',

View File

@ -22,7 +22,7 @@ import type { Message } from 'discord.js';
import IDs from '#utils/ids';
export class RenameUserCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'count',

View File

@ -19,7 +19,7 @@ import { EmbedBuilder } from 'discord.js';
import type { Message } from 'discord.js';
export class HelpCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'help',

View File

@ -20,7 +20,7 @@
import { Command, RegisterBehavior } from '@sapphire/framework';
export class InfoCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'info',

View File

@ -22,7 +22,7 @@ import { Command } from '@sapphire/framework';
import type { Message } from 'discord.js';
export class PingCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'ping',

View File

@ -27,7 +27,7 @@ import {
import { manualVerification } from '#utils/database/verification';
export class VerifyCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'verify',

View File

@ -22,7 +22,7 @@ import IDs from '#utils/ids';
import { checkVerificationFinish } from '#utils/database/verification';
export class VerifyTimeoutRemoveCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'verifytimeoutremove',

View File

@ -23,7 +23,7 @@ import { EmbedBuilder } from 'discord.js';
import { getRank, xpToNextLevel } from '#utils/database/xp';
export class RankCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: 'rank',

View File

@ -25,7 +25,7 @@ import IDs from '#utils/ids';
import { addEmptyUser, addExistingUser } from '#utils/database/dbExistingUser';
export class BanListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'guildBanAdd',

View File

@ -23,7 +23,7 @@ import { checkBan, getBanReason } from '#utils/database/ban';
import { checkTempBan } from '#utils/database/tempBan';
export class BanJoinListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'guildMemberAdd',

View File

@ -25,7 +25,7 @@ import IDs from '#utils/ids';
import { addEmptyUser, addExistingUser } from '#utils/database/dbExistingUser';
export class UnbanListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'guildBanRemove',

View File

@ -21,7 +21,7 @@ import { Listener } from '@sapphire/framework';
import type { Message } from 'discord.js';
export class BotAppreciationListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'messageCreate',

View File

@ -24,7 +24,7 @@ import type {
import { Listener } from '@sapphire/framework';
export class OldCommandDeniedListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'messageCommandDenied',

View File

@ -25,7 +25,7 @@ import { getLastCount, addCount } from '#utils/database/counting';
import IDs from '#utils/ids';
export class XpListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'messageCreate',

View File

@ -27,7 +27,7 @@ import {
} from '#utils/database/dbExistingUser';
export class DbLeaveServerListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'guildMemberRemove',

View File

@ -24,7 +24,7 @@ import type {
import { Listener } from '@sapphire/framework';
export class CommandDeniedListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'chatInputCommandDenied',

View File

@ -24,7 +24,7 @@ import { Listener } from '@sapphire/framework';
import { setupTypes } from '#utils/database/outreach';
export class EventTypesReadyListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
once: true,

View File

@ -26,7 +26,7 @@ import { checkActive, getRestrictions } from '#utils/database/restriction';
import { findNotes } from '#utils/database/sus';
export class ModMailCreateListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'channelCreate',

View File

@ -24,7 +24,7 @@ import type { Client, TextChannel } from 'discord.js';
import IDs from '#utils/ids';
export class NonVeganAccessReady extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
once: true,

View File

@ -24,7 +24,7 @@ import { Listener } from '@sapphire/framework';
import type { Client } from 'discord.js';
export class ReadyListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
once: true,

View File

@ -33,7 +33,7 @@ import { blockedRoles, blockedRolesAfterRestricted } from '#utils/blockedRoles';
import IDs from '#utils/ids';
export class RolesJoinServerListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'guildMemberAdd',

View File

@ -23,7 +23,7 @@ import type { Message } from 'discord.js';
import IDs from '#utils/ids';
export class Suggestions extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'messageCreate',

View File

@ -22,7 +22,7 @@ import type { VoiceState } from 'discord.js';
import { checkActive, removeMute } from '#utils/database/vcMute';
export class VCMuteListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'voiceStateUpdate',

View File

@ -56,7 +56,7 @@ import { rolesToString } from '#utils/formatter';
import IDs from '#utils/ids';
export class VerificationJoinVCListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'voiceStateUpdate',
@ -151,14 +151,15 @@ export class VerificationJoinVCListener extends Listener {
]);
// Start 15-minute timer if verifier does not join
this.container.tasks.create(
'verifyTimeout',
{
this.container.tasks.create({
name: 'verifyTimeout',
payload: {
channelId: channel.id,
userId: member.id,
},
900_000,
); // 15 minutes
},
900_000 // 15 minutes
);
}
// Check how many voice channels there are
@ -506,12 +507,13 @@ export class VerificationJoinVCListener extends Listener {
await giveVerificationRoles(user, info.roles);
// Add timeout if they do not have activist role
if (!info.roles.activist) {
this.container.tasks.create(
'verifyUnblock',
{
this.container.tasks.create({
name: 'verifyUnblock',
payload: {
userId: user.id,
guildId: guild.id,
},
},
info.roles.vegan || info.roles.convinced ? 604800000 : 1814400000,
);
}

View File

@ -37,7 +37,7 @@ import { fibonacci } from '#utils/maths';
import IDs from '#utils/ids';
export class VerificationLeaveVCListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'voiceStateUpdate',
@ -103,12 +103,13 @@ export class VerificationLeaveVCListener extends Listener {
// Creates the length of the time for the ban
const banLength = fibonacci(incompleteCount) * 3600_000;
this.container.tasks.create(
'verifyUnblock',
{
this.container.tasks.create({
name: 'verifyUnblock',
payload: {
userId: user.id,
guildId: guild.id,
},
},
banLength,
);

View File

@ -22,7 +22,7 @@ import type { Message } from 'discord.js';
import IDs from '#utils/ids';
export class VerificationMessageCounter extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'messageCreate',

View File

@ -29,7 +29,7 @@ import { createVerificationVoice } from '#utils/verification';
import IDs from '#utils/ids';
export class VerificationReady extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
once: true,

View File

@ -24,7 +24,7 @@ import type { Client, TextChannel } from 'discord.js';
import IDs from '#utils/ids';
export class VerificationReady extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
once: true,

View File

@ -23,7 +23,7 @@ import { addXp, checkCanAddXp } from '#utils/database/xp';
import { randint } from '#utils/maths';
export class XpListener extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
event: 'messageCreate',

View File

@ -24,7 +24,7 @@ import IDs from '#utils/ids';
export class DiversityMonMessageTask extends ScheduledTask {
public constructor(
context: ScheduledTask.Context,
context: ScheduledTask.LoaderContext,
options: ScheduledTask.Options,
) {
super(context, {

View File

@ -24,7 +24,7 @@ import IDs from '#utils/ids';
export class DiversityWedMessageTask extends ScheduledTask {
public constructor(
context: ScheduledTask.Context,
context: ScheduledTask.LoaderContext,
options: ScheduledTask.Options,
) {
super(context, {

View File

@ -24,7 +24,7 @@ import IDs from '#utils/ids';
export class RestrictedMessageTask extends ScheduledTask {
public constructor(
context: ScheduledTask.Context,
context: ScheduledTask.LoaderContext,
options: ScheduledTask.Options,
) {
super(context, {

View File

@ -24,7 +24,7 @@ import IDs from '#utils/ids';
export class StandupTask extends ScheduledTask {
public constructor(
context: ScheduledTask.Context,
context: ScheduledTask.LoaderContext,
options: ScheduledTask.Options,
) {
super(context, {

View File

@ -24,7 +24,7 @@ import IDs from '#utils/ids';
export class VerifyReminder extends ScheduledTask {
public constructor(
context: ScheduledTask.Context,
context: ScheduledTask.LoaderContext,
options: ScheduledTask.Options,
) {
super(context, {

View File

@ -25,7 +25,7 @@ import { checkTempBan, removeTempBan } from '#utils/database/tempBan';
export class TempBan extends ScheduledTask {
public constructor(
context: ScheduledTask.Context,
context: ScheduledTask.LoaderContext,
options: ScheduledTask.Options,
) {
super(context, options);
@ -102,6 +102,6 @@ export class TempBan extends ScheduledTask {
declare module '@sapphire/plugin-scheduled-tasks' {
interface ScheduledTasks {
tempBan: never;
tempBan: { userId: string; guildId: string }
}
}

View File

@ -22,7 +22,7 @@ import { ScheduledTask } from '@sapphire/plugin-scheduled-tasks';
export class VerifyTimeout extends ScheduledTask {
public constructor(
context: ScheduledTask.Context,
context: ScheduledTask.LoaderContext,
options: ScheduledTask.Options,
) {
super(context, options);
@ -56,6 +56,6 @@ export class VerifyTimeout extends ScheduledTask {
declare module '@sapphire/plugin-scheduled-tasks' {
interface ScheduledTasks {
verifyTimeout: never;
verifyTimeout: { channelId: string; userId: string };
}
}

View File

@ -22,7 +22,7 @@ import IDs from '#utils/ids';
export class VerifyUnblock extends ScheduledTask {
public constructor(
context: ScheduledTask.Context,
context: ScheduledTask.LoaderContext,
options: ScheduledTask.Options,
) {
super(context, options);
@ -56,6 +56,6 @@ export class VerifyUnblock extends ScheduledTask {
declare module '@sapphire/plugin-scheduled-tasks' {
interface ScheduledTasks {
verifyUnblock: never;
verifyUnblock: { userId: string; guildId: string };
}
}