diff --git a/server/commands/closepoll.ts b/server/commands/closepoll.ts index 66131cc..062df9e 100644 --- a/server/commands/closepoll.ts +++ b/server/commands/closepoll.ts @@ -16,7 +16,7 @@ export default new Command({ const guildId = command.guildId! logger.info("Got command for closing poll!", { guildId: guildId, requestId }) if (!command.guild) { - logger.error("No guild found in interaction. Cancelling closing request") + logger.error("No guild found in interaction. Cancelling closing request", {guildId: guildId, requestId}) command.followUp("Es gab leider ein Problem. Ich konnte deine Anfrage nicht bearbeiten :(") return } @@ -68,6 +68,7 @@ async function updateMessage(movie: string, message: Message, guildId: string, r const options: MessageEditOptions = { content: body, } + logger.info("Updating message.", {guildId: guildId, requestId}) message.edit(options) } @@ -90,6 +91,7 @@ async function updateEvent(votes: Vote[], guild: Guild, guildId: string, request description: `!wp\nNummer 2: ${votes[1].movie} mit ${votes[1].count - 1} Stimmen\nNummer 3: ${votes[2].movie} mit ${votes[2].count - 1} Stimmen` } logger.debug(`Updating event: ${JSON.stringify(voteEvent, null, 2)}`, { guildId: guildId, requestId }) + logger.info("Updating event.", {guildId: guildId, requestId}) voteEvent.edit(options) } @@ -101,7 +103,7 @@ type Vote = { async function getVotesByEmote(message: Message, guildId: string, requestId: string): Promise { const votes: Vote[] = [] - logger.debug(`Number of items in emotes: ${Object.values(Emotes).length}`) + logger.debug(`Number of items in emotes: ${Object.values(Emotes).length}`, {guildId: guildId, requestId}) for (let i = 0; i < Object.keys(Emotes).length / 2; i++) { const emote = Emotes[i] logger.debug(`Getting reaction for emote ${emote}`, { guildId: guildId, requestId }) diff --git a/server/events/guildScheduledEventCreate.ts b/server/events/guildScheduledEventCreate.ts index e997807..da1985c 100644 --- a/server/events/guildScheduledEventCreate.ts +++ b/server/events/guildScheduledEventCreate.ts @@ -27,7 +27,7 @@ export async function execute(event: GuildScheduledEvent) { logger.debug(`Movies: ${JSON.stringify(movies.map(movie => movie.name))}`, { guildId: event.guildId, requestId }) const channel: TextChannel = (await event.guild?.channels.fetch())?.filter(channel => channel!.id === config.bot.announcement_channel_id).map((value, _) => value)[0] //todo: needs to be done less sketchy - logger.debug(`Found channel ${JSON.stringify(channel, null, 2)}`) + logger.debug(`Found channel ${JSON.stringify(channel, null, 2)}`, { guildId: event.guildId, requestId }) let message = "[Abstimmung]\nEs gibt eine neue Abstimmung für die nächste Watchparty! Stimme hierunter für den nächsten Film ab!\n" diff --git a/server/jellyfin/handler.ts b/server/jellyfin/handler.ts index 7bdd0df..4bd5c67 100644 --- a/server/jellyfin/handler.ts +++ b/server/jellyfin/handler.ts @@ -248,7 +248,7 @@ export class JellyfinHandler { logger.info(`${count} random movies requested.`, { guildId: guildId, requestId }) const allMovies = await this.getAllMovies(guildId, requestId) if (count >= allMovies.length) { - logger.info(`${count} random movies requested but found only ${allMovies.length}. Returning all Movies.`) + logger.info(`${count} random movies requested but found only ${allMovies.length}. Returning all Movies.`, { guildId: guildId, requestId }) return allMovies } const movies: BaseItemDto[] = []