diff --git a/src/commands/callback.ts b/src/commands/callback.ts index 91e8525..f264cdf 100644 --- a/src/commands/callback.ts +++ b/src/commands/callback.ts @@ -5,7 +5,7 @@ import PhoneNumber from 'awesome-phonenumber'; import axios from 'axios'; import { Message, TextChannel } from 'eris'; -import { Client, Command, RichEmbed } from '../class'; +import { Client, CmdContext, Command, RichEmbed } from '../class'; export default class Callback extends Command { constructor(client: Client) { @@ -19,7 +19,7 @@ export default class Callback extends Command { this.enabled = false; } - public async run(message: Message, args: string[]) { + public async run(ctx: CmdContext) { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); if (message.channel.type === 0) await message.delete(); const member = this.mainGuild.members.get(message.author.id); diff --git a/src/commands/game.ts b/src/commands/game.ts index 0e12dfa..c6eaa53 100644 --- a/src/commands/game.ts +++ b/src/commands/game.ts @@ -3,7 +3,7 @@ */ /* eslint-disable prefer-destructuring */ import { Activity, Member, Message } from 'eris'; -import { Client, Command, RichEmbed } from '../class'; +import { Client, CmdContext, Command, RichEmbed } from '../class'; // eslint-disable-next-line no-shadow enum ActivityType { @@ -26,7 +26,7 @@ export default class Game extends Command { this.enabled = false; } - public async run(message: Message, args: string[]) { + public async run(ctx: CmdContext) { let member: Member; if (!args[0]) member = message.member; else { diff --git a/src/commands/intercom.ts b/src/commands/intercom.ts index 974c7d8..001210e 100644 --- a/src/commands/intercom.ts +++ b/src/commands/intercom.ts @@ -3,7 +3,7 @@ */ import { Message } from 'eris'; -import { Client, Command } from '../class'; +import { Client, CmdContext, Command } from '../class'; import { Misc as MiscPBXActions } from '../pbx'; export default class Intercom extends Command { @@ -17,7 +17,7 @@ export default class Intercom extends Command { this.enabled = false; } - public async run(message: Message, args: string[]) { + public async run(ctx: CmdContext) { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); const loading = await this.loading(message.channel, 'Synthesizing text...'); diff --git a/src/commands/offer.ts b/src/commands/offer.ts index 8183e2b..a8d9fb5 100644 --- a/src/commands/offer.ts +++ b/src/commands/offer.ts @@ -5,7 +5,7 @@ /* eslint-disable default-case */ import jwt from 'jsonwebtoken'; import { Message } from 'eris'; -import { Client, Command } from '../class'; +import { Client, CmdContext, Command } from '../class'; export default class Offer extends Command { constructor(client: Client) { @@ -19,7 +19,7 @@ export default class Offer extends Command { this.enabled = false; } - public async run(message: Message, args: string[]) { + public async run(ctx: CmdContext) { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); const member = this.client.util.resolveMember(args[0], this.mainGuild); if (!member) return this.error(message.channel, 'Could not find member.'); diff --git a/src/commands/slowmode.ts b/src/commands/slowmode.ts index 730057d..0c12282 100644 --- a/src/commands/slowmode.ts +++ b/src/commands/slowmode.ts @@ -4,7 +4,7 @@ import { Message, GuildTextableChannel } from 'eris'; import moment, { unitOfTime } from 'moment'; -import { Client, Command } from '../class'; +import { Client, CmdContext, Command } from '../class'; export default class Slowmode extends Command { regex: RegExp; @@ -20,7 +20,7 @@ export default class Slowmode extends Command { this.regex = /[a-z]+|[^a-z]+/gi; } - public async run(message: Message, args: string[]) { + public async run(ctx: CmdContext) { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); const [length, unit] = args[0].match(this.regex); diff --git a/src/commands/sss_create_account.ts b/src/commands/sss_create_account.ts index fa6e7cf..23162f4 100644 --- a/src/commands/sss_create_account.ts +++ b/src/commands/sss_create_account.ts @@ -4,7 +4,7 @@ import { Message } from 'eris'; import { apply as Apply } from '.'; -import { Client, Command } from '../class'; +import { Client, CmdContext, Command } from '../class'; export default class SSS_Create_Account extends Command { public applyCommand: Apply; @@ -19,7 +19,7 @@ export default class SSS_Create_Account extends Command { this.enabled = false; } - public async run(message: Message) { + public async run(ctx: CmdContext) { try { const staff = await this.client.db.mongo.Staff.findOne({ userID: message.author.id }).lean().exec(); if (!staff) return this.error(message.channel, 'Staff information not located.'); diff --git a/src/commands/storemessages.ts b/src/commands/storemessages.ts index 40a2553..3bab895 100644 --- a/src/commands/storemessages.ts +++ b/src/commands/storemessages.ts @@ -4,7 +4,7 @@ import { randomBytes } from 'crypto'; import { Message, TextChannel } from 'eris'; -import { Client, Command, LocalStorage } from '../class'; +import { Client, CmdContext, Command, LocalStorage } from '../class'; export default class StoreMessages extends Command { constructor(client: Client) { @@ -18,7 +18,7 @@ export default class StoreMessages extends Command { this.enabled = false; } - public async run(message: Message, args: string[]) { + public async run(ctx: CmdContext) { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); const check = this.client.util.resolveGuildChannel(args[0], this.mainGuild, false); if (!check || check.type !== 0) return this.error(message.channel, 'The channel you specified either doesn\'t exist or isn\'t a textable guild channel.');