diff options
| -rw-r--r-- | Procfile | 1 | ||||
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | src/bot/commands/owner/say.ts | 32 |
3 files changed, 33 insertions, 2 deletions
diff --git a/Procfile b/Procfile deleted file mode 100644 index a035c3b..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -worker: npm run start diff --git a/package.json b/package.json index 09d2893..fb5ef70 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lint": "eslint src --ext .ts", "lint:fix": "eslint src --fix --ext .ts", "pre-commit": "npm run lint && npm run build", - "start": "npm run compile && node ." + "start": "npm run build && node ." }, "dependencies": { "common-tags": "^1.8.0", diff --git a/src/bot/commands/owner/say.ts b/src/bot/commands/owner/say.ts new file mode 100644 index 0000000..31eb78c --- /dev/null +++ b/src/bot/commands/owner/say.ts @@ -0,0 +1,32 @@ +import { Command } from 'discord-akairo'; +import { Message } from 'discord.js'; + +export default class SayCommand extends Command { + public constructor() { + super('say', { + aliases: ['say'], + clientPermissions: ['SEND_MESSAGES', 'MANAGE_MESSAGES'], + description: { + content: "Speak as the bot.", + }, + category: 'owner', + ownerOnly: true, + args: [ + { + id: 'message', + match: 'text', + } + ] + }); + } + + public async exec(msg: Message, { message }: { message: any }): Promise<Message | Message[]> { + msg.delete(); + + let owners = process.env.OWNERS!.split(','); + if (!owners.includes(msg.author.id)) return msg.author.send('You are missing permissions to use this command!'); + if (!message) return msg.author.send('You did not specify what you want me to say!'); + + return msg.util!.send(message); + } +} |