0
0 комментариев

САМ КОД:

#import

import discord
from discord.ext import commands
from discord.ext.commands import Bot

#комманды для бота

Bot = commands.Bot(command_prefix= ‘!’)

@Bot.event
async def on_ready():
print(«Bot is online»)

@Bot.command(pass_context=True)
async def hello(ctx):
await Bot.say(«hello»)

#запуск бота!
Bot.run(«Не палю токен»)

САМА ОШИБКА:

Ignoring exception in command hello:
Traceback (most recent call last):
File «C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py», line 83, in wrapped
ret = await coro(*args, **kwargs)
File «C:\PYTHON\DiscordBot.py», line 13, in hello
await Bot.say(«hello»)
AttributeError: ‘Bot’ object has no attribute ‘say’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File «C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\bot.py», line 892, in invoke
await ctx.command.invoke(ctx)
File «C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py», line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
File «C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py», line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: ‘Bot’ object has no attribute ‘say’


Добавить комментарий