You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to forward a message from source channel ID and send it to a target channel ID
The variables are all declared, but the forward function is just not working, I’m not sure why. It’s supposed to only need the target channel ID as a parameter. If anyone has an example code they can send, please do because I’m very confused.
This is the error: Error forwarding message: cannot send an empty message
but when i logged the source message’s content, it did have content, and was also a regular text message.
constDiscord=require('discord.js-selfbot-v13');constAuthorization=process.env.Authorization;constSOURCE_CHANNEL_ID='00000';constMESSAGE_ID='00000';constTARGET_CHANNEL_ID='00000';// IDs I used are blanked by 0s in this discussion constclient=newDiscord.Client({checkUpdate: false});client.once('ready',async()=>{try{// Fetch the source channelconstsourceChannel=awaitclient.channels.fetch(SOURCE_CHANNEL_ID);if(!sourceChannel){console.error('Source channel not found.');return;}// Fetch the specific messageconstmessage=awaitsourceChannel.messages.fetch(MESSAGE_ID);if(!message){console.error('Message not found.');return;}// Fetch the target channelconsttargetChannel=awaitclient.channels.fetch(TARGET_CHANNEL_ID);if(!targetChannel){console.error('Target channel not found.');return;}// Forward the message to the target channelconstforwardedMessage=awaitmessage.forward(targetChannel);console.log(`Message successfully forwarded`);}catch(error){console.error('Error forwarding message:',error.message);}});client.login(Authorization);
Which package has the bugs?
The core library
Issue description
I’m trying to forward a message from source channel ID and send it to a target channel ID
The variables are all declared, but the forward function is just not working, I’m not sure why. It’s supposed to only need the target channel ID as a parameter. If anyone has an example code they can send, please do because I’m very confused.
This is the error:
Error forwarding message: cannot send an empty message
but when i logged the source message’s content, it did have content, and was also a regular text message.
This is the forward function on the documentation page: https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Message?scrollTo=forward. I hope that I submitted this right
Code sample
Package version
[email protected]
Node.js version
Node v22.13.0
Operating system
Windows 11
Priority this issue should have
Medium (should be fixed soon)
Checklist
Additional Information
No response
The text was updated successfully, but these errors were encountered: