Exemplo n.º 1
0
 public Task Warn(
     [Summary("The user to which the warning is being issued.")]
     IGuildUser subject,
     [Summary("The reason for the warning.")]
     [Remainder]
     string reason)
 => ModerationService.CreateInfractionAsync(InfractionType.Warning, subject.Id, reason, null);
Exemplo n.º 2
0
 public Task Note(
     [Summary("The user to which the note is being applied.")]
     IGuildUser subject,
     [Summary("The reason for the note.")]
     [Remainder]
     string reason)
 => ModerationService.CreateInfractionAsync(InfractionType.Notice, subject.Id, reason, null);
Exemplo n.º 3
0
 public Task Mute(
     [Summary("The user to be muted.")]
     IGuildUser subject,
     [Summary("The reason for the mute.")]
     [Remainder]
     string reason)
 => ModerationService.CreateInfractionAsync(InfractionType.Mute, subject.Id, reason, null);
Exemplo n.º 4
0
        public async Task Forceban(
            [Summary("The id of the user to be banned.")]
            ulong subjectId,
            [Summary("The reason for the ban.")]
            [Remainder]
            string reason)
        {
            await ModerationService.CreateInfractionAsync(InfractionType.Ban, subjectId, reason, null);

            await Context.AddConfirmation();
        }
Exemplo n.º 5
0
        public async Task Ban(
            [Summary("The user to be banned.")]
            IGuildUser subject,
            [Summary("The reason for the ban.")]
            [Remainder]
            string reason)
        {
            var result = await ModerationService.CreateInfractionAsync(InfractionType.Ban, subject.Id, reason, null);

            await AddConfirmationOrHandleAsync(result);
        }
Exemplo n.º 6
0
        public async Task Note(
            [Summary("The user to which the note is being applied.")]
            DiscordUserEntity subject,
            [Summary("The reason for the note.")]
            [Remainder]
            string reason)
        {
            await ModerationService.CreateInfractionAsync(InfractionType.Notice, subject.Id, reason, null);

            await Context.AddConfirmation();
        }
Exemplo n.º 7
0
        public async Task Warn(
            [Summary("The user to which the warning is being issued.")]
            IGuildUser subject,
            [Summary("The reason for the warning.")]
            [Remainder]
            string reason)
        {
            var result = await ModerationService.CreateInfractionAsync(InfractionType.Warning, subject.Id, reason, null);

            await AddConfirmationOrHandleAsync(result);
        }
Exemplo n.º 8
0
        public async Task BanAsync(
            [Summary("The user to be banned.")]
            DiscordUserEntity subject,
            [Summary("The reason for the ban.")]
            [Remainder]
            string reason)
        {
            await ModerationService.CreateInfractionAsync(Context.Guild.Id, Context.User.Id, InfractionType.Ban, subject.Id, reason, null);

            await Context.AddConfirmation();
        }
Exemplo n.º 9
0
        public async Task WarnAsync(
            [Summary("The user to which the warning is being issued.")]
            DiscordUserEntity subject,
            [Summary("The reason for the warning.")]
            [Remainder]
            string reason)
        {
            await ModerationService.CreateInfractionAsync(Context.Guild.Id, Context.User.Id, InfractionType.Warning, subject.Id, reason, null);

            await Context.AddConfirmation();
        }
Exemplo n.º 10
0
        public async Task Mute(
            [Summary("The user to be muted.")]
            DiscordUserEntity subject,
            [Summary("The reason for the mute.")]
            [Remainder]
            string reason)
        {
            await ModerationService.CreateInfractionAsync(InfractionType.Mute, subject.Id, reason, null);

            await Context.AddConfirmation();
        }
Exemplo n.º 11
0
        public async Task MuteAsync(
            [Summary("The user to be muted.")]
            DiscordUserEntity subject,
            [Summary("The reason for the mute.")]
            [Remainder]
            string reason)
        {
            var reasonWithUrls = AppendUrlsFromMessage(reason);

            await ModerationService.CreateInfractionAsync(Context.Guild.Id, Context.User.Id, InfractionType.Mute, subject.Id, reasonWithUrls, null);

            await ConfirmAndReplyWithCountsAsync(subject.Id);
        }
Exemplo n.º 12
0
        public async Task WarnAsync(
            [Summary("The user to which the warning is being issued.")]
            DiscordUserOrMessageAuthorEntity subject,
            [Summary("The reason for the warning.")]
            [Remainder]
            string reason)
        {
            var reasonWithUrls = AppendUrlsFromMessage(reason);

            await ModerationService.CreateInfractionAsync(Context.Guild.Id, Context.User.Id, InfractionType.Warning, subject.UserId, reasonWithUrls, null);

            await ConfirmAndReplyWithCountsAsync(subject.UserId);
        }
Exemplo n.º 13
0
        public async Task TempMuteAsync(
            [Summary("The user to be muted.")]
            DiscordUserEntity subject,
            [Summary("The duration of the mute.")]
            TimeSpan duration,
            [Summary("The reason for the mute.")]
            [Remainder]
            string reason)
        {
            await ModerationService.CreateInfractionAsync(Context.Guild.Id, Context.User.Id, InfractionType.Mute, subject.Id, reason, duration);

            await Context.AddConfirmation();
        }
Exemplo n.º 14
0
        public async Task TempMute(
            [Summary("The user to be muted.")]
            IGuildUser subject,
            [Summary("The duration of the mute.")]
            TimeSpan duration,
            [Summary("The reason for the mute.")]
            [Remainder]
            string reason)
        {
            var result = await ModerationService.CreateInfractionAsync(InfractionType.Mute, subject.Id, reason, duration);

            await AddConfirmationOrHandleAsync(result);
        }
Exemplo n.º 15
0
        public async Task NoteAsync(
            [Summary("The user to which the note is being applied.")]
            DiscordUserOrMessageAuthorEntity subject,
            [Summary("The reason for the note.")]
            [Remainder]
            string reason)
        {
            if (!await GetConfirmationIfRequiredAsync(subject))
            {
                return;
            }

            var reasonWithUrls = AppendUrlsFromMessage(reason);

            await ModerationService.CreateInfractionAsync(Context.Guild.Id, Context.User.Id, InfractionType.Notice, subject.UserId, reasonWithUrls, null);

            await ConfirmAndReplyWithCountsAsync(subject.UserId);
        }
Exemplo n.º 16
0
        public Task TempMute(
            [Summary("The user to be muted.")]
            IGuildUser subject,
            [Summary("The duration of the mute.")]
            string durationString,
            [Summary("The reason for the mute.")]
            [Remainder]
            string reason)
        {
            // TODO: Remove when we port to 2.0
            var duration = TimeSpanTypeReader.Read(durationString);

            if (!duration.HasValue)
            {
                throw new ArgumentException("Invalid Timespan Format");
            }

            return(ModerationService.CreateInfractionAsync(InfractionType.Mute, subject.Id, reason, duration.Value));
        }
Exemplo n.º 17
0
        public async Task TempMuteAsync(
            [Summary("The duration of the mute.")]
            TimeSpan duration,
            [Summary("The user to be muted.")]
            DiscordUserOrMessageAuthorEntity subject,
            [Summary("The reason for the mute.")]
            [Remainder]
            string reason)
        {
            if (!await GetConfirmationIfRequiredAsync(subject))
            {
                return;
            }

            var reasonWithUrls = AppendUrlsFromMessage(reason);

            await ModerationService.CreateInfractionAsync(Context.Guild.Id, Context.User.Id, InfractionType.Mute, subject.UserId, reasonWithUrls, duration);

            await ConfirmAndReplyWithCountsAsync(subject.UserId);
        }