public async Task UnbanAsync( [Summary("The user ID to unban.")] GuildUserProxy user) { await Context.Guild.RemoveBanAsync(user.ID); Moderation.ClearTemporaryInfraction(TemporaryInfractionType.TempBan, user.ID); await ModerationLog.CreateEntry(ModerationLogEntry.New .WithDefaultsFromContext(Context) .WithActionType(ModerationActionType.Unban) .WithTarget(user.ID), Context.Channel); }
public async Task UnmuteAsync( [Summary("The user to unmute.")] SocketGuildUser user) { await user.UnmuteAsync(Context); SetUserMuted(user.Id, false); Moderation.ClearTemporaryInfraction(TemporaryInfractionType.TempMute, user); await ModerationLog.CreateEntry(ModerationLogEntry.New .WithDefaultsFromContext(Context) .WithActionType(ModerationActionType.Unmute) .WithTarget(user), Context.Channel); }
public async Task UnmuteAsync( [Summary("The user to unmute.")] GuildUserProxy user) { if (!user.HasValue) { throw new ArgumentException($"User with ID {user.ID} is not in the server!"); } await user.GuildUser.UnmuteAsync(Context); SetUserMuted(user.ID, false); Moderation.ClearTemporaryInfraction(TemporaryInfractionType.TempMute, user.GuildUser); await ModerationLog.CreateEntry(ModerationLogEntry.New .WithDefaultsFromContext(Context) .WithActionType(ModerationActionType.Unmute) .WithTarget(user), Context.Channel); }