3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

fix imports & change comment

This commit is contained in:
metal 2021-08-27 11:26:40 +00:00 committed by GitHub
parent 91e59ec3a4
commit ece2a4575a

View file

@ -1,4 +1,3 @@
import { BaseGuildTextChannel, Channel, GuildChannel, NewsChannel, TextChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { StarboardMessage } from "../../../data/entities/StarboardMessage";
import { noop } from "../../../utils";
@ -11,7 +10,7 @@ export async function removeMessageFromStarboard(
// fixes stuck entries on starboard_reactions table after messages being deleted, probably should add a cleanup script for this as well, i.e. DELETE FROM starboard_reactions WHERE message_id NOT IN (SELECT id FROM starboard_messages)
await pluginData.state.starboardReactions.deleteAllStarboardReactionsForMessageId(msg.message_id).catch(noop);
// just re-do the deletion, i know this isnt clean but i dont care
// this code is now Almeida-certified and no longer ugly :ok_hand: :cake:
const channel = pluginData.client.channels.cache.find(c => c.id === msg.starboard_channel_id);
if (!channel?.isText()) return;
const message = await channel.messages.fetch(msg.starboard_message_id).catch(noop);