I've been learning how to code a discord bot recently and I've hit a wall. I am wanting to create a method that allows me to move messages from one channel to another. I created a solution that works but not how I would like it to. Idealy I would want to just have the bot almost do a reddit repost where it takes the exact message and just has it embedded. Currently what I have for the method is
@client.event
async def on_message(message):
author = message.author
content = message.context
channel = message.channel
if message.content.startswith('!move'):
#code to process the input, nothing special or important to this
for i in fetchedMessages:
embededMessage = discord.Embed()
embededMessage.description = i.context
embededMessage.set_author(name=i.author, icon_url=i.author.avatar_url)
await channelToPostIn.send(embeded=embededMessage)
# delete the old message
i.delete()
Now this works perfectly for text messages but not for images or for example if the post was embedded in the first place. If someone has a more elegant solution or is able to point me in the right direction in the documentation I would be much appreciative. Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…