i have been fiddiling with this for the last 2 hours and don't understand why it doesnt work, i have message intents enabled, i have establisbed the commands properly, i am using the right prefix and amount. I've looked over my code multiple times but still do not see or understand why nothing happens, literally nothing happens lol.
from dis import dis
from importlib.metadata import requires
from sys import prefix
from unicodedata import name
from click import command, pass_context
import discord
from discord.ext import commands
import json
import requests
import asyncio
with open('badwords.json', 'r') as f:
data = json.load(f)
intents = discord.Intents.default()
intents.members = True
intents.message_content = True
print(discord.__version__)
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'{bot.user.name} is Online!')
@bot.event
async def on_message(msg):
if msg.author != bot.user:
for text in data['words']:
if text in msg.content or text.upper() in msg.content or text.capitalize() in msg.content:
await msg.delete()
return
@bot.command()
@commands.has_permissions(manage_messages=True)
async def purge(ctx, limit: int):
await ctx.message.delete()
await asyncio.sleep(1)
await ctx.channel.purge(limit=limit)