From 4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 1 Jun 2022 17:24:16 -0400 Subject: chore: fromatting fixes, refactor ping command, hopefully fix duration rounding issues --- src/commands/moulberry-bush/moulHammer.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/commands/moulberry-bush/moulHammer.ts') diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts index 7a5a91c..a5d2c27 100644 --- a/src/commands/moulberry-bush/moulHammer.ts +++ b/src/commands/moulberry-bush/moulHammer.ts @@ -1,4 +1,5 @@ import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; +import assert from 'assert'; import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js'; export default class MoulHammerCommand extends BushCommand { @@ -20,6 +21,7 @@ export default class MoulHammerCommand extends BushCommand { } ], slash: true, + channel: 'guild', slashGuilds: ['516977525906341928'], restrictedGuilds: ['516977525906341928'], clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), @@ -28,7 +30,10 @@ export default class MoulHammerCommand extends BushCommand { } public override async exec(message: BushMessage | BushSlashMessage, { user }: { user: ArgType<'user'> }) { - await message.delete(); + assert(message.inGuild()); + + if (message.channel.permissionsFor(message.guild.members.me!).has('ManageMessages')) await message.delete().catch(() => {}); + const embed = new EmbedBuilder() .setTitle('L') .setDescription(`${user.username} got moul'ed <:wideberry1:756223352598691942><:wideberry2:756223336832303154>`) -- cgit