-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[QUESTION] How to send a message to all the connected users #1836
Comments
There is no way, to get all the users via a API method. However, if you're using persistence since lauching your bot, |
Thanx, great! Any caveat about the number of messages per time unit? And is there a way to trigger those messages from an external script? |
Regarding flood limits, please have a look at our wiki. What do you mean my "trigger those messages from an external script"? |
Thanx for the pointer to the wiki. Regarding the trigger, I was wondering if there is a good design pattern to trigger the messages from an external script that runs outside of the bot. |
Oh okay. Well, the simples solution would be to add a handler to your bot such that every time you send a message, say "/forward my text", a message "my text" will be send to all users. If you don't want to interrupt your script, you could create a second updater, that uses the same persistence files as the actual one. Just make sure, not to call
Having set up the second updater, you can access the ids via
|
Oh wow, great hint. I'll start from this : ) Thanks once again! |
Happy to help. I'll close the issue. |
Is there a way to send a message to all the users that are using a bot, possibly, triggered by an external script?
The text was updated successfully, but these errors were encountered: