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

Telegram Bot with Telegraf.js - Send messages to chat

I want to create a Telegram Bot with Node.js and I am using Telegraf for it. I know I can answer to messages like this: app.hears('hi', (ctx) => ctx.reply('Hey there!')) But how can I send a message without getting a message before? I want to read…
Nono
  • 1,073
  • 4
  • 23
  • 46
16
votes
1 answer

'stream.ReadTimeout' threw an exception of type 'System.InvalidOperationException' sending photo to telegram bot

I wrote below code for sending a photo to my bot, but in my stream, I have two exceptions for read and write and my photo was not send. I think maybe the reason was this error, but I couldn't fix it: stream.ReadTimeout threw an exception of type…
Maryam Ghafarinia
  • 417
  • 1
  • 5
  • 21
16
votes
4 answers

How can I detect whether a user deletes the Telegram Bot chat?

Is it possible to check, via an API, whether somebody has deleted the Bot Chat in Telegram? My test : Currently if a user deletes a chat, new messages will not stop sending to user.
Yoones Mehdian
  • 482
  • 1
  • 4
  • 18
15
votes
6 answers

How to get a Telegram Channel Id without sending a message to it

Is there any way to find a telegram channel id without sending a message to it ? Right now I go this way and find the channel id by calling this URL in my code and get the JSON as…
MohamadNik
  • 151
  • 1
  • 2
  • 5
15
votes
1 answer

Telegram: get fileid from telegram client

Telegram bots use fileid to download a file. How can I get this fileid from Telegram client (My Unofficial version) ? Files in mtproto have this location class that indicates their address. File Location Parameters dc_id int Number of…
Behrouz.M
  • 3,445
  • 6
  • 37
  • 64
15
votes
8 answers

Send an image link to telegram without display image url

I need send an image url to telegram without display image url and hidden url. I see a telegram bot and it's do it very well and send long message with image I'm attach this bot result image see it. Now how can do it in my custom bot? It's possible…
Matin
  • 597
  • 3
  • 8
  • 18
15
votes
1 answer

Set custom profile picture for a contact in Telegram

Is it possible to set a custom image for a contact who may has or not has a profile image in Telegram?
Ahmad
  • 265
  • 1
  • 3
  • 11
15
votes
3 answers

How to hide ReplyKeyboardMarkup after user click in Telegram Bot API

I am using Node.js telegram-bot-api. Idea: Show a custom keyboard with one button - "Share my phone number". When user clicks this button, contact should be sent and button should be removed from screen. Here is a code I am using right…
Nazar
  • 1,769
  • 1
  • 15
  • 31
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
15
votes
2 answers

Peculiar Eclipse java.lang.UnsupportedClassVersionError, Unsupported major.minor version 52.0

First of all, I'd like to point out that I am aware that this question has been asked countless times and I am aware of the usual solution. However, it doesn't seem to work for me. When the error Exception in thread "main"…
brain56
  • 2,659
  • 9
  • 38
  • 70
14
votes
1 answer

Open Telegram chat of specific user with text message via browser link

I would like to know if via a Browser URL I can open the Telegram chat of a specific user and at the same time pre fill the first message with a text passt over the URL. I know that I can open the chat of a user via this link…
Darius Mann
  • 637
  • 1
  • 5
  • 14
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
1 answer

Correct way to call telegram api methods

I'm working on Telegram api in my java application. I need to do authentication and authorization with my telegram account and get message list of my specific group. For this purpose, first I got api_id, api_hash and MTProto servers from telegram…
hamed
  • 7,939
  • 15
  • 60
  • 114
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