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

How to create inline buttons in PHP Bot Telegram

I must program in php due to company needs... but I am working with php for first time... and it's the first time I am working with telegram bot :'( In some way, before, when i ran the command /start and doWork everything worked... but now I must…
Simone
  • 2,304
  • 6
  • 30
  • 79
8
votes
4 answers

Get Reply Message from Telegram Bot API

I'm developing a Bot that I want users to call in a reply to a previous message. So you would reply to a message with the bot command. For Example User 1: Hello World User 2: (Reply to Hello World) /command test message Right now I am only able…
Gideon Rosenthal
  • 1,953
  • 2
  • 18
  • 16
8
votes
5 answers

Telegram Bots: Encoding Plus Character / Plus Sign

I am working on a telegram bot which sends telephone numbers to my telegram account. The problem is, that a '+' is converted to a ' ' blank. So every telephone number is wrong. E.g. '+4915733000000' turns into '4915733000000'. I've tried to use the…
Böne
  • 101
  • 1
  • 4
8
votes
3 answers

Can a telegram bot block a specific user?

I have a telegram bot that for any received message runs a program in the server and sends its result back. But there is a problem! If a user sends too many messages to my bot(spamming), it will make server so busy! Is there any way to block the…
MaGaroo
  • 164
  • 1
  • 1
  • 13
8
votes
1 answer

What is Difference between `msg.chat.id` and `msg.from.id` in Telegeram Bot?

What is Difference between msg.chat.id and msg.from.id in Telegeram Bot? Apparently, both are the same and Return user id. bot.sendMessage(msg.chat.id, 'Hi', opts) and bot.sendMessage(msg.from.id, 'Hi', opts)
Saeed Heidarizarei
  • 8,406
  • 21
  • 60
  • 103
8
votes
3 answers

Don't let member to send message in telegram group

I'm looking for a way in telegram group that don't let member to send message or, delete message after a person send. Is it possible to create a bot like this how help admins to stop chatting after start the bot? Is there any other way to do this?
Ashkan
  • 1,357
  • 4
  • 16
  • 37
8
votes
2 answers

How can I mention Telegram users without a username?

I want mention users even those which do not have a username. If a user has set up a username I return Hi @username as an answer but if a user does not have one I can't do that. I tried using the unique User ID e.g. @5642166 but that did not…
john
  • 81
  • 1
  • 1
  • 2
8
votes
4 answers

send long message with photo on telegram with php bot

I need send to telegram long text with photo but telegram image caption has 200 character limit. How can send long text with photo using php and bot? sendPhoto method has 200 character limit. I see a telegram bot it's send long text and photo see my…
Matin
  • 597
  • 3
  • 8
  • 18
8
votes
4 answers

Getting the user's "Last Seen" from a Telegram bot?

When I chat with a telegram user, I can see for each user their "last seen" - when they last connected to Telegram (even if I haven't chatted with them for a while). Is there a way to query for this information via the bot API? I haven't found a way…
ripper234
  • 222,824
  • 274
  • 634
  • 905
8
votes
4 answers

Telegram Bot: Is it possible to get userid using username?

As the title says, is it possible to get userid using username? I mean, I would like to add a feature to my bot that tells you the user id from an other user using his username. Does Telegram API give an option to do this?
Abdelilah El Aissaoui
  • 4,204
  • 2
  • 27
  • 47
8
votes
3 answers

Java based Telegram Bot Api: How to send emojis?

I'm doing a Java based Telegram Bot API, but I don't know how to send emojis from Java. I've tried to send emojis as unicode using the emoji-java library, but it doesn't seem to work. So, how can I send emojis from Java to Telegram? Thank you.
D. Fuentes
  • 83
  • 1
  • 5
8
votes
1 answer

"getFile" method in Telegram Bot API

In Telegram Bot API there's a method "getFile" https://core.telegram.org/bots/api#getfile. I have a bot for testing and have Telegram install on Android. How do I test this method, should I send a file to my bot? If so, then how exactly?
Kemeeda
  • 123
  • 1
  • 1
  • 7
7
votes
3 answers

Telegram: How to find Group Chat ID?

I've been trying to solve this for three days and none pf the solutions I've found online seem to work, so I am going to have to ask for help. I want to create a Telegram "Group Chat" to be used by members of a club I'm in. I created the chat named…
Angus McLeod
  • 73
  • 1
  • 1
  • 5
7
votes
3 answers

How to create a three dashes menu on a Telegram bot?

How could I create a three-dashes menus on a Telegram bot, similarly to what they do to the Jobs bot? It should be similar to this: How do we call this kind of menu?
Gabriel Diego
  • 950
  • 2
  • 10
  • 22
7
votes
1 answer

How to use python-telegram-bot to send messages to a telegram channel

I created a telegram bot and added it to my telegram channel. Now, I want to use it to send messages to my channel, when something is happening in my python program. For example, I have a python program that checks the weather every 15 secs, and…
Tom
  • 71
  • 1
  • 1
  • 2