Questions tagged [telegram-bot]

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram which is an instant-messaging app with documented API. Use this tag if you're writing a telegram bot and have a specific question regarding the Bot API.

Available methods

  • getMe
  • sendMessage
  • forwardMessage
  • sendPhoto
  • sendAudio
  • sendDocument
  • sendSticker
  • sendVideo
  • sendVideoNote
  • sendVoice
  • sendLocation
  • sendVenue
  • sendContact
  • sendChatAction
  • getUserProfilePhotos
  • getUpdates
  • setWebhook
  • removeWebhook
  • getFile

Links:

4905 questions
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
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
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
2 answers

Telegram bot - OAuth authorization

I want to implement OAuth authorization by Twitch API on my bot, and when I was looking for a better solution, I found this @GitHubBot. In this bot redirect URL starting for integrations.telegram.org/github, and I wonder how to implement auth like…
Max Max
  • 389
  • 1
  • 2
  • 12
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
20
votes
3 answers

Telegram Bot custom keyboard in PHP

I'm trying to make a Telegram Bot in PHP with a custom keyboard. The message is delivered, but the custom keyboard won't work. $keyb = array('keyboard' => array(array("A", "B"))); also no succes. The sendMessage method referrers to…
Martin
  • 203
  • 1
  • 2
  • 6
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

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
18
votes
3 answers

How to send telegram mediaGroup with caption/text

I'm currently using python-telegram-bot and basically what I want to achieve with it is to send telegram messages like this: So the message consists of 2+ photos/videos with text message underneath. What I've already tried: sending message with…
marzique
  • 635
  • 1
  • 7
  • 17
18
votes
4 answers

Sending message in telegram bot with images

I have telegram-bot code on php, and reply messages sending by replyWithMessage method. All command here: $this->replyWithMessage(['text' => $item['title']. "\n\n" . $url]); How can i add some preview image before text?
SergioZhidkov
  • 371
  • 1
  • 3
  • 13
17
votes
5 answers

Change telegram bot owner

We have created telegram bot which has many difficult operations. Bot was created by one developer using his phone number. Is it possible change bot's owner or add another user as admin to bot?
Mansur Anorboev
  • 580
  • 1
  • 7
  • 17
17
votes
4 answers

how convert ogg file to telegram voice format?

I'm trying to send a voice message through SendVoice method in telegram bot, but it sends the voice as a document file (not play). ogg file by ffmpeg converted to opus…
M P
  • 173
  • 1
  • 1
  • 9
17
votes
8 answers

New Telegram bot return almost empty JSON to API

I want to create a Telegram bot, so I followed the instructions and got: Done! Congratulations on your new bot. You will find it at t.me/RonGuruBot. You can now add a description, about section and profile picture for your bot, see /help for a…
boardrider
  • 5,882
  • 7
  • 49
  • 86