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

Add chat topic options for messages #71

Open
Sparkxxx opened this issue Sep 19, 2024 · 3 comments
Open

Add chat topic options for messages #71

Sparkxxx opened this issue Sep 19, 2024 · 3 comments

Comments

@Sparkxxx
Copy link

Hello,
I looked on the issues and could not find the option to set the parameters for sending a message to a chat that has topic enabled.

I've digged into findiing things and I came out with the following schema:

To obtain the ID of the first message in the topic, in the Telegram desktop client, right-click on the first message in the topic, select “Copy Message Link.”
You will receive a link similar to this: https://t.me/c/xxxxxxxxxx/1/1
General: https://t.me/c/xxxxxxxxxx/1/1 (the default topic)
Topic_A: https://t.me/c/xxxxxxxxxx/2/1
Topic_B: https://t.me/c/xxxxxxxxxx/3/1

https://t.me/c/STREAM_ID/TOPIC_ID/message_id
STREAM_ID: xxxxxxxxxx (don't know the name of it, let's call it stream_id)
CHANNEL_ID: -100STREAM_ID - concatenate '-100' in front of stream_id -> -100xxxxxxxxxx
chat_id: -100CHANNEL_ID_STREAM_ID
chat_id: -100xxxxxxxxxx_xxxxxxxxxx
message_thread_id as I understand it is the TOPIC_ID: 1 (General), 2 (Topic_A), 3 (Topic_B)

I've tested and it works as intended with the following curls:

## Set the TELEGRAM_BOT_TOKEN as env variable
export TELEGRAM_BOT_TOKEN=BOT_ID:ACCESS_TOKEN

## Debug directly with the bot with:
curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates

## Send message to untopiced chat (in case of topic chats it goes to General (1))
curl -X POST -H 'Content-Type: application/json' \
-d '{"message_thread_id": "TOPIC_ID", "chat_id": "-100xxxxxxxxxx_xxxxxxxxxx", "text": "Test message "}' \
https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage

Excuse me if I got the namings wrong and reinvented the wheel, would this be possible to implement?
Thank you.

@muety
Copy link
Owner

muety commented Sep 19, 2024

Hi @Sparkxxx, I'm not exactly sure what you're trying to achieve. You want Telepush to send message into some topic within a group chat?

@Sparkxxx
Copy link
Author

Yes, that would be my intention please.

@muety
Copy link
Owner

muety commented Sep 20, 2024

I see! That's quite a specific and niche feature, though. I don't think we'll be implementing this any time soon. Will keep the issue open anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants