use branded types for messageType determination
This commit is contained in:
@ -9,7 +9,7 @@ import { JellyfinHandler } from "../jellyfin/handler";
|
||||
import { logger } from "../logger";
|
||||
import { CommandType } from "../types/commandTypes";
|
||||
import { checkForPollsToClose } from "../commands/closepoll";
|
||||
import { messageIsInitialAnnouncement } from "../helper/messageIdentifiers";
|
||||
import { isInitialAnnouncement } from "../helper/messageIdentifiers";
|
||||
import VoteController from "../helper/vote.controller";
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@ export class ExtendedClient extends Client {
|
||||
}
|
||||
this.announcementRoleHandlerTask.set(guild.id, schedule("*/10 * * * * *", async () => {
|
||||
const requestId = uuid()
|
||||
const messages = (await textChannel.messages.fetchPinned()).filter(message => messageIsInitialAnnouncement(message))
|
||||
const messages = (await textChannel.messages.fetchPinned()).filter(message => isInitialAnnouncement(message))
|
||||
|
||||
if (messages.size > 1) {
|
||||
logger.error("More than one pinned announcement Messages found. Unable to know which one people react to. Please fix!", { guildId: guild.id, requestId })
|
||||
|
Reference in New Issue
Block a user