import type { GuildMessage } from '../../Constants' ; import type { HelpObj } from '../../structures/commandhandler' ; import type { PermissionString } from 'discord.js' ; import type ReknownClient from '../../structures/client' ; export async function run ( client , message , args ) { if ( ! args [ 1 ] ) return client . functions . noArg ( message , 1 , 'an amount to purge.' ) ; const amt = parseInt ( args [ 1 ] ) ; if ( amt < 1 || amt > 100 ) return client . functions . badArg ( message , 1 , 'The amount must be from 1-100.' ) ; if ( amt === 100 ) await message . delete ( ) ; message . channel . bulkDelete ( amt === 100 ? amt : amt + 1 , true ) . catch ( ( ) => null ) ; } export const help = { aliases : [ 'clear' ] , category : 'Moderation' , desc : 'Clears x amount of messages.' , togglable : true , usage : 'purge <Amount>' } ; export const memberPerms = [ 'MANAGE_MESSAGES' ] ; export const permissions = [ 'MANAGE_MESSAGES' , 'READ_MESSAGE_HISTORY' ] ;