E
E
EcoTry2021-06-01 16:20:55
Python
EcoTry, 2021-06-01 16:20:55

Problem with Embed in command. How to decide?

For some reason I can't create an Embed in a command

@bot.command(name='resume', help='Эта команда продолжает музыку')
async def resume(ctx):
    voice = discord.utils.get(bot.voice_clients,guild=ctx.guild)
    if voice.is_paused():
        voice.resume()

        emb1 = discord.Embed(title='Продолжается', color=0x90EE90)
        emb1.add_field(name="Композиция:", value=player.title, inline=True)
        emb1.set_thumbnail(url='https://cdn.discordapp.com/avatars/843118472892645377/e3dbb8f2b78f00b072ada3399c652b79.webp?size=128')
        await ctx.send(embed=emb1)
    else:
        emb = discord.Embed(title='Ошибка', color=0xff0000)
        emb.add_field(name='Музыка не остановлена:', value='Остановите музыку', inline=False)
        emb.set_thumbnail(url='https://cdn.discordapp.com/avatars/843118472892645377/e3dbb8f2b78f00b072ada3399c652b79.webp?size=128')
        await ctx.send(embed=emb)


discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Command' object has no attribute 'title'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-06-01
@EcoTry

Post the full code.
Actually, it looks like you've overridden player. Most likely you already have such a function somewhere in your code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question