Skip to content
Advertisement

discord.py bot sends message each and finishes only when sending each words

I’m new in this, it’s really annoying that the bot would send each bad word one by one until it finishes. Here’s the code.

JavaScript

I’m trying to make the bot send all the bad words in one message and as in the code, the bot would send a message and mute, but it would repeat based on how many bad words there are in the message and would also repeat muting the user who used bad words in her/his message. The code has no problems it works perfectly fine, I ask thee on changes to only make the bot send once no matter how many bad words in the message and to also list the bad words in the message that the bot sends. the picture of the problem

In the image it would repeat until it finishes sending all words, and I am completely clueless on what should I add or change to make the bot compile each bad word and would send the embed and mute the user who used the bad word

(ignore this it seems like stack overflow keeps telling me to add details….. I’m filling it up) I used the method open file in this code pls help and ps I’m new don’t say I’m bad and I’m still 14 learning on coding :) I would be really glad to someone who will help me :)

Advertisement

Answer

If you loop through your badwords file and store all the used words in a list, you can then afterwards send a message with all the collected bad words.

Something like this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement