Ошибка "init() missing 1 required positional argument: 'command_prefix'" Discord bot
Я создаю бота и столкнуться с проблемой:
Traceback (most recent call last):
File "bot.py", line 4, in client = commands.Bot( commands_prefix = '$')
TypeError: init() missing 1 required positional argument: 'command_prefix'
Вот мой код:
import discord
from discord.ext import commands
client = commands.Bot( commands_prefix = '$' )
@client.event
async def on_ready():
print('Bot')
@client.commands ( pass_context = True)
async def hello( ctx):
await ctx.send('Hello')
token = open ('token.txt', 'r').readline()
client.run (token)
Ответы (1 шт):
Автор решения: Tewsdv
→ Ссылка
исходя из документации:
from discord.ext import commands
bot = commands.Bot(command_prefix='$')
@bot.command()
async def test(ctx):
pass
# or:
@commands.command()
async def test(ctx):
pass
bot.add_command(test)
bot = commands.Bot(command_prefix='$')
у Вас же: commands.Bot( commands_prefix = '$' )