This commit is contained in:
Dragory 2021-08-19 01:02:59 +03:00
parent 86ccae016b
commit cc9aaf235e
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

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