++debug
This commit is contained in:
parent
86ccae016b
commit
cc9aaf235e
1 changed files with 6 additions and 1 deletions
|
@ -3,12 +3,17 @@ import { Queue } from "../Queue";
|
||||||
import { sleep } from "../utils";
|
import { sleep } from "../utils";
|
||||||
|
|
||||||
const queue = new Queue();
|
const queue = new Queue();
|
||||||
|
let n = 0;
|
||||||
|
|
||||||
export function hotfixMessageFetch(channel: TextChannel | ThreadChannel, messageId: string): Promise<Message> {
|
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 () => {
|
return queue.add(async () => {
|
||||||
await sleep(3000);
|
await sleep(3000);
|
||||||
// tslint:disable-next-line:no-console
|
// 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);
|
return channel.messages.fetch(messageId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue