Думал, что await bot.process_commands(message) поможет, но увы
Вот часть кода
import discord
from discord import utils, client
from discord.ext import commands
from discord.ext.commands import bot, has_permissions
import config
intents = discord.Intents.all()
bot = commands.Bot(command_prefix='!', intents=discord.Intents.all())
class MyClient(discord.Client):
@bot.event
async def on_ready(self):
print('Logged on as {0}!'.format(self.user))
@bot.event
async def on_message(self, message):
author = message.author
channel = message.channel
content = message.content
# игнорировать сообщения бота
if author == client.user:
return
if content.startswith("hi"):
await channel.send('Hello!')
elif content.startswith("bye"):
await channel.send("Goodbye!")
elif content.startswith("!clear"):
print('Ok, it will be done')
await message.channel.purge(limit=5)
await bot.process_commands(message)
@bot.command()
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, user: discord.Member, *, reason=None):
await user.kick(reason=reason)
await ctx.send(f"{user} have been kicked successfully!")
# RUN
client = MyClient(intents=intents)
client.run(config.TOKEN)