RuntimeError: asyncio.run() cannot be called from a running event loop

import discord
from discord.ext import commands

TOKEN = "***"

intents = discord.Intents.default()
intents.message_content = True

bot = commands.Bot(command_prefix='!', intents=intents)

@bot.event
async def on_ready():
    print('Бот запущен как {0.user}'.format(bot))

@bot.event
async def on_message(message):
    if message.author == bot.user:
        return

    await message.channel.send('Привет, я бот! Ты сказал: ' + message.content)

bot.run(TOKEN)

Ответы (0 шт):