Fix telegram chats#7689
Conversation
- Negative `chat_id`s for groups. - Include `chat_id` in event data. - Handle KeyError when receiving other types of messages, as `new_chat_member` ones, and send them as text.
| else: | ||
| event_data[ATTR_TEXT] = data[ATTR_TEXT] | ||
| # Some other thing... | ||
| _LOGGER.warning('SOME OTHER THING RECEIVED --> "%s"', data) |
There was a problem hiding this comment.
Clarify to something like:
_LOGGER.warning("Message without text data received: %s", data)Note the use of quotes. That's home assistant standard now.
- fix if condition for msg bad fields. - return True for a correct but not allowed or not recognized message: if not, the message arrives continuously. - Allow to receive messages from unauthorized users if they come from authorized groups.
- They come as normal messages, except for the 'edited_message' field instead of 'message'.
|
Is this related #7696 ? |
|
@arsaboo, not exactly, #7696 is because the changes of 0.45 imply that we now have to define a |
|
@azogue @MartinHjelmare Somehow the |
* bugfix for Telegram chat_ids - Negative `chat_id`s for groups. - Include `chat_id` in event data. - Handle KeyError when receiving other types of messages, as `new_chat_member` ones, and send them as text. * unused import * fix double quote style, fix boolean expr, change warning msg * mistake * some more fixes - fix if condition for msg bad fields. - return True for a correct but not allowed or not recognized message: if not, the message arrives continuously. - Allow to receive messages from unauthorized users if they come from authorized groups. * support for `edited_message`s - They come as normal messages, except for the 'edited_message' field instead of 'message'.
|
Hi! it seems to be broken again. negative chat_id calls this: |
|
Hi @michaelarz, have you included the |
|
Hi @azogue, thank you, that was exatly what I forgot to do. Sorry, my fault. |
Description:
Related issue (if applicable): fixes #7694
Fix negative
chat_ids used in Telegram groups:chat_ids for groups.chat_idin event data.new_chat_memberones, and send them as text.I know this is like a duplicate of #7688, but this has more changes to allow receiving messages from a group, not only sending them.
It's tested and intended to be included in 0.45.1