Esempio 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);
Esempio 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);
Esempio 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);
Esempio 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();
        }
Esempio 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);
        }
Esempio 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();
        }
Esempio 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);
        }
Esempio 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();
        }
Esempio 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();
        }
Esempio 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();
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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();
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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));
        }
Esempio 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);
        }