示例#1
0
 public async Task CleanAsync(
     [Summary("The number of messages to delete.")]
     int count)
 => await ModerationService.DeleteMessagesAsync(
     Context.Channel as ITextChannel, count, true,
     () => Context.GetUserConfirmationAsync(
         $"You are attempting to delete the past {count} messages in #{Context.Channel.Name}.{Environment.NewLine}"));
示例#2
0
 public async Task CleanAsync(
     [Summary("The number of messages to delete.")]
     int count,
     [Summary("The user whose messages should be deleted.")]
     IGuildUser user)
 => await ModerationService.DeleteMessagesAsync(
     Context.Channel as ITextChannel, user, count,
     () => Context.GetUserConfirmationAsync(
         $"You are attempting to delete the past {count} messages by {user.GetFullUsername()} in #{Context.Channel.Name}.{Environment.NewLine}"));
示例#3
0
 public async Task CleanAsync(
     [Summary("The number of messages to delete.")]
     int count,
     [Summary("The channel to clean.")]
     ITextChannel channel)
 => await ModerationService.DeleteMessagesAsync(
     channel, count, Context.Channel.Id == channel.Id,
     () => Context.GetUserConfirmationAsync(
         $"You are attempting to delete the past {count} messages in {channel.Mention}.{Environment.NewLine}"));