I've been noticing an issue recently where when calling channel.messages.fetchPinned() my bot hangs. It doesn't return even when waiting 20 mins or so. I do call fetchPinned for 100+ channels in a server as part of the function where this happens so not sure if this is something rate limit related, but once it gets stuck even if I wait 30 mins and try to fetch pins in a single channel it still hangs.
for (let location of locations) { let channel = guild.channels.cache.get(location.id) as TextChannel; if (channel) { let pinned = await channel.messages.fetchPins(); if (!pinned) { str += '<#' + channel.id + '> has no pins.\n'; } else { if (pinned.size < pins) { str += '<#' + channel.id + '> Pin Number: ' + pinned.size + '\n'; } } } }
for (let location of locations) { let channel = guild.channels.cache.get(location.id) as TextChannel; if (channel) { let pinned = await channel.messages.fetchPins(); if (!pinned) { str += '<#' + channel.id + '> has no pins.\n'; } else { if (pinned.size < pins) { str += '<#' + channel.id + '> Pin Number: ' + pinned.size + '\n'; } } } }
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
d-Iaa
discord.js - Imagine an app
Support server for discord.js, a Node.js module to interact with Discord's apps API.