import discord
from discord.ext import commands
import asyncio
client = commands.Bot(command_prefix='.', intents=discord.Intents.all())
token = "Мой токен"
curseWord = ('терроризм', 'наркотики')
@client.listen('on_message')
async def whatever_you_want_to_call_it(message):
msg_content = message.content.lower()
if any(word in msg_content for word in curseWord):
await message.delete()
await message.channel.send(f"{message.author.mention} Нельзя говорить такие слова")
else:
return
@client.event
async def on_ready():
print("start")
await client.change.presence(activity=discord.Activity(type=discord.ActivityType.listening, name="by aspho_dell"))
client.run(token)
@client.event async def on_ready():
попало внутрь обработчика события.