From 73e49c03cd6ab952d137c29538c5e11d2adebef1 Mon Sep 17 00:00:00 2001 From: Nicolas Aspert Date: Tue, 6 Feb 2018 15:41:23 +0100 Subject: [PATCH] allow messages to be sent to a telegram broadcast channel --- zbxtg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zbxtg.py b/zbxtg.py index 3556d79..8797d47 100755 --- a/zbxtg.py +++ b/zbxtg.py @@ -178,11 +178,13 @@ def get_uid(self, name): chat = m["message"]["chat"] elif "edited_message" in m: chat = m["edited_message"]["chat"] + elif "channel_post" in m: + chat = m["channel_post"]["chat"] if chat["type"] == self.type == "private": if "username" in chat: if chat["username"] == name: uid = chat["id"] - if (chat["type"] == "group" or chat["type"] == "supergroup") and self.type == "group": + if (chat["type"] == "group" or chat["type"] == "supergroup" or chat["type"] == "channel") and self.type == "group": if "title" in chat: if chat["title"] == name.decode("utf-8"): uid = chat["id"]