From b8e94ff00df6df27ea2dc09f66067e91adeb0483 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Tue, 7 Jul 2020 04:06:17 -0700 Subject: say has private perms now --- src/commands/fun/say.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/commands') diff --git a/src/commands/fun/say.ts b/src/commands/fun/say.ts index e70ad76..e10aff8 100644 --- a/src/commands/fun/say.ts +++ b/src/commands/fun/say.ts @@ -1,7 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore +import * as emoji from 'emoji-random' module.exports = class SayFun extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'say', group: 'fun', @@ -23,8 +25,12 @@ module.exports = class SayFun extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg: CommandoMessage, { say }) { - msg.say(say) - msg.delete(); + run(msg: CommandoMessage, { say }: any) { + if (msg.author.id == '217348698294714370' || msg.guild.member(msg.author.id)?.hasPermission('MANAGE_MESSAGES')) { + msg.say(say) + msg.delete(); + } else { + msg.reply(`Insufficent permissions! ${emoji.random()}`); + } } }; \ No newline at end of file -- cgit v1.2.3