Questions tagged [telegram]

Telegram is a cross-platform cloud-based instant messenger with a focus on security. Use this tag for questions about interacting with Telegram, including use of its official API.

Main features

Messaging

It was the main feature of Telegram. It allows you to send messages to users who have the contacts and we know the nickname.

Groups

The groups are conversations between more than two users, I can reach up to 200 users. Each member of a group can add users, change the name of the group or avatar. Exceeded 200 members, the group becomes a "Supergroup". The supergroup can get to 100,000 users.

Channels

The channels are groups that do not have a limit of users . The peculiarity is that only administrators can write to the channel.

Bots

Telegram Bots are programmed accounts without a phone number. they can not initiate a conversation with a real user. The bot API provides methods to interact with users including sending and editing messages, custom keyboards, commands. (API Documentation)

5905 questions
22
votes
1 answer

Telegram inline keyboard and keyboard

I have question about Telegram bot. I want keyboard and inline keyboard, Can I enable both of the features at the same time ?
Morteza Jalambadani
  • 2,190
  • 6
  • 21
  • 35
22
votes
4 answers

How to get user_id of a phone number in telegram

Im creating a bot to send message to multiple contact in Telegram. user can share contact with bot. then i use getUpdates and obtain the phone number. For using the sendMessage Method i need the chat_id. now how to get chat_id of a user with his…
defectivepixel
  • 575
  • 1
  • 4
  • 22
21
votes
0 answers

How to log out / change account of telegram after logging in with the Login Widget

I started using the Telegram Widget API, and it works great, but I couldn't find any info on how to logout an user afterwards. This might be useful if the user decides he wants to use a different telegram account. Once you click the login button you…
21
votes
1 answer

Telegram: Is it possible to have different names in different groups/channles?

Is it possible to use the same user, but configure a different display name for different groups/channles?
oyed
  • 739
  • 2
  • 7
  • 18
21
votes
2 answers

Telegram API: How do I get messages from a public channel, which I am not participant of?

I am able to successfully retrieve messages from a channel via channels.getMessages request, once I know their message IDs. I find channel id by contacts.search, by the way. At the moment, mesage IDs are consequtive integers, so getting max_id would…
Samat
  • 511
  • 1
  • 6
  • 15
21
votes
5 answers

How can I download the chat history of a group in Telegram?

I would like to download the chat history (all messages) that were posted in a public group on Telegram. How can I do this with python? I've found this method in the API https://core.telegram.org/method/messages.getHistory which I think looks like…
siamii
  • 23,374
  • 28
  • 93
  • 143
21
votes
3 answers

In python-telegram-bot how to get all participants of the group?

In Python-telegram-bot how to get, if possible, the complete list of all participants of the group at which the bot was added?
Thomas8
  • 1,117
  • 1
  • 11
  • 22
21
votes
2 answers

Telegram, getting file_id for existing sticker

I'm writing a Telegram bot and I want it to send a sticker. It is said here, that to send a sticker that already exists on Telegram servers we can simply pass file_id. The thing is, I have absolutely no idea how to obtain file_id of any sticker.…
Egor Ignatenkov
  • 1,242
  • 2
  • 12
  • 29
20
votes
3 answers

Obtain a good, BIG/LARGE image in rich link preview in Telegram

I saw a lot or request about rich link preview in Telegram, but this is specifically about "how to get a BIG/LARGE image" in the preview. Let's take this article on my site as example. It already has all of the OGs:
20
votes
1 answer

supply a filename for a file-like object created by urlopen() or requests.get()

I am building a Telegram bot using a Telepot library. To send a picture downloaded from Internet I have to use sendPhoto method, which accepts a file-like object. Looking through the docs I found this advice: If the file-like object is obtained by…
kurtgn
  • 8,140
  • 13
  • 55
  • 91
20
votes
4 answers

How to join my Telegram Bot to PUBLIC channel

My question is: how to join my telegram bot to a telegram public channel that I am not an administrator of it, and without asking the channel's admin to add my bot to the channel? Maybe, the chatId of channel or thru link of channel? I have heard…
Nima
  • 969
  • 3
  • 10
  • 14
20
votes
5 answers

Find out my own user ID for sending a message with Telegram API

For Telegram, how can I find out my own user id (chat_id) for use with the Telegram API? I want to send myself a message via the Telegram API, like this: https://api.telegram.org/bot/sendMessage
row248
  • 391
  • 2
  • 3
  • 12
19
votes
3 answers

Telegram authorization without default button

The only documented way to use Telegram 3-rd party authorization is to use their script that is being provided at https://core.telegram.org/widgets/login This script (as I digged) works in pretty strange way It renders "Log in with Telegram" button…
Limbo
  • 2,123
  • 21
  • 41
19
votes
3 answers

How to receive my own telegram messages in node.js without bot

I would like to have a very simple client in nodejs (an example) that can receive messages from my contacts in telegram. I just searched in internet but I only get bot samples. I want to receive group messages in what I don't have access to give…
19
votes
3 answers

Telegram Bot API error when try to edit message: "Bad Request: message not found"

I've tried to edit bot's message which was sended about 2 hours ago and got this error and supposed that this message so old for editing that it is unable. Then I've tried to edit another message which was sended a little later and it was…
anatol
  • 1,680
  • 2
  • 24
  • 47