Sergey
June 29, 2021, 6:27am
1
Hi,
I can`t configure Telegram Webhook.
My steps:
Create Bot via botfather, got botID on email
Got chat ID via special bots.
Go to http://localhost:3000/admin/hooks create Telegram WebHook:
Set up bot token:
123456:XXXXXX
Chat ID:
-123456
Events:
All Events
4. Test: Created Task, Edited task - no messages
Also recent Deliveries are empty
But working via this response in browser.
https://api.telegram.org/bot123456:XXXXXXXXXXXXXXX/sendMessage?chat_id=-123456&text=test
Thanks.
Sergey.
lunny
July 1, 2021, 3:33pm
2
Please report on github if it’s a bug.
I am using Telegram with Gitea without any problems.
Try removing the minus sign ‘-’ from your chat_id in the webhook.
I got my chat id from ‘Telegram Bot Raw’
Hm, checked with and without ‘-’. Nothing.
Which gitea version are you using?
Should task updates be in chat?
Have you installed additional packages for work with tihs feature?
My workflow:
Created TG chat
User1 created task
User2 commented task
Telegram chat should recieve a new update.
I am using 1.14.3 on FreeBSD 12.2
When I set up my Telegram notification it was on ‘All Events’. It was too noisy for me so now I have it on custom events with only a few events of interest.
The only weird thing I have noticed is that I get two identical messages one after the other on push events.
Telegram must be able to see the URL. If the URL is localhost then telegram will drop the webhook.
Sergey
July 22, 2021, 6:20am
8
Thanks, but should be gitea visible from internet?
I thought it work so:
I do some actions
Gitea makes request via curl (for example)
#curl -X POST
-H ‘Content-Type: application/json’
-d ‘{“chat_id”: “123456789”, “text”: “This is a test from curl”, “disable_notification”: false}’
https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage
Why Telegram should be able to see my server? I did it successfully from bash from my server which located over NAT.
The links included in the message (eg. localhost) need to be seen by telegram, and since localhost is a special host, they can’t fetch it.
Your test message didn’t have any special URL like that.