Me gustaría un código donde el usuario pueda poner !play TicTacToe, y el bot iniciará tictactoe. Actualmente mi bot no responde, y veo que es por que tiene un espacio despues de jugar, y la capitalizacion en TicTacToe. ¿Qué estoy haciendo mal? (ps También dice strip_after_prefix:True, ^
ReferenceError: True no está definido
#an example of one of my commands that needs strip_after_prefix module.exports = { name: 'clear', description: "Clears x amount of messages", strip_after_prefix=True, async execute(message, args){ if(!args[0]) return message.reply('please enter the amount of messages you want to clear'); if(isNaN(args[0])) return message.reply('please enter a real number') if(args[0] > 100) return message.reply('the max amount your can clear is 20') if(args[0] < 1) return message.reply('the minimum deletion number is 1') await message.channel.messages.fetch({limit: args[0]}).then(messages =>{ message.channel.bulkDelete(messages); }); } }Hola compañeros vagabundos del mundo! Descubrí la respuesta a mi propia pregunta, ¡y me enteré de que se ELIMINÓ strip_after_prefix!
En cambio, si está intentando hacer !play tictactoe player1 player2 (por ejemplo), puede usar el comando como una lista:
const args = message.content.slice(prefix.length).trim().split(/ +/g); #args is the variable I use let command = args.toString().toLowerCase().replace(/,/g, ' '); #this makes it so !play TiCtAcToe and normal !play ticatactoe both workEsta lista debería ser como [tictactoe, player1, player2] A continuación, para acceder a esta lista, haga args[(number)] y utilícelo para las funciones.
(También agradecería mucho que alguien editara esto porque apesto en inglés. Que tengas un día maravilloso).