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
15
votes
4 answers

Use Telegram client for bot testing (not bot api)

I am building a Telegram Bot now and are testing it manually with a Telegram Client. Is there a way I can send client messages in the same way I can build bots? I know that I could build unit-tests in the code, that is not what I am looking for.
Punnerud
  • 7,195
  • 2
  • 54
  • 44
14
votes
4 answers

Run a custom npm script with PM2

I am currently developing several Telegram bots but I want to keep all of them in the same git repository. The issue is that on the other hand, I want to run them as separate processes. Since I'm using the Telegraf framework, to run a bot it goes…
Javier García Manzano
  • 1,024
  • 2
  • 12
  • 25
14
votes
3 answers

What is the limit of sending messages from a telegram bot

I would like to understand the limits that Telegram bot API is imposing on message sending. I know that currantly you cannot send more than 30 messages to differant users. I have many bots running on the same server (Webhooks & Pull Updates), does…
Zaid Al-Omari
  • 711
  • 1
  • 8
  • 17
14
votes
2 answers

Where should I upload my telegram bot's code to run?

I know I create new bot, give it name, description from BotFather inside telegram But this only adds the bot, when I modify my bot, code some functionality in python\lua\php etc - where should the code go and how telegram will know the behavior of…
ERJAN
  • 23,696
  • 23
  • 72
  • 146
14
votes
7 answers

How telegram bot can get file_id of uploaded file?

In telegram API documentation I see: "You can either pass a file_id as String to resend a photo that is already on the Telegram servers", but I can't find ways to get file_id of uploaded file. How can I get it?
Arsenii Sigiller
  • 141
  • 1
  • 1
  • 4
14
votes
4 answers

how to use setwebhook in telegram?

Hello I'm creating a bot in telegram. I send a http request: https://api.telegram.org/bot(mytoken)/setWebhook?url=https://mywebpagetorespondtobot and I receive this: {"ok":true,"result":true,"description":"Webhook was set"} but It doesn't work.I…
amir mola
  • 355
  • 1
  • 4
  • 17
14
votes
4 answers

Telegram BotApi, Send message to multiple chat_id

I was wondering if I could send a message with my bot on telegram bot api, to multiple chat_id, but I cant figure it out. that's totally because of telegram apis are so hard to understand. I have used this for send a message to one…
Pejman
  • 2,442
  • 4
  • 34
  • 62
13
votes
3 answers

How to get the user's name in Telegram Bot?

I'm working in Telegram bot with a handler. where I need to get the user's name or users id once they use the command. MY CODE import telebot #Telegram Bot API bot = telebot.TeleBot() @bot.message_handler(commands=['info']) def…
13
votes
3 answers

Using HTML in Telegram bot

This is not a duplicated question. I want to use html codes in my telegram bot that is written by c#. I searched in SO but I did not find any answer. How to do that? I used TelegramBotSharp. Here is my code related to the part that I…
mojtaba.zamani
  • 137
  • 1
  • 1
  • 9
13
votes
1 answer

How many telegram bots can I create?

Is there a limit to the number of bots a user can create on telegram? I'm considering "selling custom bots" to people as a service, and would like to avoid having my clients handle technical stuff like api keys or "talking to botfather". So I would…
Roman
  • 5,888
  • 26
  • 47
13
votes
1 answer

telegram bot prefill text for user to edit

Telegram bot sends me a message with a text snippet, which I want to edit, and send back to the bot for further processing. Copy and paste takes time. Typing message anew takes time. Ideally I'd like to press an inline button "Edit" on the bot's…
Alexander Gorshenev
  • 2,769
  • 18
  • 33
13
votes
2 answers

Telegram bot: example json, inline_keyboard

Example json for show inline_keyboard in telegram bot https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating { "chat_id": "123456", "text": "Hi", "reply_markup": { "inline_keyboard": [[ …
jeissonp
  • 331
  • 1
  • 3
  • 8
13
votes
2 answers

Sending animated GIFs with sendPhoto (Telegram bot)

I'm trying to send an animated GIF with sendPhoto (Telegram's Bot API) with this request: https://api.telegram.org/bot/sendPhoto?chat_id=&photo=http://i.giphy.com/13IC4LVeP5NGNi.gif That method works, as in, I get ok:true back, but…
m52go
  • 343
  • 1
  • 3
  • 14
13
votes
6 answers

Telegram bot: How do I send message with inline keyboard and hide custom keyboard simultaneously?

Step 1: Send user a message with ReplyKeyboardMarkup with few buttons (for example ["Yes", "No"]) Step 2: If user click one of the buttons (for example "Yes") I want to display a message with inline keyboard and hide the buttons sent at step 1. Is…
Alexander Trakhimenok
  • 6,019
  • 2
  • 27
  • 52
13
votes
1 answer

How do I get the user picture/avatar using the Telegram bot chat API?

The user object has no photo_id, so is there way to get the user's avatar?
Antonio Carlos Ribeiro
  • 86,191
  • 22
  • 213
  • 204