Add REST request/429 debugging, temporarily disable message fetch hotfix

This commit is contained in:
Dragory 2021-08-19 21:15:31 +03:00
parent 53fea6b88c
commit 187e8235be
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
3 changed files with 36 additions and 12 deletions

View file

@ -8,14 +8,16 @@ let n = 0;
export function hotfixMessageFetch(channel: TextChannel | ThreadChannel, messageId: string): Promise<Message> {
const thisN = ++n;
// tslint:disable-next-line:no-console
console.trace(
`[${thisN}] Queueing to fetch message id ${messageId} from channel ${channel.id} (queue size: ${queue.length})`,
);
return queue.add(async () => {
await sleep(3000);
// tslint:disable-next-line:no-console
console.log(`[${thisN}] Fetching message id ${messageId} from channel ${channel.id}`);
return channel.messages.fetch(messageId);
});
return channel.messages.fetch(messageId);
// // tslint:disable-next-line:no-console
// console.trace(
// `[${thisN}] Queueing to fetch message id ${messageId} from channel ${channel.id} (queue size: ${queue.length})`,
// );
// return queue.add(async () => {
// await sleep(3000);
// // tslint:disable-next-line:no-console
// console.log(`[${thisN}] Fetching message id ${messageId} from channel ${channel.id}`);
// return channel.messages.fetch(messageId);
// });
}