Closed Meff1u closed 10 hours ago
also tried to fetch the message if it is of type 'REPLY', unfortunately the result is the same.
else if (message.type == 'REPLY') {
const replymessage = await client.channels.cache.get(message.channelId).messages.fetch(message.id);
console.log(replymessage);
}
Can you provide me with a basic code snippet to test? I have botId
and command
(args).
If you’re using a personal bot and prefer not to share details, could you try with a popular bot and let me know?
This is what happens when I use the popular bot “Ballsdex”. After catching a ball (it opens a modal in which you have to enter the correct name) it makes a reply like the one you see in the picture added to this post.
I tried to repeat the whole sequence with my own bot (button, modal, interaction reply) only that in my case the content was no longer empty. I use that "You caught ballname
" reply to rename local file with that ball name:
client.on('messageCreate', async (message) => {
if (guilds.includes(message.guildId)) {
if (message.author.id === '999736048596816014') { //Ballsdex id
if (message.type == 'REPLY') {
const replychannel = await client.channels.fetch(message.channelId);
const replymessage = await replychannel.messages.fetch(message.id);
if (replymessage.content.includes("You caught")) {
renameFile(replymessage);
}
}
}
}
});
^ That's what i have for now and it still doesnt work. The entire event has executed several times, but not once has the renameFile function occurred
I just decided to fetch a message whose message.content was empty, but at the once('ready') event and this time the content is not empty, but why is it empty at the messageCreate event? (In addition, it is strange that fetching this message in this event also returns an empty message.content)
const quicktestch = await client.channels.fetch('825250865408376843');
const quicktestmsg = await quicktestch.messages.fetch('1304529842662019105');
console.log(quicktestmsg);
I added a 5-second wait before fetching the message and.... works lol
Inside renameFile():
await new Promise(resolve => setTimeout(resolve, 5000));
const replychannel = await client.channels.fetch(rmessage.channelId);
const message = await replychannel.messages.fetch(rmessage.id);
console.log(message);
If so, here’s the response process the bot followed:
You send a command -> Bot replies with defer_reply
(an empty message) -> You see this message in your selfbot -> Bot edits the reply -> You see the updated message on Discord.
So, you should use an additional event, messageUpdate
, or I could add a method to retrieve edited messages.
Also having a similar issue, I should just move this logic to a messageUpdate
event?
Now everything is becoming clear... I'll try moving this to the messageUpdate
event and let you know if it works.
Yeah, it works fine with messageUpdate event.
Which package has the bugs?
The core library
Issue description
Console.log message content:
Message:
Code sample
Package version
3.4.2
Node.js version
20.11.1
Operating system
Windows 11
Priority this issue should have
Medium (should be fixed soon)
Checklist
Additional Information
A couple of months ago it was still working. Yesterday I decided to go back to the project I was doing and update it and I just noticed that the content is empty on the interaction responses