feat/40-reroll-on-disinterest #54

Merged
kenobi merged 73 commits from feat/40-reroll-on-disinterest into master 2023-11-19 20:24:36 +01:00
Owner

closes #40

closes #40
kenobi added 3 commits 2023-06-25 01:57:59 +02:00
stub for reactionhandling
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m14s
Run unit tests / test (pull_request) Successful in 1m38s
b8a32aab40
kenobi changed title from feat/40-reroll-on-disinterest to WIP: feat/40-reroll-on-disinterest 2023-06-25 19:39:39 +02:00
kenobi added 6 commits 2023-06-25 22:49:27 +02:00
This is necessary because message sent before the bot has started up are not cached and reactions will not be registered.
If the messages are cached manually the reactions will be received and can be processed using the regular event handling
WIP: basic handling of adding a reaction to a message and deciding whether to reroll or not
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m21s
Run unit tests / test (pull_request) Successful in 1m53s
d9d1d74ef9
kenobi self-assigned this 2023-06-26 14:30:24 +02:00
kenobi added a new dependency 2023-06-26 14:30:39 +02:00
kenobi removed a dependency 2023-06-26 14:31:24 +02:00
kenobi added 3 commits 2023-06-26 23:51:18 +02:00
- rename
- externalise handling of none_of_that to vote controller
- base for extensions for more reaction handling
prepare unicode representation of emoji for cleaner handling as pure ASCII
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m45s
Run unit tests / test (pull_request) Successful in 1m34s
8ad651c753
emoji handling in editors and browsers is iffy, as such a pure ascii code base is easier to handle (imho)
magnetotail reviewed 2023-06-27 18:34:44 +02:00
@ -0,0 +9,4 @@
export async function execute(messageReaction: MessageReaction, user: User) {
if (user.id == client.user?.id)
logger.info('Skipping bot reaction')
Collaborator

need to return here

need to return here
Author
Owner

added

added
kenobi marked this conversation as resolved
magnetotail reviewed 2023-06-27 18:40:14 +02:00
@ -0,0 +12,4 @@
if (!messageReaction.message.guild) return 'No guild'
if (messageIsVoteMessage(reactedUponMessage)) {
logger.debug(`${reactedUponMessage.id} is vote message`, { requestId, guildId })
if (messageReaction.message.reactions.cache.find(reaction => reaction.emoji.toString() == NONE_OF_THAT)) {
Collaborator

duplicate check. already checked before call in handleMessageReactionAdd

duplicate check. already checked before call in handleMessageReactionAdd
Author
Owner

removed

removed
kenobi marked this conversation as resolved
magnetotail reviewed 2023-06-27 18:40:30 +02:00
@ -0,0 +10,4 @@
public async handleNoneOfThatVote(messageReaction: MessageReaction, user: User, reactedUponMessage: Message, requestId: string, guildId: string) {
if (!messageReaction.message.guild) return 'No guild'
if (messageIsVoteMessage(reactedUponMessage)) {
Collaborator

Move check to handleMessageReactionAdd

Move check to handleMessageReactionAdd
Author
Owner

moved

moved
kenobi marked this conversation as resolved
magnetotail reviewed 2023-06-27 18:41:36 +02:00
@ -0,0 +1,31 @@
Collaborator

Rename file to something like "handleVoteReaction" to make it separate from future reactionadd handlers

Rename file to something like "handleVoteReaction" to make it separate from future reactionadd handlers
Author
Owner

Agreement to use handleMessageReactionAdd as a 'reaction pre processor' to hand off reaction emoji to other handling methods and keep the eventHandler itself generic.

Agreement to use handleMessageReactionAdd as a 'reaction pre processor' to hand off reaction emoji to other handling methods and keep the eventHandler itself generic.
kenobi marked this conversation as resolved
magnetotail reviewed 2023-06-27 18:44:28 +02:00
@ -0,0 +1,11 @@
import { Message } from "discord.js";
export function messageIsVoteMessage(msg: Message): boolean {
Collaborator

Would like an enum of message types and a method with input message and output array of message types for possible messages with multiple things.

Also maybe remove message at start of function names to improve visibility by shorter function name. "isVoteMessage(message)" is precise and readable enough

Would like an enum of message types and a method with input message and output array of message types for possible messages with multiple things. Also maybe remove message at start of function names to improve visibility by shorter function name. "isVoteMessage(message)" is precise and readable enough
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-06-27 18:45:35 +02:00
server/logger.ts Outdated
@ -1,5 +1,8 @@
import { createLogger, format, transports } from "winston"
import { config } from "./configuration"
import { v4 } from "uuid"
export const newRequestId = v4()
Collaborator

why?

why?
Author
Owner

This is a complete and total, boneheaded error :D
The intention was to present an more memorizable way to get a new uuid/v4.
Instead this just sets it once, making it useless.
It should be an exported function, returning the output of v4() and the callsite would be
const requestId = newRequestId()
This would prevent the
import { v4 as uuid } from "uuid" or const requestId = v4() which, I think, are tedious or non-obvious.
If you think this is a bad idea, I will gladly revert it though :)

This is a complete and total, boneheaded error :D The _intention_ was to present an more memorizable way to get a new uuid/v4. Instead this just sets it once, making it useless. It _should_ be an exported function, returning the output of `v4()` and the callsite would be `const requestId = newRequestId()` This would prevent the `import { v4 as uuid } from "uuid"` or `const requestId = v4()` which, I think, are tedious or non-obvious. If you think this is a bad idea, I will gladly revert it though :)
Collaborator

I dont think it's bad tbh if we dont need the v4 as uuid import then. But I would also like an eventhandler framework where we would prevent usual boilerplate code like looking for guild Id or making a request id and put those base checks and things in a base class and just have handling code in a subclass. But that is quite hard as I learned

I dont think it's bad tbh if we dont need the v4 as uuid import then. But I would also like an eventhandler framework where we would prevent usual boilerplate code like looking for guild Id or making a request id and put those base checks and things in a base class and just have handling code in a subclass. But that is quite hard as I learned
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-06-27 18:46:41 +02:00
@ -81,6 +85,11 @@ export class ExtendedClient extends Client {
logger.info(`Error refreshing slash commands: ${error}`)
}
}
private async fetchAnnouncementChannelMessage(channels: Collection<string, TextChannel>): Promise<void> {
Collaborator

why is this necessary?

why is this necessary?
Author
Owner

It's complicated. I put in some JSDoc comments:

	/**
		* Fetches all messages from the provided channel collection.
		* This is necessary for announcementChannels, because 'old' messages don't receive
		* messageReactionAdd Events, only messages that were sent while the bot is online are tracked
		* automatically.
		* To prevent the need for a dedicated 'Collector' implementation which would listen on specific
		* it's easiest to just fetch all messages from the backlog, which automatically makes the bot track them
		* again.
		* @param {Collection<string, TextChannel>} channels - All channels which should be fecthed for reactionTracking	
		*/

It's complicated. I put in some JSDoc comments: ```ts /** * Fetches all messages from the provided channel collection. * This is necessary for announcementChannels, because 'old' messages don't receive * messageReactionAdd Events, only messages that were sent while the bot is online are tracked * automatically. * To prevent the need for a dedicated 'Collector' implementation which would listen on specific * it's easiest to just fetch all messages from the backlog, which automatically makes the bot track them * again. * @param {Collection<string, TextChannel>} channels - All channels which should be fecthed for reactionTracking */ ```
Collaborator

Figured something like that. Thanks for the comment

Figured something like that. Thanks for the comment
kenobi marked this conversation as resolved
magnetotail reviewed 2023-06-27 18:49:55 +02:00
@ -0,0 +1,15 @@
export enum Emotes { "1⃣", "2⃣", "3⃣", "4⃣", "5⃣", "6⃣", "7⃣", "8⃣", "9⃣", "🔟" }
export const NONE_OF_THAT = "❌"
Collaborator

Can this be integrated into Emoji? Maybe provide method to only get number emojis then? By definition "NONE_OF_THAT" is also an emoji

Can this be integrated into Emoji? Maybe provide method to only get number emojis then? By definition "NONE_OF_THAT" is also an emoji
Collaborator

Emotes got renamed to validVoteEmotes

Emotes got renamed to validVoteEmotes
Author
Owner

fb4ab59dc6
preliminary solution

fb4ab59dc6de62d8f0fa28fb86e3d18078bf919f preliminary solution
magnetotail marked this conversation as resolved
magnetotail requested changes 2023-06-27 18:51:41 +02:00
magnetotail left a comment
Collaborator

Also linting warnings in some files because of unused imports

Also linting warnings in some files because of unused imports
kenobi added 1 commit 2023-06-27 20:08:46 +02:00
adds comment to fetchAnnouncementChannelMessage
All checks were successful
Run unit tests / test (pull_request) Successful in 1m54s
Compile the repository / compile (pull_request) Successful in 57s
ee742018e9
kenobi added 1 commit 2023-06-27 20:19:47 +02:00
fix newRequestId function
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m15s
Run unit tests / test (pull_request) Successful in 1m29s
98d1ca73b5
kenobi added 3 commits 2023-06-27 20:23:46 +02:00
perform vote message check in reaction handler
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m15s
Run unit tests / test (pull_request) Successful in 1m26s
c351e27fdd
kenobi added 1 commit 2023-06-27 20:34:24 +02:00
linting
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m0s
Run unit tests / test (pull_request) Successful in 1m33s
1a13638ed9
Author
Owner

Also linting warnings in some files because of unused imports

fixed

> Also linting warnings in some files because of unused imports fixed
kenobi changed title from WIP: feat/40-reroll-on-disinterest to WIP: feat/40-reroll-on-disinterest 2023-07-05 23:35:31 +02:00
kenobi changed target branch from master to feat/cicd 2023-07-05 23:35:31 +02:00
kenobi changed title from WIP: feat/40-reroll-on-disinterest to WIP: feat/40-reroll-on-disinterest 2023-07-05 23:35:58 +02:00
kenobi changed target branch from feat/cicd to master 2023-07-05 23:35:58 +02:00
kenobi closed this pull request 2023-07-05 23:36:40 +02:00
kenobi reopened this pull request 2023-07-05 23:36:47 +02:00
kenobi added 5 commits 2023-07-13 22:47:32 +02:00
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
e54f03292e
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
kenobi added 1 commit 2023-07-17 21:29:52 +02:00
add none of that as expected value to test
Some checks failed
Compile the repository / compile (pull_request) Successful in 13s
Run unit tests / test (pull_request) Failing after 31s
146848b759
kenobi added 1 commit 2023-07-17 21:30:07 +02:00
move date parsing to separate function
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m10s
Run unit tests / test (pull_request) Successful in 2m6s
fdfe7ce404
kenobi added 3 commits 2023-07-17 22:50:28 +02:00
refactor eventId parsing to separate function
All checks were successful
Compile the repository / compile (pull_request) Successful in 49s
Run unit tests / test (pull_request) Successful in 1m35s
c022cc32d5
prepare for querying discord api for event info instead of parsing via regex
kenobi added 2 commits 2023-07-17 23:31:04 +02:00
extracting, better typing, reduction of complexity
add guildscheduledevents to unit test mock
All checks were successful
Compile the repository / compile (pull_request) Successful in 14m58s
Run unit tests / test (pull_request) Successful in 4m18s
a2adef808f
kenobi added 4 commits 2023-08-06 02:33:32 +02:00
logging
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m21s
Run unit tests / test (pull_request) Successful in 1m26s
8ff5aeff03
kenobi added 1 commit 2023-08-06 02:37:55 +02:00
restructure docker build a bit
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m12s
Run unit tests / test (pull_request) Successful in 1m39s
2ebc7fbdbe
kenobi added 5 commits 2023-08-13 18:35:53 +02:00
now correctly fetches old movies, filters already voted on movies, gets new movies, creates new poll message, deletes old message
formatting for package.json
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m23s
Run unit tests / test (pull_request) Successful in 1m55s
1e912b20ef
Author
Owner

Funktionalität scheint endlich fertig implementiert zu sein.
Jetzt sollten noch Unit Tests folgen.

Funktionalität scheint endlich fertig implementiert zu sein. Jetzt sollten noch Unit Tests folgen.
kenobi added 1 commit 2023-10-21 14:11:53 +02:00
add missing role to test
Some checks failed
Compile the repository / compile (pull_request) Successful in 2m13s
Run unit tests / test (pull_request) Failing after 1m10s
eef3a9c358
kenobi changed title from WIP: feat/40-reroll-on-disinterest to feat/40-reroll-on-disinterest 2023-10-21 14:12:28 +02:00
kenobi added 2 commits 2023-10-21 14:56:37 +02:00
make top pick retain optional during reroll via env var
Some checks failed
Compile the repository / compile (pull_request) Successful in 32s
Run unit tests / test (pull_request) Failing after 40s
e66aebc88c
kenobi added 1 commit 2023-10-21 15:05:29 +02:00
add test-relevant fallback values for unit tests
All checks were successful
Compile the repository / compile (pull_request) Successful in 38s
Run unit tests / test (pull_request) Successful in 1m26s
c73cd20ccf
kenobi added 1 commit 2023-10-24 22:40:00 +02:00
add fake env vars for unit tests
Some checks failed
Compile the repository / compile (pull_request) Successful in 39s
Run unit tests / test (pull_request) Failing after 45s
9cdc6e1934
kenobi added 1 commit 2023-10-24 22:42:09 +02:00
move testenv to correct location
All checks were successful
Run unit tests / test (pull_request) Successful in 1m0s
Compile the repository / compile (pull_request) Successful in 20s
f705b97804
magnetotail reviewed 2023-11-18 12:43:06 +01:00
@ -39,3 +31,3 @@
return
}
let message = `[Abstimmung] für https://discord.com/events/${event.guildId}/${event.id}\n<@&${config.bot.announcement_role}> Es gibt eine neue Abstimmung für die nächste Watchparty ${createDateStringFromEvent(event, event.guildId, requestId)}! Stimme hierunter für den nächsten Film ab!\n`
const sentMessageText = client.voteController.createVoteMessageText(event.id, event.scheduledStartAt, movies, event.guild?.id ?? "", requestId)
Collaborator

Warum erst eine message erstellen lassen die dann vom gleichen controller in der nächsten Zeile verschickt wird? Fände besser dem Controller zu sagen "Schick ne Vote message, hier sind die Infos die du brauchst"

Warum erst eine message erstellen lassen die dann vom gleichen controller in der nächsten Zeile verschickt wird? Fände besser dem Controller zu sagen "Schick ne Vote message, hier sind die Infos die du brauchst"
Author
Owner

True. Habe das handling in den vote controller verlegt.
Die Input Parameter sind dadurch allerdings lang genug geworden, dass ich ein separates Interface dafür erstellt habe.
4600820889

True. Habe das handling in den vote controller verlegt. Die Input Parameter sind dadurch allerdings lang genug geworden, dass ich ein separates Interface dafür erstellt habe. 4600820889d046972bb264912f0ad929c8950dac
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 12:44:24 +01:00
@ -58,3 +36,1 @@
sentMessage.react(NONE_OF_THAT)
// sentMessage.pin() //todo: uncomment when bot has permission to pin messages. Also update closepoll.ts to only fetch pinned messages
sentMessage.pin()
Collaborator

Das pinnen sollte glaube ich auch nicht das event übernehmen sondern der Controller

Das pinnen sollte glaube ich auch nicht das event übernehmen sondern der Controller
Collaborator

Evtl halt über nen Parameter bestimmen. Auf lange Sicht gehört das eigentliche verschicken der Message eh in einen eigenen controller aber der voteController kann die Daten für eine voteMessage entgegennehmen die aufbereiten und dann über den messageController die eigentliche message schicken lassen

Evtl halt über nen Parameter bestimmen. Auf lange Sicht gehört das eigentliche verschicken der Message eh in einen eigenen controller aber der voteController kann die Daten für eine voteMessage entgegennehmen die aufbereiten und dann über den messageController die eigentliche message schicken lassen
Author
Owner
4600820889d046972bb264912f0ad929c8950dac
Author
Owner

gelöst durch das Handling in #54 (comment)
Es gibt noch ein Auftreten vom 'separaten' Pinnen (vote.controller.ts:114). Dort ist ein bisschen mehr refactoring nötig um die Input Paramter zu füllen.
Dieser Kommentar sollte allerdings fertig behandelt sein.

gelöst durch das Handling in https://gitea.brudi.xyz/kenobi/jellyfin-discord-bot/pulls/54#issuecomment-526 Es gibt noch ein Auftreten vom 'separaten' Pinnen (vote.controller.ts:114). Dort ist ein bisschen mehr refactoring nötig um die Input Paramter zu füllen. Dieser Kommentar sollte allerdings fertig behandelt sein.
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 12:45:57 +01:00
@ -0,0 +37,4 @@
return client.voteController.handleNoneOfThatVote(messageReaction, reactedUponMessage, requestId, guildId)
}
if (messageReaction.emoji.toString() === Emoji.one) {
// do something
Collaborator

?

?
Collaborator

Replace this do something with a meaningful todo

Replace this do something with a meaningful todo
Author
Owner

removed
03b6a30ffa

removed 03b6a30ffa67afca9a4bc0563f7bf092bbcdd60b
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 12:51:15 +01:00
@ -0,0 +57,4 @@
}
}
private async removeMessage(msg: Message): Promise<Message<boolean>> {
Collaborator

Parameter die eine Message sind heißen oft "message", manchmal aber auch "msg". sollte vereinheitlicht sein

Parameter die eine Message sind heißen oft "message", manchmal aber auch "msg". sollte vereinheitlicht sein
Author
Owner
66507cb08fa50ba3a7be28388c55b21227fb2261
Author
Owner

fc64728a78

Jetzt sollten alle Occurences beseitigt sein.

fc64728a780f99b56aebff7f0a7c5d24a901d90d Jetzt sollten alle Occurences beseitigt sein.
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 12:53:00 +01:00
@ -0,0 +63,4 @@
}
return await msg.delete()
}
public isAboveThreshold(vote: Vote): boolean {
Collaborator

above WHAT threshold? What does it do??

above WHAT threshold? What does it do??
Author
Owner
20da25f2bf9a473704f8b4660e5f05183679ba39
Author
Owner

Mit einem Kommentar versehen und entsprechend deines vorschlags umbenannt

Mit einem Kommentar versehen und entsprechend deines vorschlags umbenannt
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 12:54:45 +01:00
@ -0,0 +69,4 @@
return aboveThreshold
}
public async handleReroll(voteMessage: VoteMessage, guildId: string, requestId: string) {
//get movies that already had votes to give them a second chance
Collaborator

comment is misleading, voteinfo is also used to get the eventid and eventdate in line 93

comment is misleading, voteinfo is also used to get the eventid and eventdate in line 93
Author
Owner
119343c916b023a926e534575ae803cdec5b9594
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 12:55:51 +01:00
@ -0,0 +64,4 @@
return await msg.delete()
}
public isAboveThreshold(vote: Vote): boolean {
const aboveThreshold = (vote.count - 1) >= 1
Collaborator

threshold seems to be a magic number

threshold seems to be a magic number
Collaborator

Or rename method to "hasAtLeastOneVote"

Or rename method to "hasAtLeastOneVote"
Author
Owner
296a490e935cbdb79b70d73d2df9bc12a5774c53
Author
Owner

done

done
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 12:56:46 +01:00
@ -0,0 +90,4 @@
// create new message
logger.info(`Creating new poll message with new movies: ${movies}`, { requestId, guildId })
const message = this.createVoteMessageText(voteInfo.eventId, voteInfo.eventDate, movies, guildId, requestId)
Collaborator

is not a message, only messagetext

is not a message, only messagetext
Author
Owner
a455fd8ff7e6b8ffb032fb4aed9389da68ee513b
Author
Owner

done

done
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 12:59:41 +01:00
@ -0,0 +73,4 @@
const voteInfo: VoteMessageInfo = await this.parseVoteInfoFromVoteMessage(voteMessage, requestId)
let movies: string[] = Array()
if (config.bot.reroll_retains_top_picks) {
Collaborator

maybe extract this if-else to a method to keep code more compact

maybe extract this if-else to a method to keep code more compact
Author
Owner

7d794a8001
done

7d794a8001a66d068f949c893d689a068c3caeed done
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:00:17 +01:00
@ -0,0 +105,4 @@
}
const sentMessage = await this.sendVoteMessage(message, movies.length, announcementChannel)
sentMessage.pin()
Collaborator

why not pin message in method above?

why not pin message in method above?
Author
Owner

7d794a8001
should have been moved to prepareAndSendVoteMessage()

7d794a8001a66d068f949c893d689a068c3caeed should have been moved to prepareAndSendVoteMessage()
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:01:58 +01:00
@ -0,0 +147,4 @@
}
public parseEventDateFromMessage(message: string, guildId: string, requestId: string): Date {
logger.warn(`Falling back to RegEx parsing to get Event Date`, { guildId, requestId })
const datematcher = RegExp(/((?:0[1-9]|[12][0-9]|3[01])\.(?:0[1-9]|1[012])\.)(?:\ um\ )((?:(?:[01][0-9]|[2][0-3])\:[0-5][0-9])|(?:[2][4]\:00))!/i)
Collaborator

wtf :D

wtf :D
Author
Owner

it's magic

it's magic ✨
kenobi marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:27:30 +01:00
@ -0,0 +171,4 @@
return message
}
public async sendVoteMessage(message: string, movieCount: number, announcementChannel: TextChannel) {
Collaborator

rename message to messageText

rename message to messageText
Author
Owner

done
ca99987a20

done ca99987a20baeceda27cb5e206bff42a54f31b04
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:28:11 +01:00
@ -0,0 +227,4 @@
this.updateEvent(event, votes, guild, guildId, requestId)
this.sendVoteClosedMessage(event, votes[0].movie, guildId, requestId)
}
lastMessage.unpin() //todo: uncomment when bot has permission to pin/unpin
Collaborator

remove todo

remove todo
Author
Owner

removed
ca99987a20

removed ca99987a20baeceda27cb5e206bff42a54f31b04
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:30:20 +01:00
@ -0,0 +254,4 @@
logger.debug(`Found events: ${JSON.stringify(voteEvents, null, 2)}`, { guildId, requestId })
if (!voteEvents || voteEvents.length <= 0) {
logger.error("Could not find vote event. Cancelling update!", { guildId, requestId })
Collaborator

cancelling uptade log seems wrong here

cancelling uptade log seems wrong here
Author
Owner

6d40930dc1
done

6d40930dc126ba0581ffc5a0733caef93fd4cc60 done
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:31:14 +01:00
@ -0,0 +247,4 @@
}
return votes
}
public async getEvent(guild: Guild, guildId: string, requestId: string): Promise<GuildScheduledEvent | null> {
Collaborator

rename to "getOpenVoteEvent", since other events get filtered out

rename to "getOpenVoteEvent", since other events get filtered out
Author
Owner

ca99987a20
done

ca99987a20baeceda27cb5e206bff42a54f31b04 done
Collaborator

renamed to getOpenPollEvent

renamed to getOpenPollEvent
Author
Owner

4e9fe587b0
renamed

4e9fe587b0af1b91f049b820023bd0f7e6280517 renamed
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:34:25 +01:00
@ -0,0 +259,4 @@
}
return voteEvents[0]
}
public async updateEvent(voteEvent: GuildScheduledEvent, votes: Vote[], guild: Guild, guildId: string, requestId: string) {
Collaborator

should be renamed so it's clear what the event gets updated with and what it looks like in the end and what kind of event gets updated (I guess open poll events)

should be renamed so it's clear what the event gets updated with and what it looks like in the end and what kind of event gets updated (I guess open poll events)
Author
Owner

ca99987a
done

ca99987a done
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:35:32 +01:00
@ -0,0 +271,4 @@
}
public async sendVoteClosedMessage(event: GuildScheduledEvent, movie: string, guildId: string, requestId: string): Promise<Message<boolean>> {
const date = event.scheduledStartAt ? format(event.scheduledStartAt, "dd.MM.") : "Fehler, event hatte kein Datum"
const time = event.scheduledStartAt ? format(event.scheduledStartAt, "HH:mm") : "Fehler, event hatte kein Datum"
Collaborator

"Fehler, event hatte keine Uhrzeit" pls

"Fehler, event hatte keine Uhrzeit" pls
Author
Owner

ca99987a20
done

ca99987a20baeceda27cb5e206bff42a54f31b04 done
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:36:15 +01:00
@ -0,0 +280,4 @@
const announcementChannel = this.client.getAnnouncementChannelForGuild(guildId)
logger.info("Sending vote closed message.", { guildId, requestId })
if (!announcementChannel) {
const errorMessages = "Could not find announcement channel. Please fix!"
Collaborator

why plural?

why plural?
Author
Owner

Because this was unintentional :)

ca99987a20
fixed

Because this was unintentional :) ca99987a20baeceda27cb5e206bff42a54f31b04 fixed
magnetotail marked this conversation as resolved
magnetotail reviewed 2023-11-18 13:37:11 +01:00
@ -0,0 +286,4 @@
}
return announcementChannel.send(options)
}
private extractMovieFromMessageByEmote(lastMessages: Message, emote: string): string {
Collaborator

rename parameter lastMessages to message. "last" seems to be very specific as a parameter, also false plural

rename parameter lastMessages to message. "last" seems to be very specific as a parameter, also false plural
Author
Owner

ca99987a20
done

ca99987a20baeceda27cb5e206bff42a54f31b04 done
magnetotail marked this conversation as resolved
magnetotail requested changes 2023-11-18 13:39:48 +01:00
magnetotail left a comment
Collaborator

Kp, was man hier rein schreibt, hab n paar Dinge angemerkt

Kp, was man hier rein schreibt, hab n paar Dinge angemerkt
kenobi added 1 commit 2023-11-18 16:46:40 +01:00
Merge branch 'master' into feat/40-reroll-on-disinterest
All checks were successful
Compile the repository / compile (pull_request) Successful in 15s
Run unit tests / test (pull_request) Successful in 13s
4a3e8809be
kenobi added 1 commit 2023-11-18 17:31:06 +01:00
move preparation of vote Message sending into vote controller
All checks were successful
Compile the repository / compile (pull_request) Successful in 17s
Run unit tests / test (pull_request) Successful in 13s
4600820889
event only needs to supply information, text creation, sending and pinning happens in the vote controller
kenobi added 1 commit 2023-11-18 17:41:05 +01:00
msg -> message
All checks were successful
Compile the repository / compile (pull_request) Successful in 16s
Run unit tests / test (pull_request) Successful in 13s
66507cb08f
kenobi added 3 commits 2023-11-18 18:16:29 +01:00
message -> messageText
All checks were successful
Compile the repository / compile (pull_request) Successful in 16s
Run unit tests / test (pull_request) Successful in 13s
a455fd8ff7
kenobi added 1 commit 2023-11-18 18:22:25 +01:00
comment filter function
All checks were successful
Compile the repository / compile (pull_request) Successful in 39s
Run unit tests / test (pull_request) Successful in 14s
20da25f2bf
kenobi added 1 commit 2023-11-18 18:26:50 +01:00
msg -> message
All checks were successful
Compile the repository / compile (pull_request) Successful in 21s
Run unit tests / test (pull_request) Successful in 13s
fc64728a78
kenobi added 1 commit 2023-11-19 18:23:23 +01:00
clean up variable and function names
Some checks failed
Compile the repository / compile (pull_request) Failing after 16s
Run unit tests / test (pull_request) Failing after 13s
ca99987a20
kenobi added 5 commits 2023-11-19 18:56:43 +01:00
kenobi added 2 commits 2023-11-19 20:04:34 +01:00
refactor voteInfo to include event instead of eventid and startDate
All checks were successful
Run unit tests / test (pull_request) Successful in 16s
Compile the repository / compile (pull_request) Successful in 18s
7d794a8001
kenobi added 1 commit 2023-11-19 20:11:09 +01:00
remove unnecessary if
All checks were successful
Compile the repository / compile (pull_request) Successful in 16s
Run unit tests / test (pull_request) Successful in 18s
03b6a30ffa
kenobi added 1 commit 2023-11-19 20:13:53 +01:00
rename to getOpenPollEvent
All checks were successful
Compile the repository / compile (pull_request) Successful in 17s
Run unit tests / test (pull_request) Successful in 13s
4e9fe587b0
kenobi added 1 commit 2023-11-19 20:17:56 +01:00
fix incorrect log regarding update cancellation, fixes return type of function to use Maybe
All checks were successful
Compile the repository / compile (pull_request) Successful in 17s
Run unit tests / test (pull_request) Successful in 14s
6d40930dc1
kenobi added 1 commit 2023-11-19 20:22:17 +01:00
rename emotes to validvoteemotes
All checks were successful
Run unit tests / test (pull_request) Successful in 14s
Compile the repository / compile (pull_request) Successful in 16s
fb4ab59dc6
kenobi merged commit 1bfcaa95f9 into master 2023-11-19 20:24:36 +01:00
kenobi deleted branch feat/40-reroll-on-disinterest 2023-11-19 20:24:36 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kenobi/jellyfin-discord-bot#54
No description provided.