#🔒 Is it possible to copy and send embeds?

6 messages · Page 1 of 1 (latest)

shut yarrow
#

I'm trying to have my bot copy an embed from a webhook in a channel in a different server and then re-send that same embed in a channel in my server.

I'm just wondering, is it even possible? I'm using an older version of python in purpose which could explain it but is that even my issue or is there some workaround?

@client.event
async def on_message(message):
    if message.webhook_id:
        source_guild = client.get_guild(SOURCE_GUILD_ID)
        dest_guild = client.get_guild(DESTINATION_GUILD_ID)

        if not source_guild or not dest_guild:
            return

        if message.channel.id == SOURCE_CHANNEL_ID:
            dest_channel = dest_guild.get_channel(DESTINATION_CHANNEL_ID)
            if dest_channel:
                if message.content:
                    await dest_channel.send(message.content)
                for embed in message.embeds:
                    await dest_channel.send(embed=embed)
                for attachment in message.attachments:
                    await dest_channel.send(attachment.url)

    await client.process_commands(message)

TypeError: Messageable.send() got an unexpected keyword argument 'embed'

azure cometBOT
#

@shut yarrow

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

shut yarrow
#

nevermind i figured it out

#

!close

azure cometBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.