Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding instructions for disabling bot's privacy #4

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

slawiko
Copy link
Contributor

@slawiko slawiko commented Dec 7, 2023

Privacy has to be disabled, otherwise bot will not have access to group messages

@slawiko slawiko requested a review from umputun as a code owner December 7, 2023 22:45
@umputun
Copy link
Owner

umputun commented Dec 8, 2023

Is it about private groups only? The current setup seems to work just fine without need to disabling privacy mode

image

@umputun
Copy link
Owner

umputun commented Dec 8, 2023

I don't think it is needed. In order to ban users the bot has to be not just a member but even an admin.

When you create a new Telegram bot from @BotFather, the newly created bot is in privacy mode by default. A bot running in privacy mode will not receive all messages that people send to the group. Instead, it will only receive:

  • Messages that start with a slash ‘/’
  • Replies to the bot's own messages
  • Service messages (such as member join and left notifications)
  • Messages from channels where it's a member

@slawiko
Copy link
Contributor Author

slawiko commented Dec 8, 2023

BotFather says

'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username.
'Disable' - your bot will receive all messages that people send to groups.

In my group bot has admin access, but does not have access to messages if privacy mode is enabled. My group was created for channel's discussions. Group used to be private back in the day though, but now it is public.

Anyway, I tried to replicate basic setup:
created public group and added both bots in it. Gave them both admin permissions:
Screenshot 2023-12-08 at 14 49 43

Mine has disabled privacy, yours has enabled:
Screenshot 2023-12-08 at 14 48 00

but the fact it is working fine in radio-t chat confuses me, tbh. Would be nice to solve that mystery

@umputun
Copy link
Owner

umputun commented Dec 8, 2023

The only situation I was able to reproduce this effect was the private group. Here bot won't be able to read all the messages without privacy change, but I don't think such groups really need the bot.

Maybe you should rephrase the PR and add an explanation about this? like "in some cases, for example for private groups, the bot needs privacy options to access all the messages ... ".

@slawiko
Copy link
Contributor Author

slawiko commented Dec 9, 2023

Absolutely makes sense: 2a23248

@slawiko slawiko reopened this Dec 9, 2023
@umputun umputun merged commit eb18aee into umputun:master Dec 12, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants