TelegramBots icon indicating copy to clipboard operation
TelegramBots copied to clipboard

Cannot access information about new users joining or leaving supergroups.

Open PigPinv opened this issue 10 months ago • 4 comments

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?

PigPinv avatar Mar 28 '24 18:03 PigPinv

<dependency>
    <groupId>org.telegram</groupId>
    <artifactId>telegrambots</artifactId>
    <version>6.9.7.1</version>
</dependency>

PigPinv avatar Mar 28 '24 19:03 PigPinv

Does not take effect: botOptions.setAllowedUpdates(Arrays.asList("chat_member"));

PigPinv avatar Mar 28 '24 19:03 PigPinv

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?

aNNiMON avatar Mar 29 '24 09:03 aNNiMON

@PigPinv in such a group with hidden list, do you see join/leave notifications as a normal user?

rubenlagus avatar Apr 01 '24 00:04 rubenlagus

已经解决:update.hasChatMember()

PigPinv avatar May 11 '24 09:05 PigPinv