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
37
votes
11 answers

Telegram Bot "chat not found"

I have the following code in Python to send a message to myself from a bot. import requests token = '123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI' method = 'sendMessage' myuserid = 1949275XX response = requests.post( …
Bijan
  • 7,737
  • 18
  • 89
  • 149
35
votes
3 answers

How to create a link to contact specific phone number via Telegram?

So I found out I could use a link like this in HTML: WhatsApp in order to let a user contact {{phone_number}} directly from a webpage (via WhatsApp web). My question…
Joan Sagué Flo
  • 361
  • 1
  • 3
  • 6
35
votes
5 answers

How to make a private Telegram bot accessible only by its owner?

I'm developing a Telegram bot, which should be accessible only by its owner (only the owner would be able to add it to groups or see it in the search). Is it possible to achieve this via Telegram services (like BotFather) or should I check in my…
user6587056
35
votes
10 answers

Telegram does not escape some markdown characters

Telegram does not escape some markdown characters, for example: This works fine _test\_test_ But this return parse error *test\*test* What I do wrong?
user3449979
  • 439
  • 1
  • 5
  • 7
33
votes
10 answers

How do I send Tables with Telegram Bot API?

I need to send stock market data and the formatting sucks right now. Need to send something liike this | Symbol | Price | Change | |--------|-------|--------| | ABC | 20.85 | 1.626 | | DEF | 78.95 | 0.099 | | GHI | 23.45 | 0.192 | | JKL | 98.85…
Aditya
  • 677
  • 2
  • 9
  • 15
33
votes
1 answer

Can a Telegram bot read messages of channel

Can a telegram bot read/access a telegram channel that neither I or the bot is administrator of? I know that up to last November it was not possible, but I have heard some people have done this, but so far I am not able to do it. I would really…
Nima
  • 969
  • 3
  • 10
  • 14
33
votes
8 answers

Telegram Bot How to delete or remove a message or media from a channel or group

I want to know an example of removing message or file like a photo I did not find any functional tutorial in this regard,
Ebrahim
  • 1,740
  • 2
  • 25
  • 31
32
votes
1 answer

Allow bot to access Telegram Group messages

One step further than How to add a bot to a Telegram Group? -- How to add a bot to a Telegram Group as admin? I've added my bot to my Telegram Group, but see that it has no access to messages I heard the bot need to be admin to access to…
xpt
  • 20,363
  • 37
  • 127
  • 216
31
votes
6 answers

Telegram Bot gets "Bad Request: message text is empty"

When my Telegram bot sends sendMessage to Telegram server it gets the error message: {"ok":false,"error_code":400,"description":"Bad Request: message text is empty"} The problem appeared this morning, before that my bot worked a whole year without…
Kryvich
  • 421
  • 1
  • 4
  • 7
31
votes
10 answers

Got problems with webhook to Telegram Bot API

Why is my webhook not working? I do not get any data from telegram bot API. Here is the detailed explanation of my problem: I got SSL cert from StartSSL, it works fine on my website (according to GeoCerts SSL checker), but still seems like my…
markelov
  • 311
  • 1
  • 3
  • 4
30
votes
6 answers

my.telegram.org sends an ERROR when I want to create an API id/hash in API development tools section

I'm trying to get my API id/hash to create some bots for telegram , but in the API developmen tools section , when I enter my bot informations( name , shortname...) and click on create to get the results , I recieve an error : my.telegram.org says…
aboss
  • 520
  • 1
  • 4
  • 14
30
votes
2 answers

Telegram Bot. Get User timezone

When developing bot for Telegram is there any way to get user timezone? Date field in Message object contains UNIX timestamp only. I want to create bot sending some messages an fixed time of day to subscribed user. User can have different time zones…
nnesterov
  • 1,232
  • 1
  • 10
  • 27
29
votes
7 answers

How To Limit Access To A Telegram Bot

When I send a message to my Telegram Bot, it responses with no problems. I wanna limit the access such that me and only me can send message to it. How can I do that?
E.B
  • 517
  • 1
  • 9
  • 17
28
votes
6 answers

How to get Telegram channel users list with Telegram Bot API

Anybody give a starter on how may I get information about users from my telegram bot. Imagine my bot in an admin user in my channel and I want to get my channel user list or to be noticed when a new user joins. How can I do that. Telegram's…
M.Shahrokhi
  • 385
  • 1
  • 7
  • 19
27
votes
3 answers

How to set Telegram bot webhook?

I'm developing a Telegram bot, and I want to set the webhook to my domain's URL. I've already generated a self-signed certificate following the Telegram's guide. However, I'm not able to set the webhook. I've searched previous answers and found this…
Ignasi93
  • 533
  • 2
  • 5
  • 14