-
Hi there, I want to create a function that filters incoming messages so that only users and groups registered are allowed to interact with this bot. The idea is to register users by sending a command in a registered group. I use the message.chat.is_group() method to evaluate this, but I must either be doing somehting wrong or not understanding how this works because I get that groups are not groups. This is the function (I also upload a txt with the function since I'm having issues getting the whole thing wrapped in a code block):
}` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @MvCast I think you tried this function with a supergroup not a group, the deference between supergroup and a group is that supergroup have a link (public for all telegram users) and the group is a private. try to check of it's a supergroup also. - if msg.chat.is_group() {
+ if msg.chat.is_group() || msg.chat.is_supergroup() { suggestion: Add a check for channels also, or if you want to handle it as a group you can check if the chat not a private chat (DM) then handle it as a group, supergroup and a channel. |
Beta Was this translation helpful? Give feedback.
Hi @MvCast I think you tried this function with a supergroup not a group, the deference between supergroup and a group is that supergroup have a link (public for all telegram users) and the group is a private. try to check of it's a supergroup also.
suggestion: Add a check for channels also, or if you want to handle it as a group you can check if the chat not a private chat (DM) then handle it as a group, supergroup and a channel.