aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info/botinfo.ts
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-05-16 22:23:12 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-05-16 22:23:12 -0400
commit4d63c4af57a7391dd61106b79874b8e83c14971a (patch)
tree4d9aa589b3501169d9ddfe8f0fdff50d9080b553 /src/commands/info/botinfo.ts
parent759e93bec4e9e2eb86db7434007345c24b0a0252 (diff)
downloadtanzanite-4d63c4af57a7391dd61106b79874b8e83c14971a.tar.gz
tanzanite-4d63c4af57a7391dd61106b79874b8e83c14971a.tar.bz2
tanzanite-4d63c4af57a7391dd61106b79874b8e83c14971a.zip
change all existing slash commands to have no repeating code, add help slash command
Diffstat (limited to 'src/commands/info/botinfo.ts')
-rw-r--r--src/commands/info/botinfo.ts14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/commands/info/botinfo.ts b/src/commands/info/botinfo.ts
index 306c142..8f5f055 100644
--- a/src/commands/info/botinfo.ts
+++ b/src/commands/info/botinfo.ts
@@ -1,4 +1,4 @@
-import { MessageEmbed, Message } from 'discord.js';
+import { MessageEmbed, Message, CommandInteraction } from 'discord.js';
import { BotCommand } from '../../lib/extensions/BotCommand';
import { duration } from 'moment';
@@ -14,7 +14,7 @@ export default class BotInfoCommand extends BotCommand {
});
}
- public async exec(message: Message): Promise<void> {
+ private async generateEmbed(): Promise<MessageEmbed> {
const owners = (await this.client.util.mapIDs(this.client.ownerID))
.map((u) => u.tag)
.join('\n');
@@ -52,6 +52,14 @@ export default class BotInfoCommand extends BotCommand {
}
])
.setTimestamp();
- await message.util.send(embed);
+ return embed;
+ }
+
+ public async exec(message: Message): Promise<void> {
+ await message.util.send(await this.generateEmbed());
+ }
+
+ public async execSlash(message: CommandInteraction): Promise<void> {
+ await message.reply(await this.generateEmbed());
}
}