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
27
votes
7 answers

How to send photo on telegram bot

i'm just implementing a simple bot who should send some photos and videos to my chat_id. Well, i'm using python, this is the script import sys import time import random import datetime import telepot def handle(msg): chat_id =…
rollotommasi
  • 461
  • 1
  • 6
  • 11
26
votes
10 answers

Telegram bot weird error : Bad Request: wrong file identifier/HTTP URL specified

I am sending message to telegram channel using bot. With using webhook method. I'm sending file_id via the link. I got the file_id from a channel post. For some files like GIF & video format (MP4), when i use this code: $url =…
Farzad
  • 842
  • 2
  • 9
  • 26
26
votes
6 answers

How do I have my Bot respond with arguments?

So I've built a Telegram bot, which can receive the following commands: /list /info 123 This works great, as I can catch /info and pass the additional arguments as ints. But, sadly, the Telegram clients don't see /info 123 as a complete command,…
Mave
  • 2,413
  • 3
  • 28
  • 54
26
votes
5 answers

Telegram bot api: Error code 429, Error: Too many requests: retry later

We have a Telegram bot. It has around 1.2 million subscribers. Now we're facing a problem in sending messages to these number of subscribers. Telegram bot API does not provide any batch message functionality and we'd have to send individual requests…
Pooya Saberian
  • 971
  • 2
  • 9
  • 16
25
votes
3 answers

SyntaxError: missing ) after argument list, When using async

Why am I getting this error When I use async? My Code: bot.onText(/\/start/, async msg => { const opts = { parse_mode: 'Markdown' , reply_markup: JSON.stringify({ keyboard: StartKeyboard, resize_keyboard: true, …
Saeed Heidarizarei
  • 8,406
  • 21
  • 60
  • 103
25
votes
3 answers

Automate posting messages to a Telegram channel via API

I am new to the Telegram API. I would like to automate posting messages to my public telegram channel. I read a few posts that with bots I can achieve this, but I am not sure if that's the best way and whether the API has an option to directly…
apadana
  • 13,456
  • 15
  • 82
  • 98
24
votes
1 answer

How can I send a message to someone with telegram API using my own account

It's awesome how google something can be annoying when you can't find the right words. I found a million answers on how about to create a Telegram Bot to send and receive messages, and it's easy as write maybe five code lines. But how about managing…
Leonardo Rick
  • 680
  • 1
  • 7
  • 14
24
votes
6 answers

Error 404 while accessing api method on telegram bot

I just created a bot of telegram to finish a task for the school regarding the integration of ifttt and telegram. My problem is that trying a browser to use a method of Telegram api it returned to me the following string: {"ok": false, "error_code":…
Francesco Rossetti
  • 343
  • 1
  • 2
  • 6
24
votes
2 answers

How to send request to Telegram bot API?

After creating a telegram bot and gain bot token, I want to send a request to the bot API. This link says we must send the HTTP request like this: https://api.telegram.org/bot/METHOD_NAME and brings example for easiest method "getme" which…
Ali Crash
  • 458
  • 2
  • 5
  • 15
23
votes
4 answers

Telegram bot Can't find end of the entity starting at (truncated...)

I've made a telegram bot which logs critical errors in our telegram chat. This bot has been used in another symfony application (4.4), and worked fine. But now I'm trying to use it in a Symfony 3.4 project and upon generating an error, telegram…
Regentix
  • 352
  • 1
  • 2
  • 11
23
votes
3 answers

Telegram bot message read callback

Is it possible to get callbacks in the webhook whenever a user reads the message sent by the bot, using Telegram bot API? It is not documented, and I cannot figure out a way how to achieve it.
user7518s
  • 452
  • 1
  • 7
  • 16
23
votes
7 answers

How to send an Embedded Image along with text in a Message via Telegram Bot API

Using Telegram Bot API, I'm aware that it is possible to send an image via https://core.telegram.org/bots/api#sendphoto However, how can I embed a remote image into a formatted message? The message I am looking to send, can be compared to a news…
Pierre-Antoine
  • 7,939
  • 6
  • 28
  • 36
23
votes
3 answers

Can I get a phone number by user id via Telegram Bot API?

I am using Telegram Bot API for sending instant messages to users. I have installed nuget package. This package is recommend by telegram developers. I have created a telegram bot and successfully got access to it by using code. When I send messsage…
isxaker
  • 8,446
  • 12
  • 60
  • 87
23
votes
2 answers

Telegram Bots: secret chats possible?

Telegram offers "secret chats". Is it possible that a bot opens a secret chat and sends a message? I could not find any method or parameter for this function.
Martin Weissenboeck
  • 683
  • 3
  • 8
  • 22
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