I want the bot fetch a message(embed) and send it to channel where command is invoked. Following code works fine for normal text message:
@bot.command()
async def fetch(ctx):
channel = bot.get_channel(736984092368830468)
msg = await channel.fetch_message(752779298439430164)
await ctx.send(msg.content)
For sending embeds I tried:
@bot.command()
async def fetch(ctx):
channel = bot.get_channel(736984092368830468)
msg = await channel.fetch_message(752779298439430164)
await ctx.send(msg.embeds.copy())
It sends this instead of sending embed:
How do I make the bot copy and send embed?
msg.embeds.copy()
actually returns an Embed object (you can see it in the module's source code). I have not tried it yet, but seems likectx.send()
has a parameter calledembed
. Maybe you should tryawait ctx.send(embed=msg.embeds.copy())
– Nicholas Obertdiscord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'list' object has no attribute 'to_dict'
@NicholasObert – user13878676