add a message parser to vote controller
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m33s
Run unit tests / test (pull_request) Successful in 1m27s

parses a vote message line by line to extract
- eventdate
- eventid
- movies
- votes
This depends on the structure of the message to not change substantially.
as such it's quite brittle
This commit is contained in:
2023-07-13 22:47:28 +02:00
parent fe45445811
commit e54f03292e
2 changed files with 61 additions and 17 deletions

View File

@ -10,6 +10,7 @@ import { logger } from "../logger";
import { CommandType } from "../types/commandTypes";
import { isInitialAnnouncement } from "../helper/messageIdentifiers";
import VoteController from "../helper/vote.controller";
import { yavinJellyfinHandler } from "../..";
@ -17,7 +18,7 @@ export class ExtendedClient extends Client {
private eventFilePath = `${__dirname}/../events`
private commandFilePath = `${__dirname}/../commands`
private jellyfin: JellyfinHandler
public voteController: VoteController = new VoteController()
public voteController: VoteController = new VoteController(this, yavinJellyfinHandler)
public commands: Collection<string, CommandType> = new Collection()
private announcementChannels: Collection<string, TextChannel> = new Collection() //guildId to TextChannel
private announcementRoleHandlerTask: Collection<string, ScheduledTask> = new Collection() //one task per guild