3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Ugly workaround/hotfix for message fetching

This commit is contained in:
Dragory 2021-08-19 00:49:06 +03:00
parent 499511f79d
commit 8da47e53e6
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
9 changed files with 31 additions and 14 deletions

View file

@ -0,0 +1,12 @@
import { GuildChannel, Message, TextChannel, ThreadChannel } from "discord.js";
import { Queue } from "../Queue";
import { sleep } from "../utils";
const queue = new Queue();
export function hotfixMessageFetch(channel: TextChannel | ThreadChannel, messageId: string): Promise<Message> {
return queue.add(async () => {
await sleep(3000);
return channel.messages.fetch(messageId);
});
}