From cffe1519f5e6d87978a0200f7e287d0dc9d391e1 Mon Sep 17 00:00:00 2001 From: Ruben Bermudez Date: Wed, 13 Jul 2016 20:17:55 +0200 Subject: [PATCH] Revert "Message filter for TelegramLongPollingCommandBot" --- .../bots/TelegramLongPollingCommandBot.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/java/org/telegram/telegrambots/bots/TelegramLongPollingCommandBot.java b/src/main/java/org/telegram/telegrambots/bots/TelegramLongPollingCommandBot.java index d9c81d35..f9f8091f 100644 --- a/src/main/java/org/telegram/telegrambots/bots/TelegramLongPollingCommandBot.java +++ b/src/main/java/org/telegram/telegrambots/bots/TelegramLongPollingCommandBot.java @@ -32,7 +32,7 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB public final void onUpdateReceived(Update update) { if (update.hasMessage()) { Message message = update.getMessage(); - if ((message.isCommand()) && (filter(message))) { + if (message.isCommand()) { if (commandRegistry.executeCommand(this, message)) { return; } @@ -41,19 +41,6 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB processNonCommandUpdate(update); } - /** - * function message filter. - * Override this function in your bot implementation to filter messages with commands - * - * For example, if you want to prevent commands execution incoming from group chat: - * # - * # return !message.getChat().isGroupChat(); - * # - */ - protected boolean filter(Message message) { - return true; - } - @Override public final boolean register(BotCommand botCommand) { return commandRegistry.register(botCommand);