пишу бота на дискорде и он мне такую вот ошибочку выдаёт:
File "C:\Users\nasty\Desktop\discord\test.py", line 21, in gdz
your_class = message_response.content
AttributeError: 'coroutine' object has no attribute 'content'
и такую
File "C:\Users\nasty\Desktop\discord\test.py", line 20, in
message_response = client.wait_for('message', check=lambda m: m.user == ctx.user)
AttributeError: 'Message' object has no attribute 'user'
сам код:
client = commands.Bot( command_prefix = '!')
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.command( pass_context = True )
async def gdz(ctx):
await ctx.send('В каком вы классе? (8, 7, 9...)')
message_response = client.wait_for('message', check=lambda m: m.client == ctx.client)
your_class = message_response.content
await ctx.send('По какому предмету? (Геометрия, Физика, Химия...)')
message_response = client.wait_for('message')
your_pred = message_response.content
await ctx.send('Какой автор?(Пичугов, Вербицкая, Атанасян...)')
message_response = client.wait_for('message', check=lambda m: m.client == ctx.client)
your_auth = message_response.content
await ctx.send('Какой номер?(100, 1564, 290...)')
message_response = client.wait_for('message', check=lambda m: m.client == ctx.client)
your_num = message_response.content
if your_pred == 'Геометрия' and your_auth == 'Атанасян':
await ctx.send('https://gdz.ru/' + 'class-8' + '/' + 'geometria' + '/' + 'atanasyan-8' + '/' + your_num + '-task/')
elif your_auth == 'Пичугов':
await ctx.send('https://gdz.ru/' + 'class-' + your_class + '/' + 'russkii_yazik' + '/' + 'pichugov-praktika-' + your_class + '/' + your_num + '-nom/')