import discord
import random
from discord.ext import commands
admin = ['Admin']
economy_channels = ['economy']
cuss = ['poopoo']
slurs = ['stupid']
TOKEN = 'MTAwMDd5MDkD6DU1MjY4OTY5NQ.GFIeQ9.WBS46D65AXiXAc2NpADgv88eeTa07P2UZesCc'
client = commands.Bot(command_prefix = ';')
client.remove_command('help')
# bot going online
@client.event
async def on_ready():
print('Bot is ready')
@client.event
async def on_message(msg):
for text in cuss:
if text in str(msg.content.lower()):
await msg.delete()
return
for text in slurs:
if text in str(msg.content.lower()):
await msg.delete()
await msg.author.kick()
await msg.channel.send(f'Kicked: {str(msg.author)}\nReason: Posted slurs')
return
if msg.author == client.user:
return
await client.process_commands(msg)
client.run(TOKEN)
#I have completey checked this code from top to bottom. For some reason, when i type a cuss word , like poopoo, its doesnt delete. what is the problem. Can someone pls help?
#Note: The key has been changed to something random to protect exposing it. So I know that is not the problem. I ran it with the real key and it still didnt work.
import random
from discord.ext import commands
admin = ['Admin']
economy_channels = ['economy']
cuss = ['poopoo']
slurs = ['stupid']
TOKEN = 'MTAwMDd5MDkD6DU1MjY4OTY5NQ.GFIeQ9.WBS46D65AXiXAc2NpADgv88eeTa07P2UZesCc'
client = commands.Bot(command_prefix = ';')
client.remove_command('help')
# bot going online
@client.event
async def on_ready():
print('Bot is ready')
@client.event
async def on_message(msg):
for text in cuss:
if text in str(msg.content.lower()):
await msg.delete()
return
for text in slurs:
if text in str(msg.content.lower()):
await msg.delete()
await msg.author.kick()
await msg.channel.send(f'Kicked: {str(msg.author)}\nReason: Posted slurs')
return
if msg.author == client.user:
return
await client.process_commands(msg)
client.run(TOKEN)
#I have completey checked this code from top to bottom. For some reason, when i type a cuss word , like poopoo, its doesnt delete. what is the problem. Can someone pls help?
#Note: The key has been changed to something random to protect exposing it. So I know that is not the problem. I ran it with the real key and it still didnt work.