discord: option to add/remove role on enable/disable/deletion

in Settings > Discord, shown when a role is selected in "Apply Role".
The discord housekeeping daemon should pick up users deleted outide of
jfa-go too, so users who delete their own accounts should have their
roles removed (periodically).
This commit is contained in:
Harvey Tindall
2024-08-04 15:37:01 +01:00
parent 44311162a6
commit ffd46ff190
5 changed files with 42 additions and 3 deletions
+2
View File
@@ -36,6 +36,8 @@ func (app *appContext) clearDiscord() {
// Make sure the user doesn't exist, and no other error has occured
switch err.(type) {
case mediabrowser.ErrUserNotFound:
// Remove role in case their account was deleted oustide of jfa-go
app.discord.RemoveRole(discordUser.MethodID().(string))
app.storage.DeleteDiscordKey(discordUser.JellyfinID)
default:
continue