Open mrambossek opened 3 weeks ago
Hi,
Thanks for reporting this, I was unaware of it!
im not good with python, but as far as i can tell this comes from tlg_kick_user which in turn leads to unban_chat_member ... and now i'm lost. :)
Yes, the problem is in the "unban_chat_member()" function, that sends a "unbanChatMember" Bot API Request to kick users, and seems this request is only valid for supergroups and channels...
my group is a "normal" group, not a supergroup.. is that the issue?
Indeed you are facing this issue cause your group is a regular group and not a supergroup (perhaps due it is a private group?). By default, new Telegram groups created are standard, but once it becomes public, or it reaches 200 members, or some settings in the group are changed, them are silently and automatically upgraded into a supergroup.
Note: a regular group has limited functionality and Bots in it work poorly or do not work at all.
is there no "normal" kick API, or why is unban_chat_member used in the first place? is there a way to make it work for my group?
Afraid there is no "kick" request in the Bot API... A couple of years ago, I was using the "ban" request + "unrestrict" request to achive a "kick" behaviour, however it was replaced with the "unbanChatMember" request cause it is more safe to have a kick behaviour just with a single request, and also avoiding some weird issues that could happen if network is not working properly and 1 of this 2 requests is missing.
One possible fix for this is to improve the "tlg_kick_user()" function to apply the approach of "ban + unrestrict requests" if the "unban_chat_member()" fails due "Method is available for supergroup and channel chats only".
However, I have not test this Bot in regular groups from few years ago, so even if we manage to make the kick feature to work, there is no guaranteed that all other features will work properly.
To solve your issue, perhaps you could try to convert that regular group into a supergroup. For that, try the following:
With this setting change the group should become a supergroup and the Bot will work properly.
Regards ;)
heya, trying out the bot, after fiddling for some time to get it running in a docker container, everything seems to work at first glance; however, when a test user joins and does not fill out the captcha, the console prints:
(i have replaced the actual values with for privacy reasons)
im not good with python, but as far as i can tell this comes from tlg_kick_user which in turn leads to unban_chat_member ... and now i'm lost. :)
my group is a "normal" group, not a supergroup.. is that the issue? is there no "normal" kick API, or why is unban_chat_member used in the first place? is there a way to make it work for my group?
thanks & kr