1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 16:30:58 -05:00
Daggerbot-TS/src/commands/bonk.ts

29 lines
1.5 KiB
TypeScript
Raw Normal View History

import Discord,{SlashCommandBuilder} from 'discord.js';
2023-01-27 21:33:55 -05:00
import TClient from 'src/client';
export default {
2023-02-24 19:55:11 -05:00
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
//if (!client.isStaff(interaction.member) && interaction.channelId == '468835415093411863') return interaction.reply('This command is restricted to staff only in this channel due to high usage.')
const member = interaction.options.getMember('member') as Discord.GuildMember;
const reason = interaction.options.getString('reason');
const adminPerm = member.permissions.has('Administrator');
if (adminPerm) return interaction.reply('You cannot bonk an admin!');
await client.bonkCount._incrementUser(member.id);
interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor)
.setDescription(`> <@${member.id}> has been bonked!\n${reason?.length == null ? '' : `> Reason: **${reason}**`}`)
.setImage('https://media.tenor.com/7tRddlNUNNcAAAAd/hammer-on-head-minions.gif')
.setFooter({text: `Bonk count for ${member.user.tag}: ${await client.bonkCount._content.findById(member.id).then(b=>b.value.toLocaleString('en-US'))}`})
]})
},
data: new SlashCommandBuilder()
.setName('bonk')
.setDescription('Bonk a member')
.addUserOption((opt)=>opt
.setName('member')
.setDescription('Which member to bonk?')
.setRequired(true))
.addStringOption((opt)=>opt
.setName('reason')
.setDescription('Reason for the bonk'))
2023-01-18 14:28:11 -05:00
}