diff --git a/src/main/java/de/strifel/VTools/listeners/TGBridge.java b/src/main/java/de/strifel/VTools/listeners/TGBridge.java index 263a9ca..98f9724 100644 --- a/src/main/java/de/strifel/VTools/listeners/TGBridge.java +++ b/src/main/java/de/strifel/VTools/listeners/TGBridge.java @@ -44,7 +44,6 @@ public class TGBridge { private TelegramBot bot; private String TOKEN = ""; - private long BOT_ID = -1; private long CHAT_ID = 0L; private int ONLINE_STATUS_MESSAGE_ID = -1; @@ -85,7 +84,6 @@ public class TGBridge { synchronized (this) { this.CHAT_ID = Long.parseLong(config.getOrDefault("chat_id", "0")); this.TOKEN = config.getOrDefault("token", ""); - this.BOT_ID = Long.parseLong(TOKEN.split(":")[0]); } } catch (Exception e) { plugin.logger.error("parsing config", e); @@ -129,7 +127,7 @@ public class TGBridge { updateOnlineStatus(); break; } - if (replyTo != null && (replyTo.from() == null || replyTo.from().id() != BOT_ID || replyTo.messageId() <= 0)) { + if (replyTo != null && (replyTo.from() == null || replyTo.messageId() <= 0)) { outbound("must reply a message that from the bot (or reply nothing)."); break; } @@ -195,10 +193,8 @@ public class TGBridge { try { GetChatResponse response = bot.execute(new GetChat(CHAT_ID)); Message pinnedMessage = response.chat().pinnedMessage(); - if (pinnedMessage.from().id() == BOT_ID) { - readOldPinnedMessage(pinnedMessage); - updateOnlineStatus(); - } + readOldPinnedMessage(pinnedMessage); + updateOnlineStatus(); } catch (RuntimeException e) { plugin.logger.error("get group info failed."); throw e;