discord.js bot replies to itself

前端 未结 5 1080
情话喂你
情话喂你 2020-12-19 01:38

I am currently coding my first discord bot, it can already play YouTube music.

if (message.content.includes(\"         


        
5条回答
  •  臣服心动
    2020-12-19 02:14

    // In message event
    if(message.author.id === client.user.id) return;
    
    // I would recommend a variable like this for splits on words
    // const args = message.content.trim().split(/\s+/g); 
    // You could also .slice() off a prefix if you have one
    
    if(/good job/i.test(message.content)) {
      message.channel.send('Good job everyone :smirk:'); // sendMessage is deprecated, use send instead
    }
    

提交回复
热议问题