2023-05-23 01:14:17 -04:00
import Discord from 'discord.js' ;
2023-04-14 06:47:58 -04:00
import TClient from '../client.js' ;
2022-11-17 12:58:19 -05:00
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' ) ;
2023-07-07 09:49:24 -04:00
if ( member . permissions . has ( 'Administrator' ) ) return interaction . reply ( 'You cannot bonk an admin!' ) ;
2023-03-18 04:19:41 -04:00
2023-02-24 19:55:11 -05:00
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' )
2023-06-09 21:11:19 -04:00
. setFooter ( { text : ` Bonk count for ${ member . displayName } : ${ await client . bonkCount . _content . findById ( member . id ) . then ( b = > b . value . toLocaleString ( 'en-US' ) ) } ` } )
2023-02-24 19:55:11 -05:00
] } )
} ,
2023-05-23 01:14:17 -04:00
data : new Discord . SlashCommandBuilder ( )
2023-02-24 19:55:11 -05:00
. setName ( 'bonk' )
. setDescription ( 'Bonk a member' )
2023-05-23 01:14:17 -04:00
. addUserOption ( x = > x
2023-02-24 19:55:11 -05:00
. setName ( 'member' )
. setDescription ( 'Which member to bonk?' )
. setRequired ( true ) )
2023-05-23 01:14:17 -04:00
. addStringOption ( x = > x
2023-02-24 19:55:11 -05:00
. setName ( 'reason' )
. setDescription ( 'Reason for the bonk' ) )
2023-01-18 14:28:11 -05:00
}