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

@ -1,6 +1,7 @@
import { Message, Snowflake, TextChannel, ThreadChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { MessageSaverPluginType } from "./types";
import { hotfixMessageFetch } from "../../utils/hotfixMessageFetch";
export async function saveMessagesToDB(
pluginData: GuildPluginData<MessageSaverPluginType>,
@ -15,7 +16,7 @@ export async function saveMessagesToDB(
let thisMsg: Message;
try {
thisMsg = await channel.messages.fetch(id as Snowflake);
thisMsg = await hotfixMessageFetch(channel, id as Snowflake);
if (!thisMsg) {
failed.push(id);