How to view a telegram account by chat id? - telegram

I'm wondering if there is any possibility to view or message a non-contact person who has no username, with his/her chat id?
I only got a chat id.

You can use sendMessage method and pass chat_id as chat_id you have it and then send message to that user.
https://api.telegram.org/bot<YOUR_API_TOKEN>/sendMessage?chat_id=<chat id you have>&text=Hello world

If your bot have received messages from that user, you can use inline mention, and your user account can view his profile/PM him.
But unfortunately, bot account can't initiate chat for now :(

I do not know exactly what programming language you use but I think you can use some Telegram client library like Telethon
Telethon is Telegram client implementation in Python 3 which uses the latest available API of Telegram
If you use PHP, use MadelineProto instead.

Related

Send message to Telegram contact or list of contacts using API

I have a Telegram account and Now I wants to import list of contacts into my Account using Telegram API.
Is This possible to send Message to my imported contacts using Telegram API, just like normal user can send message to other user in his contacts list?
I tried Telegram bots but Telegram bot can't send message to other users, unless they started any chat with Bot. So this is not that useful.
You can act as a normal user by using the Telegram MTProto API. There are many libraries that interact with that, like Python telethon or PHP MadelineProto.

Telegram API Client receive message

I have problems with telegram's api in c#. I search any solutions how to recevie message from Telegram using API. I found only library for Telegram BOT(send message etc.), but I need only recevie message from one user. There is option "Get.Message" in Telegram Api, but I can't find simply library to use this option.
using the telegram client api you can get updates automatically from telegram when a message is received. You simply need to handle the response once the session is created and a connection is made
Just in case you don't want realtime updates, you can use messages.GetHistory and supply the number of messages you'd like to retrieve. You need to provide the chat ID and access hash which you can get from contactsResolveUsername
enter link description here

How can I get registered users in a Telegram Bot using the API

I'm writing a bot for telegram. I'm wondering what if I loose the user_id and the corresponding chat_id of registered users of my bot.
Is there anyway to ask telegram bot, which users or chats are joined to the bot? I didn't find any clue in the API
You need to log yourself, I asked #BotSupport same question too, seems Telegram won't make this API.

telegram bot api - get all messages in a group

I'm working on Telegram bot api in my java application. I have created a super group and add my bot to this as an administrator. I want to get all messages in that super group(not deleted messages) via bot. Is there any useful method for doing that?
Yes. first, you should "disable" privacy of your bot so it can access to all messages in groups. second, use getUpdates to see recent updates and user messages will be there.

Telegram Bot and Custom client

I would like know if I can use Bot (taken from the Telegram Bot store) in a custom telegram client
I think so but I didn't found documentation about it.
Yes, of course, you can use any bot from any client that support Telegram protocol.

Resources