From dc1cb825541d26822c4ab9c116fade05a7a63ac9 Mon Sep 17 00:00:00 2001 From: takumi091111 Date: Wed, 11 Oct 2017 02:02:06 +0900 Subject: [PATCH] Fix max amount of 'del' command --- lib/commands/message.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/commands/message.rb b/lib/commands/message.rb index e1cee93..94271a7 100644 --- a/lib/commands/message.rb +++ b/lib/commands/message.rb @@ -14,8 +14,9 @@ module Bot end # メッセージ削除 - command(:del, usage: 'del <件数>', description: 'メッセージの削除', min_args: 1, max_args: 99) do |event, n| - event.channel.prune(n.to_i + 1, true) + command(:del, usage: 'del <件数>', description: 'メッセージの削除', min_args: 1) do |event, n| + next if (n.to_i > 99) + event.channel.prune(n.to_i + 1, false) nil end end