ableev / Zabbix-in-Telegram

Zabbix Notifications with graphs in Telegram
MIT License
771 stars 235 forks source link

Can`t send message to public chat #187

Open Nicolai6120 opened 4 years ago

Nicolai6120 commented 4 years ago

I'm trying this one command to test sending from cli

zbxtg.py "@xxx" test test

where @xxx is my personal profile, and I'm receiving new message from @MyAlertingBot to my personal account (@xxx)

image

But if I am trying

zbxtg.py "@yyy" test test

where @yyy is public channel, I'm getting this error zbxtg.py: You need start a conversation with your bot first in '@yyy' group chat, type '/start@MyAlertingBot'

After sending "/start@MyAlertingBot" message in @yyy chat nothing happens.

At the same time alerting from graylog via @MyAlertingBot to @yyy works well...

I have read all the wiki pages and all the repository files, but can`t find the answer.

Reinviting @MyAlertingBot to @yyy chat has no effect _zbx_tg_tmpdir is 100% writable, becase new file was created there after first zbxtg.py script call

My config: (zbx_server_version 4)

image

Debug info: image

melkor217 commented 3 years ago

Temporary workaround as to add following string to /var/tmp/zbxtg/uids.txt :

<any_string_identifier>;group;<chat_id>

to send with zbxtg.py <any_string_identifier> test test --group

You can even send without --group flag by adding this instead

<any_string_identifier>;private;<chat_id>

Example: add -470155885;private;-470155885 and then call zbxtg.py -470155885 test test

Getting chat_id of da group is a bit tricky, i was using /chatid command of @metturika_bot to get it.

P.S. This bug seems to be somewhat easy to fix tho.