Questions tagged [telegram]

Telegram is a cross-platform cloud-based instant messenger with a focus on security. Use this tag for questions about interacting with Telegram, including use of its official API.

Main features

Messaging

It was the main feature of Telegram. It allows you to send messages to users who have the contacts and we know the nickname.

Groups

The groups are conversations between more than two users, I can reach up to 200 users. Each member of a group can add users, change the name of the group or avatar. Exceeded 200 members, the group becomes a "Supergroup". The supergroup can get to 100,000 users.

Channels

The channels are groups that do not have a limit of users . The peculiarity is that only administrators can write to the channel.

Bots

Telegram Bots are programmed accounts without a phone number. they can not initiate a conversation with a real user. The bot API provides methods to interact with users including sending and editing messages, custom keyboards, commands. (API Documentation)

5905 questions
18
votes
3 answers

How to send telegram mediaGroup with caption/text

I'm currently using python-telegram-bot and basically what I want to achieve with it is to send telegram messages like this: So the message consists of 2+ photos/videos with text message underneath. What I've already tried: sending message with…
marzique
  • 635
  • 1
  • 7
  • 17
18
votes
4 answers

Sending message in telegram bot with images

I have telegram-bot code on php, and reply messages sending by replyWithMessage method. All command here: $this->replyWithMessage(['text' => $item['title']. "\n\n" . $url]); How can i add some preview image before text?
SergioZhidkov
  • 371
  • 1
  • 3
  • 13
17
votes
2 answers

How to send bold text using Telegram Python bot

I am writing a telegram bot in Python. I want to send messages with bold letters. I tried to inclose message inside both * and **, but it does not solve the problem. Is there a function for mark up or HTML formatting or a way to do it?
Ramon de Llano
  • 365
  • 1
  • 2
  • 11
17
votes
4 answers

Creating an application that will listen to a telegram channel

First of all please note that this is not about creating a bot. My goal is to create an application that will simply listen to any number of telegram channels that the account I will provide it with is subscribed to and retrieve all messages sent to…
PentaKon
  • 4,139
  • 5
  • 43
  • 80
17
votes
5 answers

Change telegram bot owner

We have created telegram bot which has many difficult operations. Bot was created by one developer using his phone number. Is it possible change bot's owner or add another user as admin to bot?
Mansur Anorboev
  • 580
  • 1
  • 7
  • 17
17
votes
4 answers

how convert ogg file to telegram voice format?

I'm trying to send a voice message through SendVoice method in telegram bot, but it sends the voice as a document file (not play). ogg file by ffmpeg converted to opus…
M P
  • 173
  • 1
  • 1
  • 9
17
votes
8 answers

New Telegram bot return almost empty JSON to API

I want to create a Telegram bot, so I followed the instructions and got: Done! Congratulations on your new bot. You will find it at t.me/RonGuruBot. You can now add a description, about section and profile picture for your bot, see /help for a…
boardrider
  • 5,882
  • 7
  • 49
  • 86
17
votes
3 answers

Add user to channel automatically when user asks

I want to make a very simple project that does this: An user (let's call him John) opens a Telegram chat with my bot, and inputs this: User John: /join channel1 My bot responds adding user 'John' to Channel 'channel1' That's actually all I want. The…
Markomso
  • 273
  • 1
  • 2
  • 15
17
votes
8 answers

Clear "pending_update_count" in Telegram Bot

I want to clear all pending_update_count in my bot! The output of below command : https://api.telegram.org/botxxxxxxxxxxxxxxxx/getWebhookInfo Obviously I replaced the real API token with xxx is this : { "ok":true,"result": { "url":"", …
Hamed Kamrava
  • 12,359
  • 34
  • 87
  • 125
17
votes
1 answer

Is there any size limit to post a file using curl?

I need to post files up to 50 MB to Telegram bot API. Now I'm using Curl and everything tested and passed successfully. It means that I can only send small files (I couldn't send 8. 1 MB file in my test). So if I send large files (lets say more than…
Hossein Shahsahebi
  • 6,348
  • 5
  • 24
  • 38
17
votes
6 answers

Android - Send Telegram message to a specific number

I'm trying to send a Telegram message to a specific number from within my Android app. Right now my code launches Telegram app, and then the user has to select the destinatary. What I want to do is to send the message to the specified number,…
fergaral
  • 2,077
  • 6
  • 17
  • 34
17
votes
3 answers

Sending Telegram message from Python

I want to send a message from a Python script via Telegram. I have tried to do that via telegram-cli, both the original version from vysheng and the patched version from luckydonald. With both of them I could successfully send messages to my…
Matthias Kauer
  • 9,697
  • 5
  • 17
  • 19
17
votes
5 answers

What can I use to implement Telegram messages in my website?

After searching all over the web, I am forced to ask: What can I use to send messages using the Telegram API? JavaScript or PHP preferably. I have a group of friends that I wish I could tell through certain events on the website. Here's an…
naoxink
  • 595
  • 1
  • 12
  • 19
16
votes
1 answer

How to correct " 'coroutine' object has no attribute 'data'" Error when using Telethon for Telegram?

I am trying to code a simple thing in Python to automatically download some media from a Channel on Telegram. I am using Telethon for this. I keep getting an error that I cannot solve and for which I do not understand the reason. "'coroutine' object…
DDDYlan
  • 189
  • 1
  • 2
  • 7
16
votes
4 answers

How should I use parse_mode='HTML' in telegram python bot?

I'm trying to send a message in a channel with a bot, using Telegram API's send_photo() method. It takes a caption parameter (type String) but I can't format it through parse_mode='HTML' parameter... If I use something like this: send_photo(chat_id,…
Federico
  • 415
  • 1
  • 3
  • 15