I create a group in Telegram. I don't care whether it is a private group or a public group. When I send messages to the group and then listen through webhook, the "type" is always "supergroup".
@Override public BotApiMethod<?> onWebhookUpdateReceived(Update update) { if (update.hasMessage() && update.getMessage().hasText()) { String messageText = update.getMessage().getText(); Long chatId = update.getMessage().getChatId(); if (update.getMessage().getChat().isGroupChat()) { String response = "group message: " + messageText; sendMessageToGroup(chatId, response); } } return null; }
I create a group in Telegram. I don't care whether it is a private group or a public group. When I send messages to the group and then listen through webhook, the "type" is always "supergroup".
@Override public BotApiMethod<?> onWebhookUpdateReceived(Update update) { if (update.hasMessage() && update.getMessage().hasText()) { String messageText = update.getMessage().getText(); Long chatId = update.getMessage().getChatId(); if (update.getMessage().getChat().isGroupChat()) { String response = "group message: " + messageText; sendMessageToGroup(chatId, response); } } return null; }
I'm using: