Ошибка при запуске бота (Дискорд)
Код бота
import discord
from discord.ext import commands
TOKEN="some-token"
bot = commands.Bot(command_prefix='!')
@bot.command(pass_context=True)
async def test(ctx, arg):
await ctx.send(arg)
bot.run(TOKEN)
При запуске ошибка: BotBase.__init__() missing 1 required keyword-only argument: 'intents'
Ответы (1 шт):
Автор решения: nyekitka
→ Ссылка
import discord
from discord.ext import commands
TOKEN="some-token"
intents = discord.Intents.default()
intents.members = True #если нужны события, связанные с участниками
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.command(pass_context=True)
async def test(ctx, arg):
await ctx.send(arg)
bot.run(TOKEN)