aboutsummaryrefslogtreecommitdiff
path: root/src/commands/config/punishmentFooter.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-14 13:29:19 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-14 13:29:19 -0400
commiteaaae08aeee1fa16a4e1ad0b26fceb42885bfcde (patch)
tree6c1501af87225b478c9ebdc39e0712e0d4835a08 /src/commands/config/punishmentFooter.ts
parent070b5f326d0647e7b105f99811e4bdc915c8652e (diff)
downloadtanzanite-eaaae08aeee1fa16a4e1ad0b26fceb42885bfcde.tar.gz
tanzanite-eaaae08aeee1fa16a4e1ad0b26fceb42885bfcde.tar.bz2
tanzanite-eaaae08aeee1fa16a4e1ad0b26fceb42885bfcde.zip
add punishent footer command
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.`);
+ }
+}