Quantcast
Channel: Discord.js bot looping using || or operator - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Discord.js bot looping using || or operator

$
0
0

I am having an issue when I use the or opperator || the bot will send 5 messages at once, and continue to loop. Without using the or operator it works fine. It will also accept some letters like c, or h to start the loop, which is odd.

This is the code it will print out onto the discord.

Hello @thehiddencheese! This bot is currently used for testing only. Features will be added in the future, however for more info, please contact @thehiddencheese.Hello @thehiddencheese's test bot! This bot is currently used for testing only. Features will be added in the future, however for more info, please contact @thehiddencheese.Hello @thehiddencheese's test bot! This bot is currently used for testing only. Features will be added in the future, however for more info, please contact @thehiddencheese.Hello @thehiddencheese's test bot! This bot is currently used for testing only. Features will be added in the future, however for more info, please contact @thehiddencheese.Hello @thehiddencheese's test bot! This bot is currently used for testing only. Features will be added in the future, however for more info, please contact @thehiddencheese.

Here is the code

client.on('message', (message) => {  let targetMember = message.member.user;  if (message.content === '!help' || '!command') {    message.channel.send(      `Hello ${targetMember}! This bot is currently used for testing only. Features will be added in the future, however for more info, please contact <@248030367666274304>.`    );  }});

Viewing all articles
Browse latest Browse all 2

Trending Articles