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 ) { let music = client . music [ message . guild . id ] ; if ( ! music ) music = client . music [ message . guild . id ] = { equalizer : 0 , id : message . guild . id , looping : false , player : undefined , queue : [ ] , volume : 20 } ; const bool = args [ 1 ] ? args [ 1 ] . toLowerCase ( ) === 'on' : ! music . looping ; if ( ! bool && args [ 1 ] && args [ 1 ] . toLowerCase ( ) !== 'off' ) return client . functions . badArg ( message , 1 , 'This must be either "on" or "off".' ) ; music . looping = bool ; message . channel . send ( `Successfully toggled looping ${ bool ? 'on' : 'off' }.` ) ; } export const help = { aliases : [ ] , category : 'Music' , desc : 'Toggles looping for music.' , togglable : true , usage : 'loop [Toggle=on]' } ; export const memberPerms = [ ] ; export const permissions = [ ] ;