aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/TelegramBotManager.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/juick/TelegramBotManager.java b/src/main/java/com/juick/TelegramBotManager.java
index 3ca0f217d..9dfea1a3d 100644
--- a/src/main/java/com/juick/TelegramBotManager.java
+++ b/src/main/java/com/juick/TelegramBotManager.java
@@ -369,6 +369,19 @@ public class TelegramBotManager implements NotificationListener {
boolean status = telegramService.deleteTelegramUser(user.getUid());
logger.info("deleting telegram id of @{} : {}", user.getName(), status);
}
+ } else if (response.errorCode() == 400) {
+ if (response.description().equals("Bad Request: chat not found")) {
+ if (user.isAnonymous()) {
+ boolean status = telegramService.deleteAnonymous(chatId);
+ logger.info("deleting chat id {}: {}", chatId, status);
+ } else {
+ boolean status = telegramService.deleteTelegramUser(user.getUid());
+ logger.info("deleting telegram id of @{} : {}", user.getName(), status);
+ }
+ } else {
+ logger.warn("error response, isOk: {}, errorCode: {}, description: {}",
+ response.isOk(), response.errorCode(), response.description());
+ }
} else {
logger.warn("error response, isOk: {}, errorCode: {}, description: {}",
response.isOk(), response.errorCode(), response.description());