Skip to content
Advertisement

Creating Discord Bot method that moves messages as embeded message

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

JavaScript

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.

Advertisement

Answer

@Buster’s solution worked correctly except for when a user uploaded a picture as a file attached to the message. To fix this I ended up setting the image of the embedded message with the proxy_url of the image attached. my whole move command is as followed.

JavaScript

Thanks to everyone that helped with this problem.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement