0
votes

I"m trying something very simple, I'm just having a discord bot echo certain messages in certain channels into one channel, but much like the person here: Discord does not embed link when sent by my bot My bot's messages aren't auto-embedding.

Here's a snippet of the code I'm using, I removed a bunch of the unrelated stuff in-between.

async def on_message(message):
    if message.author == client.user:
    return
    if (message.channel.name != 'discussion'):
        if message.channel.category != None:
            print(f'Posting message in {message.channel.category.name} {message.channel.name} from {message.author.name} to {chnglogchannel.name}\n')
            if message.content.startswith("```"):
                await chnglogchannel.send("```From {0} in {1} {2}\n{3}```".format(message.author.name, message.channel.category.name, message.channel.name, (message.content).strip('`')))
            else:
                await chnglogchannel.send("```From {0} in {1} {2}\n{3}```".format(message.author.name, message.channel.category.name, message.channel.name, message.content))
        else:
            print(f'Posting message in {message.channel.name} from {message.author.name} to {chnglogchannel.name}\n')
            if message.content.startswith("```"):
                await chnglogchannel.send("```From {0} in {1}\n{2}```".format(message.author.name, message.channel.name, (message.content).strip('`')))
            else:
                await chnglogchannel.send("```From {0} in {1}\n{2}```".format(message.author.name, message.channel.name, message.content))
        return

I thought maybe it was a channel permission issue, but the bot's role has full permissions to do everything in the channel it's echoing to.

Do I need to manually parse out http links and/or images/videos/etc? Or should Discord be treating the bot messages like any other users' messages?

Thanks for any help anyone can provide.

1

1 Answers

0
votes

You can always manually send an embed with the message.