mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Merge branch 'master' into sound-to-loaded
This commit is contained in:
commit
fb5c701808
2 changed files with 8 additions and 1 deletions
|
@ -35,7 +35,7 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
public ToolsCommandGroup(
|
public ToolsCommandGroup(
|
||||||
ICommandContext context, IFeedbackService feedback,
|
ICommandContext context, IFeedbackService feedback,
|
||||||
GuildDataService guildData, IDiscordRestGuildAPI guildApi,
|
GuildDataService guildData, IDiscordRestGuildAPI guildApi,
|
||||||
IDiscordRestUserAPI userApi, IDiscordRestChannelAPI channelApi)
|
IDiscordRestUserAPI userApi)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_guildData = guildData;
|
_guildData = guildData;
|
||||||
|
|
|
@ -151,6 +151,13 @@ public sealed partial class MemberUpdateService : BackgroundService
|
||||||
return Result.FromSuccess();
|
return Result.FromSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var existingBanResult = await _guildApi.GetGuildBanAsync(guildId, id, ct);
|
||||||
|
if (!existingBanResult.IsDefined())
|
||||||
|
{
|
||||||
|
data.BannedUntil = null;
|
||||||
|
return Result.FromSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
var unbanResult = await _guildApi.RemoveGuildBanAsync(
|
var unbanResult = await _guildApi.RemoveGuildBanAsync(
|
||||||
guildId, id, Messages.PunishmentExpired.EncodeHeader(), ct);
|
guildId, id, Messages.PunishmentExpired.EncodeHeader(), ct);
|
||||||
if (unbanResult.IsSuccess)
|
if (unbanResult.IsSuccess)
|
||||||
|
|
Loading…
Add table
Reference in a new issue