1
0
Fork 1
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:
Octol1ttle 2023-08-04 01:34:01 +05:00 committed by GitHub
parent c9a7fb79ab
commit d023033ed4
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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