so as you can see, i've recently joined stackoverflow. Mostly because i can find the answers. ok going to the point:
I've sort of what made a auto-filter command. It checks the file 'badwords.txt' that i have made for any swear words and if its in that file, the bot will delete the message and execute a message saying 'Don't do that!'. Here's the command:
with open('badwords.txt', 'r') as f:
global badwords # You want to be able to access this throughout the code
words = f.read()
badwords = words.split()
async def on_message(ctx, message):
msg = message.content
for word in badwords:
if word in msg:
await message.delete()
await ctx.send("Dont use that word!")
await ctx.process_message(message)
My only question now is, how is it that you can make it so that if you swear more than three times, you'd get silenced for about an hour?
Thanks