From 26e9c593570e8ad1f085e94db99397c0708388ae Mon Sep 17 00:00:00 2001 From: John Devenish Date: Mon, 10 Dec 2018 16:35:50 +0200 Subject: [PATCH] Renamed UseItemHandler2 to UseItemHandler --- .../telegram/bots/SecretFightClubBotAPIBuilder.java | 2 +- .../handlers/fightclub/SubmitItemSelectionHandler.java | 2 +- .../fightclub/{UseItemHandler2.java => UseItemHandler.java} | 4 ++-- .../telegram/handlers/fightclub/UseItemSelectionHandler.java | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) rename web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/{UseItemHandler2.java => UseItemHandler.java} (94%) diff --git a/web/src/main/java/za/co/knonchalant/telegram/bots/SecretFightClubBotAPIBuilder.java b/web/src/main/java/za/co/knonchalant/telegram/bots/SecretFightClubBotAPIBuilder.java index 3e7ffd8..f5ccf45 100644 --- a/web/src/main/java/za/co/knonchalant/telegram/bots/SecretFightClubBotAPIBuilder.java +++ b/web/src/main/java/za/co/knonchalant/telegram/bots/SecretFightClubBotAPIBuilder.java @@ -31,7 +31,7 @@ public Bots buildFightClubBot() { addHandler(new RegisterHandler(botName, botAPI)); addHandler(new RollHandler(botName, botAPI)); - addHandler(new UseItemHandler2(botName, botAPI)); + addHandler(new UseItemHandler(botName, botAPI)); addHandler(new RankingsHandler(botName, botAPI)); addHandler(new OptionsHandler(botName, botAPI)); addHandler(new AbuseHandler(botName, botAPI)); diff --git a/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/SubmitItemSelectionHandler.java b/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/SubmitItemSelectionHandler.java index 8136326..d490374 100644 --- a/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/SubmitItemSelectionHandler.java +++ b/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/SubmitItemSelectionHandler.java @@ -44,7 +44,7 @@ private Item determineItemToUse(IUpdate update, FighterDAO fighterDAO) { List carried = fighterDAO.getAllUncarriedItemsFrom(update.getChatId()); for (Item item : carried) { - String thisItemDescription = UseItemHandler2.makeItemButtonText(item); + String thisItemDescription = UseItemHandler.makeItemButtonText(item); if (thisItemDescription.trim().equals(desiredItemDescription)) { return item; } diff --git a/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemHandler2.java b/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemHandler.java similarity index 94% rename from web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemHandler2.java rename to web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemHandler.java index f35f2f2..f63b36e 100644 --- a/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemHandler2.java +++ b/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemHandler.java @@ -21,9 +21,9 @@ /** * Created by evan on 2016/04/08. */ -public class UseItemHandler2 extends ActiveFighterMessageHandler implements IResponseMessageHandler { +public class UseItemHandler extends ActiveFighterMessageHandler implements IResponseMessageHandler { - public UseItemHandler2(String botName, IBotAPI bot) { + public UseItemHandler(String botName, IBotAPI bot) { super(botName, "use", bot, true); } diff --git a/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemSelectionHandler.java b/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemSelectionHandler.java index f7e96d0..50a1030 100644 --- a/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemSelectionHandler.java +++ b/web/src/main/java/za/co/knonchalant/telegram/handlers/fightclub/UseItemSelectionHandler.java @@ -1,7 +1,5 @@ package za.co.knonchalant.telegram.handlers.fightclub; -import com.pengrad.telegrambot.model.request.InlineKeyboardButton; -import com.pengrad.telegrambot.model.request.InlineKeyboardMarkup; import com.pengrad.telegrambot.model.request.ParseMode; import com.pengrad.telegrambot.model.request.ReplyKeyboardMarkup; import za.co.knonchalant.candogram.domain.PendingResponse; @@ -73,7 +71,7 @@ protected Item determineItemToUse(IUpdate update, FighterDAO fighterDAO, Fighter List carried = fighterDAO.getItemsCarriedBy(fighter.getId()); for (Item item : carried) { - String thisItemDescription = UseItemHandler2.makeItemButtonText(item); + String thisItemDescription = UseItemHandler.makeItemButtonText(item); if (thisItemDescription.trim().equals(desiredItemDescription)) { return item; }