TelegramBots
TelegramBots copied to clipboard
Cannot access information about new users joining or leaving supergroups.
I have specified AllowedUpdates in DefaultBotOptions as requested. For example:
DefaultBotOptions options = new DefaultBotOptions();
options.setAllowedUpdates(List.of(AllowedUpdates.CHATMEMBER, AllowedUpdates.MESSAGE,
AllowedUpdates.EDITEDMESSAGE, AllowedUpdates.CALLBACKQUERY, AllowedUpdates.MYCHATMEMBER, AllowedUpdates.CHATJOINREQUEST));
MyAmazingBot bot = new MyAmazingBot(options, config.getToken(), config.getName());
TelegramBotsApi botsApi = new TelegramBotsApi(DefaultBotSession.class);
botsApi.registerBot(bot);
And the bot has been set as an administrator. However, as soon as the group activates the option to hide the member list, the bot cannot receive updates or messages when new members join the group. Could you please tell me whether this is a bug in Java?
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.9.7.1</version>
</dependency>
Does not take effect: botOptions.setAllowedUpdates(Arrays.asList("chat_member"));
Most probably it's an API limitation. Could you try to request getUpdates in browser/curl and check if this information is available in the response?
@PigPinv in such a group with hidden list, do you see join/leave notifications as a normal user?
已经解决:update.hasChatMember()