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
9
votes
2 answers

Telegram Bot API: getChatMember throws USER_ID_INVALID for valid user

I'm trying to find out if a specific User is present in a supergroup, in order to keep track of those who left. For that, I'm calling the Bot API method getChatMember for each User and checking if their status is either Left or Kicked. However, I…
Axel Magagnini
  • 855
  • 1
  • 8
  • 19
9
votes
1 answer

Telegram URL to send message to specific bot

Is it possible to craft a t.me URL that prompts the user to send a specific message to a specific bot. The closest I've found so far is t.me/share/url?url=my%20message, but that doesn't specify a username so the user has to choose one. I don't see…
Isvara
  • 3,403
  • 1
  • 28
  • 42
9
votes
4 answers

How do you remove reply keyboard without sending a message in Telegram?

In Telegram bot you can send a message with the reply keyboard using the sendMessage method. The keyboard is getting displayed instead of normal qwerty one. We can remove the displayed keyboard by sending another message and by passing…
Slava Fomin II
  • 26,865
  • 29
  • 124
  • 202
9
votes
2 answers

PythonBot - pass argument to command hanlder

I'm playing a little bit with Python Telegram Bot, I want to pass to my handler an argument obtained with previous computation, e.g: def my_handler(bot, update, param): print(param) def main(): res = some_function() …
Alessandro Gaballo
  • 708
  • 3
  • 13
  • 28
9
votes
2 answers

How to send a hyperlink in bot.sendMessage()

My bot sends out links. so I wanted to include a hyperlink like the one you can do with HTML for example -a href="google.com" Google /a shows up a click able text called "Google" how can I do this in bot.sendMessage()? and also if you have any idea…
chris
  • 139
  • 1
  • 1
  • 6
9
votes
3 answers

Can I get a Telegram bot to put some text into the user's message input box?

I'm building a Telegram bot, in which the user sends messages, which are later posted to another website. The bot can often give the user a suggestion of what to write, but the user must have a chance to edit this suggestion before actually posting…
Amir E. Aharoni
  • 1,308
  • 2
  • 13
  • 25
9
votes
2 answers

Create new group using telegram bot API

How can I create new groups using a bot in Telegram? As far as I know a bot cannot do this itself, so is it possible to implement a bot as a regular user? How? Update : This is what I want http://t.me/polyglossia
ShahinSorkh
  • 599
  • 1
  • 9
  • 23
9
votes
1 answer

telegram bots, how to request input from user?

I know how to use telegram commands, and know how to read what command has been executed. What I would like to do is something like this: User: /send_address Bot: Hello, please type your address.. User: my address... so far, i can read the…
sharkyenergy
  • 3,842
  • 10
  • 46
  • 97
9
votes
1 answer

how to create link in telegram bot

I am designing a telegram bot. I want to show some links e.g. 1- wkpviana 2- vianahosting that when user click it, open http://wkpviana.net http://vianahosting.ir in browser. How I can create it in php? part of my code is:
9
votes
4 answers

is there any way to save all text-data from a telegram channel using a bot?

I need to save all text-data from a public channel of telegram in a text file. (so I can do some analysis on it later) is it possible to write a bot that can do such thing?
zmeftah
  • 148
  • 1
  • 2
  • 10
9
votes
2 answers

How to hide Telegram BOT commands when it is part of a group?

I'm trying to use a Telegram BOT to send messages to a group. First, I thought that it'd be enough to know the group chat id to accomplish that, but it's not. The BOT MUST be part of that group. OK, it kind of make sense, but the problem is: When…
Maverick_Java
  • 5,665
  • 2
  • 13
  • 15
9
votes
3 answers

Class with property that can be one of two different types

I'm developing a Telegram bot in C# but have difficulty with implementing Message type. According to API documentation, chat field can be either of type User or of type GroupChat. How do I implement that in C#? So far I could only come up with…
Azimuth
  • 2,599
  • 4
  • 26
  • 33
9
votes
2 answers

Telegram bot API: Can I mix a custom keyboard and a force_reply?

I have a custom keyboard but to process the answer i need a force reply so i get the question back in the next message. I have done this: var opts = { reply_markup: JSON.stringify({ keyboard: [['OK','Cancel']], …
Peter Newman
  • 91
  • 1
  • 1
  • 3
9
votes
2 answers

Sending photo from URL with Telegram Bot

I made a telegram bot which sends photo upon request from URL using pyTelegramBotAPI wrapper. So I tried putting a dummy photo URL and test if the bot can send the image but it failed with the following error. telebot.apihelper.ApiException:…
Zerocchi
  • 614
  • 1
  • 8
  • 20
9
votes
3 answers

Telegram bot API no JSON POST data on webhook

I can't seem to get the JSON POST data of the webhook. I set up everything correctly (the webhook URL, also tested if the server is getting POST requests) and the requests are coming when the user posts something, but no POST nor GET data is logged.…
L. Pes
  • 128
  • 1
  • 6