aboutsummaryrefslogtreecommitdiff
path: root/src/commands/config/punishmentFooter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/config/punishmentFooter.ts')
-rw-r--r--src/commands/config/punishmentFooter.ts51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/commands/config/punishmentFooter.ts b/src/commands/config/punishmentFooter.ts
new file mode 100644
index 0000000..3a246df
--- /dev/null
+++ b/src/commands/config/punishmentFooter.ts
@@ -0,0 +1,51 @@
+import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib';
+import { Util } from 'discord.js';
+
+export default class PunishmentFooterCommand extends BushCommand {
+ public constructor() {
+ super('punishmentFooter', {
+ aliases: ['punishmentfooter'],
+ category: 'config',
+ description: {
+ content: 'Configure or reset what should follow all punishment related dms.',
+ usage: 'punishmentfooter [message]',
+ examples: ['punishmentfooter', 'prefix you can appeal at https://example.com.']
+ },
+ clientPermissions: ['SEND_MESSAGES'],
+ userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'],
+ args: [
+ {
+ id: 'ending',
+ type: 'string',
+ match: 'restContent',
+ prompt: {
+ start: 'What message would you like to follow punishment dms?',
+ retry: '{error} Choose a valid role.',
+ optional: true
+ }
+ }
+ ],
+ slash: true,
+ slashOptions: [
+ {
+ name: 'ending',
+ description: 'What message would you like to follow punishment dms?',
+ type: 'STRING',
+ required: false
+ }
+ ]
+ });
+ }
+
+ async exec(message: BushMessage | BushSlashMessage, args: { ending: string }): Promise<unknown> {
+ await message.guild.setSetting('punishmentEnding', args.ending || null);
+ if (args.ending)
+ return await message.util.send({
+ content: `${
+ this.client.util.emojis.success
+ } Changed the server's punishment footer to \n\`\`\`${Util.cleanCodeBlockContent(args.ending)}\`\`\`.`,
+ allowedMentions: AllowedMentions.none()
+ });
+ else return await message.util.send(`${this.client.util.emojis.success} Removed he server's punishment footer.`);
+ }
+}