Ask coding questions

← Back to all posts
Jhonascaliban (0)

Eu estou tentando colocar novos tipos de comandos no meu bot porem esta difícil já que procuro bastante na internet mais não acho poderiam me ajudar sou brasileiro

Text in english

I'm trying to put new types of commands in my bot, but this is difficult since I look a lot on the internet but I don't think they could help me, I'm Brazilian

tussiez (1669)

Here's a simple way to read commands:

let prefix = '!';
if(!message.content.startsWith(prefix)) return; // If not a bot command
if( return; // Do not respond to itself.
let command = message.content.replace(prefix,'');
let args = command.split(' '); // Argument

if(command == 'test'){ // If command = !test
message.reply(' Hello'); // Send message