summaryrefslogtreecommitdiff
path: root/src/commands/fun/say.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/fun/say.ts')
-rw-r--r--src/commands/fun/say.ts17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/commands/fun/say.ts b/src/commands/fun/say.ts
index e10aff8..985307a 100644
--- a/src/commands/fun/say.ts
+++ b/src/commands/fun/say.ts
@@ -1,6 +1,7 @@
import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
//@ts-ignore
import * as emoji from 'emoji-random'
+import * as config from '../../config.json'
module.exports = class SayFun extends Command {
constructor(client: CommandoClient) {
@@ -25,12 +26,20 @@ module.exports = class SayFun extends Command {
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
});
}
+ //@ts-ignore
run(msg: CommandoMessage, { say }: any) {
- if (msg.author.id == '217348698294714370' || msg.guild.member(msg.author.id)?.hasPermission('MANAGE_MESSAGES')) {
- msg.say(say)
- msg.delete();
+ if (config['validUsers'].includes(msg.author.id)) {
+ if (msg.author.id == '217348698294714370' || msg.guild.member(msg.author.id)?.hasPermission('MANAGE_MESSAGES')) {
+ msg.say(say)
+ msg.delete();
+ return
+ } else {
+ //@ts-ignore
+ return msg.reply(`Insufficent permissions! ${emoji.random()}`).then(m => m.delete({ timeout: 3000 }))
+ }
} else {
- msg.reply(`Insufficent permissions! ${emoji.random()}`);
+ //@ts-ignore
+ return msg.reply(`Insufficent permissions! ${emoji.random()}`).then(m => m.delete({ timeout: 3000 }))
}
}
}; \ No newline at end of file