Telegram chat ID changed - telegram

I had a few group chats in Telegram with the same Telegram bot. I had an initial chat ID which was automatically changed these days to the new ID. Can anyone explain why? Thanks!

It only happens when a group is changed to a supergroup. Telegram sends an update informing you about this change, you should handle it.
Take a look "migrate_to_chat_id" field here.
https://core.telegram.org/bots/api/#message

Related

Telegram - how to create bot which create referral link to channel for every one user?

If I need to create invite link to bot, I type %reflink% like in this video.
But what may I to do if I want to create bot which create different referral link sto group for every one user?
Thank you for reply.

How do i send a message in telegram to someone from whom i only have a chat ID?

I only have a chat id number from someone and i have no other information, i have not been in contact with him in Telegram before.
How can i send a message to him only with the chat ID or get his username only with the chat ID.
I know the following link, where there is chat ID, takes me to the chat page with the person.
tg://openmessage?user_id="Chat ID Number"
But this link works when i have already contacted the person in question, or an in a group, or have spoken, or have her number.
What is it like when i have no information about the person in question and only have a chat ID?
Thanks for your reply.
It's not possible. You should as you said have encountered them in your dialogs or contacts or any mutual group.
There aren't any known methods to bypass this restriction.

catching event of deleting a groupe-chat in telegram bot api

I'm rellay happy with that community here. I found many answers in different cases. But this time I don't find one. So maybe someone can help me?
I'm working on a telegram bot using php and webhook updates. I track if my bot is added in a group chat by "new_chat_member" or "group_chat_created" and by "left_chat_member" if it got deleted from that groupe. UNtil then everything works fine.
If I - as admin - and the bot are the last two members and I delete the chat in the telegram app, I just get a "left_chat_member" for me (the last user in the groupe). But what about the bot? Isn't the chat deletet completely? Is the groupe remaining just with the bot as a member? Got someone an idea how to catch that situation? I would need something like "chat_deleted"
Thanks a lot,
Markus
I found a possible solution:
https://core.telegram.org/bots/api#getchatmemberscount
Always on "left_chat_member" event, I check how many members are left. And if there is just two left I delete the chat of my "tracking" list. Still don't know if the bot is registered to that groub-chat on the telegram side, but don't really have another idea.

Can I extract and automatically message users on a TG group?

I’m part of a telegram group. I can see other users on the group, and I can message them individually (and manually). Is it possible to automatically (programmatically) message all the users on the group individually? Note I am not the admin.
If it is indeed possible, is there any sample code you can share?
It would be particularly awesome if the message could be customized for admin and non-admin. This means I’d need to detect if a particular user is an admin.
Thanks
I'm not sure if I get what you are looking for but I assume you have a Telegram Bot and wanna message all users in an specific group/supergroup. First I have to remind you bot can't start private message according to this link
Bots can't initiate conversations with users. A user must either add them to a group or send them a message first.
If I got it wrong feel free leave comment and I will update the answer ASAP ;-) ^_^

adding members to a telegram channel by their ID

I have a channel in telegram, and i want to add my customers to it.
I only have their Telegram IDs.
How can i do this?
Is there any way to do so?
any help would be appreciated.
Typically a User chooses to subscribe to your channel, you cannot "ADD" someone to a channel.
But you may add users to groups.

Resources