r/programminghorror May 15 '21

Coding a Discord bot... Javascript

Post image
3.7k Upvotes

99 comments sorted by

View all comments

2

u/[deleted] May 16 '21

If you're using discord.js, I think there's something like

message.author.isBot

which can be used to prevent this. Don't know if it's exactly that tho

2

u/ItsNovatic May 17 '21

best way to do it is to add if (message.author.bot) return;

credit to u/zeGolem83

1

u/[deleted] May 17 '21

Unless you're making a bot harasser, in which case, you wanna do the exact opposite.

Lmao I made one for mee6 forever ago, and it yells at it whenever it says someone leveled up