From 0e7b124f5e4994081dff826c4719a20d986cbfe1 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Mon, 27 Jul 2020 04:54:38 -0700 Subject: fix: pfp block me/ feat: say types now --- server/src/client/BotClient.ts | 5 ++++- server/src/commands/fun/Say.ts | 8 +++++--- server/src/commands/server/PFP.ts | 6 ++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/server/src/client/BotClient.ts b/server/src/client/BotClient.ts index 086dc4e..37c9396 100644 --- a/server/src/client/BotClient.ts +++ b/server/src/client/BotClient.ts @@ -13,7 +13,8 @@ declare module 'discord-akairo' { listenerHandler: ListenerHandler; logger: Logger; settings: SettingsProvider; - img + img, + wait } } @@ -35,6 +36,8 @@ export default class BotClient extends AkairoClient { }); }); } + + public wait = require("util").promisify(setTimeout); public inhibitorHandler: InhibitorHandler = new InhibitorHandler(this, { directory: join(__dirname, '..', 'inhibitors') diff --git a/server/src/commands/fun/Say.ts b/server/src/commands/fun/Say.ts index 876f539..1fcd4da 100644 --- a/server/src/commands/fun/Say.ts +++ b/server/src/commands/fun/Say.ts @@ -28,11 +28,13 @@ export default class SayFun extends Command { }); } - public exec(msg: Message, { text }): Promise { - console.log(text) + public async exec(msg: Message, { text }): Promise { if (validIDs.includes(msg.author.id) || owners.includes(msg.author.id)) { msg.delete(); - return msg.channel.send(text); + msg.channel.startTyping(); + await this.client.wait(1500); + msg.channel.send(text); + return msg.channel.stopTyping(); } return msg.delete(); diff --git a/server/src/commands/server/PFP.ts b/server/src/commands/server/PFP.ts index 4f15123..95b6f17 100644 --- a/server/src/commands/server/PFP.ts +++ b/server/src/commands/server/PFP.ts @@ -23,7 +23,7 @@ export default class PFPServer extends Command { start: 'Which user\'s avatar would you like to grab?', retries: 3, retry: 'Please choose a valid user.', - optional: true + optional: false } } ] @@ -31,9 +31,6 @@ export default class PFPServer extends Command { } public exec(msg: Message, { user }): Promise { - if ((user.id === owners[1]) && (msg.author.id !== owners[1])) - msg.reply('Sin is special, their identity shall remain anonymous.'); - let embed = this.client.util.embed() .setColor(colour) @@ -50,6 +47,7 @@ export default class PFPServer extends Command { } return msg.channel.send(embed); } else { + if (user.id === owners[0]) return msg.reply('Sin is special, their identity shall remain anonymous.'); let format = user.displayAvatarURL({ dynamic: true }).substr(user.displayAvatarURL({ dynamic: true}).length - 3); if (format == 'gif') { embed.setAuthor(user.username); -- cgit v1.2.3