diff options
| author | 8cy <[email protected]> | 2020-07-16 21:21:38 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-07-16 21:21:38 -0700 |
| commit | 8c0d89ba7f9e983f35ab6576d798ae0384b6ebab (patch) | |
| tree | 928d4afe56377ef7fc9b2cc67f7d76d9301b1e74 /src/commands/fun | |
| parent | convert water to lowercase (diff) | |
| download | dep-core-8c0d89ba7f9e983f35ab6576d798ae0384b6ebab.tar.xz dep-core-8c0d89ba7f9e983f35ab6576d798ae0384b6ebab.zip | |
add more perms
Diffstat (limited to 'src/commands/fun')
| -rw-r--r-- | src/commands/fun/say.ts | 17 |
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 |