print('Loading...')
import discord, asyncio, config, os
from discord.ext import commands
from discord.ext.commands import Bot
prefix = config.prefix
bot = commands.Bot(command_prefix = prefix)
@bot.event
async def on_ready():
os.system('cls')
print('Complete!\n')
async def on_message(message):
print('{0.author}\n {0.content}\n'.format(message))
@bot.command()
async def say(message):
args = message.content
await message.channel.send(args.lstrip('{}say'.format(prefix)))
bot.run(Мой токен)
Выдает ошибку:
Ignoring exception in command say:
Traceback (most recent call last):
File "C:\Users\ \AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "D:\ \ \ \bot.py", line 19, in say
args = message.content
AttributeError: 'Context' object has no attribute 'content'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\ \AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\ \AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\ \AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'content'
Как я понял, он говорит, что у message нет content, но в документации пишется другое - https://discordpy.readthedocs.io/en/latest/api.htm...