From d023033ed47ed2bbb9880e213ac6abad22553f2f Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Fri, 4 Aug 2023 01:34:01 +0500 Subject: [PATCH] Fix roles not returning on rejoin if welcome messages were disabled (#78) This PR fixes an issue where, if the `PublicFeedbackChannel` wasn't set or the welcome message was disabled, `GuildMemberJoinedResponder` would `return` early, causing roles to not be granted back if `ReturnRolesOnRejoin` was enabled, by moving the `if return` after the code that grants back roles Signed-off-by: Octol1ttle --- src/Responders/GuildMemberJoinedResponder.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Responders/GuildMemberJoinedResponder.cs b/src/Responders/GuildMemberJoinedResponder.cs index bb60b0b..b2069bf 100644 --- a/src/Responders/GuildMemberJoinedResponder.cs +++ b/src/Responders/GuildMemberJoinedResponder.cs @@ -38,11 +38,6 @@ public class GuildMemberJoinedResponder : IResponder var data = await _guildData.GetData(gatewayEvent.GuildID, ct); var cfg = data.Settings; - if (GuildSettings.PublicFeedbackChannel.Get(cfg).Empty() - || GuildSettings.WelcomeMessage.Get(cfg) is "off" or "disable" or "disabled") - { - return Result.FromSuccess(); - } if (GuildSettings.ReturnRolesOnRejoin.Get(cfg)) { @@ -55,6 +50,12 @@ public class GuildMemberJoinedResponder : IResponder } } + if (GuildSettings.PublicFeedbackChannel.Get(cfg).Empty() + || GuildSettings.WelcomeMessage.Get(cfg) is "off" or "disable" or "disabled") + { + return Result.FromSuccess(); + } + Messages.Culture = GuildSettings.Language.Get(cfg); var welcomeMessage = GuildSettings.WelcomeMessage.Get(cfg) is "default" or "reset" ? Messages.DefaultWelcomeMessage