Skip to content
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

Suggestion: Telegram Channel ID Documentation #223

Closed
J0n4t4n opened this issue Feb 2, 2022 · 7 comments
Closed

Suggestion: Telegram Channel ID Documentation #223

J0n4t4n opened this issue Feb 2, 2022 · 7 comments

Comments

@J0n4t4n
Copy link

J0n4t4n commented Feb 2, 2022

I was setting up Watchtower with the shoutrrr notification type to send notifications to a Telegram channel.

I created a Telegram Bot, a Telegram Channel and made the Bot a Channel Administrator.
I was then struggling to figure out how to find the Channel ID, I tried #120, but the part after t.me/ didn't work.
After a lot of searching I found these instructions: https://gist.github.com/mraaroncruz/e76d19f7d61d59419002db54030ebe35?permalink_comment_id=3611823#gistcomment-3611823

I think the Telegram documentation should include instructions on how to figure out a channel ID, maybe using the "Json Dump Bot" method.
So:

  • Create a Channel
  • Manually post a message
  • Forward that message to "Json Dump Bot"
  • message.forward_from_chat.id will contain the Channel ID
@piksel
Copy link
Member

piksel commented Feb 2, 2022

Yeah, the channel "name" can be used if you prefix it, but that seems to be missing from the docs. There is also a generator that helps with configuring telegram, which isn't mentioned either.

@davtur19
Copy link

davtur19 commented Feb 3, 2022

Alternatively you could also use your chat ID/user ID (message.from.id on @jsondumpbot) instead of the channel ID; I find it more convenient to have messages sent in private chat with the bot than a channel.
Remember to start the bot, otherwise it will be impossible for the bot to send you messages.

@J0n4t4n
Copy link
Author

J0n4t4n commented Feb 3, 2022

Yeah, the channel "name" can be used if you prefix it, but that seems to be missing from the docs. There is also a generator that helps with configuring telegram, which isn't mentioned either.

Ah, interesting. Yeah some documentation improvements seem to be needed.

Alternatively you could also use your chat ID/user ID (message.from.id on @jsondumpbot) instead of the channel ID; I find it more convenient to have messages sent in private chat with the bot than a channel.

Remember to start the bot, otherwise it will be impossible for the bot to send you messages.

Yeah, for me I wanted it to be a channel specifically, but that's of course also an option.

@azoller1
Copy link

azoller1 commented Apr 5, 2022

Omg yes. I literally could not understand how to use telegram. @jsondumpbot helped me finally get it to work. Thanks.

@piksel
Copy link
Member

piksel commented Apr 6, 2022

Yeah, I did update the docs, but I have not made a release yet so it's still under dev:
https://containrrr.dev/shoutrrr/dev/services/telegram/#identifying_the_target_chatschannels

I will make a new release as soon as I get time. Sorry.

@piksel
Copy link
Member

piksel commented May 25, 2022

Ineed, to get the ID for any type of chat, you can just forward a message from that chat to @jsondumpbot and in it's reply find this part:

    "forward_from_chat": {
      "id": -1002737640605,

The Chat ID would then be -1002737640605.

I will add this information as well to the docs.

@piksel
Copy link
Member

piksel commented May 29, 2022

Docs were updated in #250 along with the deployment of a specialized bot for this purpose.

Since neither @JsonDumpBot, nor @UserInfoBot could help getting the Chat ID for group chats, I wrote a bot specifically for this purpose. It can be reached at @shoutrrrbot. Updated the docs to point to it instead.

Originally posted by @piksel in #250 (comment)

@piksel piksel closed this as completed May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants