Ugly workaround/hotfix for message fetching
This commit is contained in:
parent
499511f79d
commit
8da47e53e6
9 changed files with 31 additions and 14 deletions
12
backend/src/utils/hotfixMessageFetch.ts
Normal file
12
backend/src/utils/hotfixMessageFetch.ts
Normal 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);
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue