A
A
artem2109082021-08-29 18:35:45
Python
artem210908, 2021-08-29 18:35:45

How to fix "object has no attribute" error?

The code:

@bot.command(pass_context=True)
@commands.has_role('Учитель')
async def mute(ctx, member: discord.Member):
  if member == ctx.author:
    await ctx.send('Вы не можете себя замутить')

Mistake:

@bot.command(pass_context=True)
AttributeError: 'Command' object has no attribute 'command'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
link_vrb, 2021-08-31
@link_vrb

This error says that the bot variable of type Command does not have a command method, that is, either there is an error in the name of the method or there is no .command method

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question