-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Clarified requirements for allowed_chat_ids parameter #3068
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
Conversation
I'm not 100% sure on this but my tests seem to back it up. Unless I list both the chat id and my user id in the allowed_chat_ids parameter then I receive a "Incoming message is not allowed" message in the HA log.
@dullage, thanks for your PR! By analyzing the history of the files in this pull request, we identified @sander76, @cyberplant and @azogue to be potential reviewers. |
@azogue can you have a look and confirm this? π |
Perfect, I passed by a few minutes ago and saw that it was clearly improveable, but laziness is very bad ... |
To get your `chat_id` and `api_key` follow the instructions [here](/components/notify.telegram) . | ||
To get your `chat_id` and `api_key` follow the instructions [here](/components/notify.telegram). | ||
|
||
*Note: If you have added your bot to a group. In the allowed_chat_ids list you will need to include the id for the chat as well as the user. Both of these ids are visible using the getUpdates methods described in the link above.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"If you have added your bot to a group, in the..."
I think if you set the |
I've checked it, when you add your bot to a new chat group, it will raise an error in the Home Assistant logs like that: 2017-07-30 17:08:53 ERROR (MainThread) [homeassistant.components.telegram_bot] Because the incoming message is logged, you can get the group |
Hi @dullage,
When targeting groups, you need to include both the group id (the negative number) and all the participants ids, because for listening the messages sent by them, all ids need to be allowed previously. If a new user tries to send a message, HA will raise another error with all needed data to get the new id, so no need to leave HA. |
@azogue Trying to follow the conversation. Rewrite this and merge or close since it's close enough? |
Hi All, My main goal with the PR was to clarify that we need to add user ids as well as chat ids if we are using a group. Azogues findings on being able to use the HA log to obtain these ids is very useful and I've added another commit which hopefully addresses this. |
@Landrash, looks good to me! |
I'm not 100% sure on this but my tests seem to back it up. Unless I list both the chat id and my user id in the allowed_chat_ids parameter then I receive a "Incoming message is not allowed" message in the HA log.
Description: Clarified requirements for allowed_chat_ids parameter