aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/TelegramBotManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/TelegramBotManager.java')
-rw-r--r--juick-api/src/main/java/com/juick/api/TelegramBotManager.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/juick-api/src/main/java/com/juick/api/TelegramBotManager.java b/juick-api/src/main/java/com/juick/api/TelegramBotManager.java
index a75804bb..c2eeefd3 100644
--- a/juick-api/src/main/java/com/juick/api/TelegramBotManager.java
+++ b/juick-api/src/main/java/com/juick/api/TelegramBotManager.java
@@ -253,9 +253,12 @@ public class TelegramBotManager implements ApplicationListener<MessageEvent> {
);
int userId = telegramService.getUser(chatId);
if (userId > 0) {
- telegramService.deleteTelegramUser(chatId.intValue());
- logger.info("deleted telegram id of @{}", userService.getUserByUID(userId)
- .orElse(new User()).getName());
+ User userToDelete = userService.getUserByUID(userId)
+ .orElse(new User());
+ boolean status = telegramService.deleteTelegramUser(chatId.intValue());
+ logger.info("deleting telegram id of @{} : {}", userToDelete.getName(), status);
+ boolean chatStatus = telegramService.deleteChat(chatId);
+ logger.info("deleting telegram chat {} : {}", chatId, chatStatus);
}
} else {
logger.warn("error response, isOk: {}, errorCode: {}, description: {}",