WIP: feat/20-reactions-for-roles #59

Draft
kenobi wants to merge 16 commits from feat/20-reactions-for-roles into master
Owner

solves #20

  • Änderungen einmalig beim Startup prüfen
  • Scheduled Task entfernen
  • MessageReactionAdd Event implementieren für Rolle hinzufügen
  • MessageReactionRemove implementieren für Rolle entfernen
solves #20 - [ ] Änderungen einmalig beim Startup prüfen - [ ] Scheduled Task entfernen - [x] MessageReactionAdd Event implementieren für Rolle hinzufügen - [x] MessageReactionRemove implementieren für Rolle entfernen
kenobi added 4 commits 2023-11-20 00:18:02 +01:00
add messageReactionRemove
All checks were successful
Compile the repository / compile (pull_request) Successful in 21s
Run unit tests / test (pull_request) Successful in 1m33s
016bb243cc
kenobi changed title from feat/20-reactions-for-roles to WIP: feat/20-reactions-for-roles 2023-11-20 00:18:45 +01:00
kenobi added the
enhancement
label 2023-11-20 00:18:53 +01:00
kenobi added this to the 2.0 milestone 2023-11-20 00:18:56 +01:00
kenobi self-assigned this 2023-11-20 00:19:05 +01:00
kenobi requested review from magnetotail 2023-11-20 00:19:08 +01:00
kenobi added 1 commit 2023-11-20 00:27:26 +01:00
implement very basic functionality of role add/rm
Some checks failed
Compile the repository / compile (pull_request) Failing after 16s
Run unit tests / test (pull_request) Successful in 14s
8f320cee5c
kenobi added 1 commit 2023-11-20 00:31:20 +01:00
fix incorrect method call
All checks were successful
Compile the repository / compile (pull_request) Successful in 17s
Run unit tests / test (pull_request) Successful in 13s
6d0eaed426
kenobi added 2 commits 2023-11-21 22:42:03 +01:00
move manage announce roles to role controller
All checks were successful
Run unit tests / test (pull_request) Successful in 16s
Compile the repository / compile (pull_request) Successful in 17s
f83f54749d
kenobi added 1 commit 2023-11-21 22:42:52 +01:00
rename announcement role assign function
All checks were successful
Compile the repository / compile (pull_request) Successful in 16s
Run unit tests / test (pull_request) Successful in 15s
88061c361c
kenobi added 1 commit 2023-11-21 23:33:29 +01:00
add function to fetch announcement role id
All checks were successful
Compile the repository / compile (pull_request) Successful in 16s
Run unit tests / test (pull_request) Successful in 14s
417b24d408
intended flow: use id fetch function to get role for current guild, use role id to fetch role from discord role cache,
use role in intended use case
currently the role id is hardcoded, needs to be read from some sort of cache which persists the ids in config file
needs to be differentiated by guild id and role type
could be the target of a user configurable frontend in the future
kenobi added 1 commit 2023-11-22 19:51:39 +01:00
remove unused client
Some checks failed
Compile the repository / compile (pull_request) Failing after 18s
Run unit tests / test (pull_request) Successful in 16s
1ae8278fb8
kenobi added 1 commit 2023-11-22 19:56:24 +01:00
fix incorrect parameter passing
All checks were successful
Compile the repository / compile (pull_request) Successful in 16s
Run unit tests / test (pull_request) Successful in 15s
d1aacbb3d3
magnetotail reviewed 2023-11-24 15:47:36 +01:00
@ -0,0 +41,4 @@
.catch(error => { logger.error(`Could not find announcement_role with id ${config.bot.announcement_role}. Error: ${error}`, { requestId, guildId: guild.id }) })
}
public async assignAnnouncementRolesFromReactions(guild: Guild, reaction: MessageReaction, requestId: string) {
Collaborator

method called reactions but parameter is singular

method called reactions but parameter is singular
Author
Owner
1f372b0aacd94d6eb5cfbe2e72f61dfdf77c1a31
magnetotail reviewed 2023-11-24 15:48:15 +01:00
@ -0,0 +47,4 @@
const announcementRole = await this.getAnnouncementRoleForGuild(guild, requestId)
if (!announcementRole)
throw new Error(`No announcementRole found in guild ${guildId}`)
Collaborator

add error to previous line to be consistent with rest of class. Also maybe put checking to getAnnouncementRoleForGuild, so calling methods can rely on the role to be there?

add error to previous line to be consistent with rest of class. Also maybe put checking to getAnnouncementRoleForGuild, so calling methods can rely on the role to be there?
Author
Owner
a50ac1716f5eccf38d88763742d26e573b460dca
magnetotail reviewed 2023-11-24 15:53:42 +01:00
@ -2,3 +2,3 @@
import { GuildScheduledEvent, Role, TextChannel } from "discord.js"
export type Maybe<T> = T | undefined | null
export type Maybe<T> = T | undefined | null | void
Collaborator

ew, a THIRD "not there" type??? wth

ew, a THIRD "not there" type??? wth
Author
Owner

a60fc2db7e
No longer necessary after refactoring of announcementrole fetching
a50ac1716f

a60fc2db7e8736a0899d07f0bc797ba84da1e861 No longer necessary after refactoring of announcementrole fetching a50ac1716f5eccf38d88763742d26e573b460dca
magnetotail requested changes 2023-11-24 15:55:49 +01:00
magnetotail left a comment
Collaborator

Nice work only minor comments from me so far. Great to have a controller for roles now

Nice work only minor comments from me so far. Great to have a controller for roles now
kenobi added 2 commits 2023-11-25 19:51:57 +01:00
fix interface name and import
All checks were successful
Compile the repository / compile (pull_request) Successful in 19s
Run unit tests / test (pull_request) Successful in 18s
ef39c6315d
kenobi added 1 commit 2023-11-25 20:05:55 +01:00
make return value for role non optional, instead throws on error
All checks were successful
Compile the repository / compile (pull_request) Successful in 22s
Run unit tests / test (pull_request) Successful in 19s
a50ac1716f
kenobi added 1 commit 2023-11-25 20:35:25 +01:00
remove unnecessary maybe type union
All checks were successful
Compile the repository / compile (pull_request) Successful in 17s
Run unit tests / test (pull_request) Successful in 15s
a60fc2db7e
All checks were successful
Compile the repository / compile (pull_request) Successful in 17s
Run unit tests / test (pull_request) Successful in 15s
This pull request is marked as a work in progress.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/20-reactions-for-roles:feat/20-reactions-for-roles
git checkout feat/20-reactions-for-roles
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#59
No description provided.