aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
704 stars 145 forks source link

channel.messages.fetch not working #1102

Closed skzhengkai closed 3 months ago

skzhengkai commented 3 months ago

Which package has the bugs?

The core library

Issue description

Message.channel.messages.fetch is not working. No errors are thrown, it simply seems to never finish.

Code sample

client.on('messageCreate', async (message) => {
  if (message.content.startsWith('!getlast')) {
    const channel = message.channel;
    console.log(`channel: ${channel.name}`)
    const messages = await message.channel.messages.fetch({ limit: 20 });
    console.log(`messages: ${messages.size}`)
    const filteredMessages = messages.filter(msg => !msg.author.bot).reverse();
    console.log(filteredMessages)
    const formattedMessages = filteredMessages.map((msg, index) => `${index + 1}. ${msg.author.username} (${msg.createdAt.toLocaleString()}): ${msg.content}`);
    console.log(`\`\`\`\n${formattedMessages.join('\n')}\n\`\`\``);
  }
});

Package version

2.15.1

Node.js version

18.12.1

Operating system

No response

Priority this issue should have

Medium (should be fixed soon)

Checklist

Additional Information

No response

skzhengkai commented 3 months ago

The issue was using Replit IP.