Fix loggers
Some logger messages were missing requestId and guildId
This commit is contained in:
parent
c2d8838cf8
commit
0d5c3d30a9
|
@ -16,7 +16,7 @@ export default new Command({
|
||||||
const guildId = command.guildId!
|
const guildId = command.guildId!
|
||||||
logger.info("Got command for closing poll!", { guildId: guildId, requestId })
|
logger.info("Got command for closing poll!", { guildId: guildId, requestId })
|
||||||
if (!command.guild) {
|
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 :(")
|
command.followUp("Es gab leider ein Problem. Ich konnte deine Anfrage nicht bearbeiten :(")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,7 @@ async function updateMessage(movie: string, message: Message, guildId: string, r
|
||||||
const options: MessageEditOptions = {
|
const options: MessageEditOptions = {
|
||||||
content: body,
|
content: body,
|
||||||
}
|
}
|
||||||
|
logger.info("Updating message.", {guildId: guildId, requestId})
|
||||||
message.edit(options)
|
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`
|
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.debug(`Updating event: ${JSON.stringify(voteEvent, null, 2)}`, { guildId: guildId, requestId })
|
||||||
|
logger.info("Updating event.", {guildId: guildId, requestId})
|
||||||
voteEvent.edit(options)
|
voteEvent.edit(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +103,7 @@ type Vote = {
|
||||||
|
|
||||||
async function getVotesByEmote(message: Message, guildId: string, requestId: string): Promise<Vote[]> {
|
async function getVotesByEmote(message: Message, guildId: string, requestId: string): Promise<Vote[]> {
|
||||||
const votes: Vote[] = []
|
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++) {
|
for (let i = 0; i < Object.keys(Emotes).length / 2; i++) {
|
||||||
const emote = Emotes[i]
|
const emote = Emotes[i]
|
||||||
logger.debug(`Getting reaction for emote ${emote}`, { guildId: guildId, requestId })
|
logger.debug(`Getting reaction for emote ${emote}`, { guildId: guildId, requestId })
|
||||||
|
|
|
@ -27,7 +27,7 @@ export async function execute(event: GuildScheduledEvent) {
|
||||||
logger.debug(`Movies: ${JSON.stringify(movies.map(movie => movie.name))}`, { guildId: event.guildId, requestId })
|
logger.debug(`Movies: ${JSON.stringify(movies.map(movie => movie.name))}`, { guildId: event.guildId, requestId })
|
||||||
|
|
||||||
const channel: TextChannel = <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
|
const channel: TextChannel = <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"
|
let message = "[Abstimmung]\nEs gibt eine neue Abstimmung für die nächste Watchparty! Stimme hierunter für den nächsten Film ab!\n"
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@ export class JellyfinHandler {
|
||||||
logger.info(`${count} random movies requested.`, { guildId: guildId, requestId })
|
logger.info(`${count} random movies requested.`, { guildId: guildId, requestId })
|
||||||
const allMovies = await this.getAllMovies(guildId, requestId)
|
const allMovies = await this.getAllMovies(guildId, requestId)
|
||||||
if (count >= allMovies.length) {
|
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
|
return allMovies
|
||||||
}
|
}
|
||||||
const movies: BaseItemDto[] = []
|
const movies: BaseItemDto[] = []
|
||||||
|
|
Loading…
Reference in New Issue