mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 00:19:00 +03:00
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 <l1ttleofficial@outlook.com>
This commit is contained in:
parent
c9a7fb79ab
commit
d023033ed4
1 changed files with 6 additions and 5 deletions
|
@ -38,11 +38,6 @@ public class GuildMemberJoinedResponder : IResponder<IGuildMemberAdd>
|
|||
|
||||
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<IGuildMemberAdd>
|
|||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue