aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush/moulHammer.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-01 17:24:16 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-01 17:24:16 -0400
commit4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd (patch)
tree7ef72c3c3ff9d3a896d8781c5c54b7303d4e5a29 /src/commands/moulberry-bush/moulHammer.ts
parentd7099571b90c4211f90089bb41e90b0a08b86112 (diff)
downloadtanzanite-4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd.tar.gz
tanzanite-4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd.tar.bz2
tanzanite-4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd.zip
chore: fromatting fixes, refactor ping command, hopefully fix duration rounding issues
Diffstat (limited to 'src/commands/moulberry-bush/moulHammer.ts')
-rw-r--r--src/commands/moulberry-bush/moulHammer.ts7
1 files changed, 6 insertions, 1 deletions
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>`)