Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }