mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-10 07:53:15 +03:00
Don't send leave message if user was kicked/banned
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
f9a6ff2fa8
commit
ae7ba55b99
2 changed files with 12 additions and 1 deletions
|
@ -35,6 +35,17 @@ public class GuildMemberLeftResponder : IResponder<IGuildMemberRemove>
|
|||
var data = await _guildData.GetData(gatewayEvent.GuildID, ct);
|
||||
var cfg = data.Settings;
|
||||
|
||||
var memberData = data.GetOrCreateMemberData(user.ID);
|
||||
if (memberData.BannedUntil is not null)
|
||||
{
|
||||
return Result.FromSuccess();
|
||||
}
|
||||
|
||||
if (memberData.Kicked)
|
||||
{
|
||||
return Result.FromSuccess();
|
||||
}
|
||||
|
||||
if (GuildSettings.PublicFeedbackChannel.Get(cfg).Empty()
|
||||
|| GuildSettings.LeaveMessage.Get(cfg) is "off" or "disable" or "disabled")
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue