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
1
vote
1 answer

Reply to a Python Telegram bot message

Please tell me how you can call the bot's response to any message in the feedback bot. By example: User: /start Bot: Welcome message (Hello) User: any message Bot: Feedback message (Expect an answer) I tried to do it through the echo function, but…
Sergey Marano
  • 125
  • 1
  • 4
1
vote
1 answer

Telegram response 400 when I sent notification in pipeline using Scrapy

I tried sending notification using telegram bot but I got response 400. My code (in pipeline): def sendnotifications(self, token): cursor = self.cnx.cursor() req = requests cursor.execute("SELECT * FROM notificate WHERE…
cevreyolu
  • 141
  • 6
1
vote
0 answers

How to handle an exception in telebot itself

I want to clarify, this is an asynchronous version of telebot. I tried various ways to catch the errors that occur. I specified the wrong token and launched the bot, but how can I handle this error, and instead of the standard message (which will be…
1
vote
1 answer

Telegram bot sendVideo aspectRatio

I use sendVideo method with file url, so telegram automatically create preview for my video, determines duration and aspect ratio of preview. But it incorrectly determines aspect ratio of preview, so it looks weird. (I suspect that it has some…
Valery Kozlov
  • 1,557
  • 2
  • 11
  • 19
1
vote
1 answer

Voting in a poll with Telegram Bot

Is there any way to vote in a telegram poll with a bot? I tried to use telepot and python-telegram-bot. I can get poll id, chat_id, options and all the relevant data, but can not find any way to implement messages.sendVote() method described in…
1
vote
1 answer

How to take a bio with a pyrogram

import asyncio from pyrogram import Client from pyrogram.raw import functions api_id = api_hash = "" TARGET = - app = Client("my_account") async def main(): async with app: # для парсинга группы async for member in…
1
vote
0 answers

jsonpickle returning AttributeError for Telegram object

I need to pass the Telegram message object between multiple AWS Lambda functions, so I need to serialize it. I found that it's possible using jsonpickle module, but I'm getting an AttributeError during decoding. This is how it works without…
jumpy
  • 317
  • 1
  • 12
1
vote
1 answer

How to send photos with multipart/form-data in media group with python requests?

json = {"chat_id":chat_id, "media":[{"type" : "photo", "media" : "attach://photo1.jpg"}, {"type" : "photo", "media" : "attach://photo2.jpg"}]} files = {"photo1.jpg" : open(r"../photo1.jpg", 'rb'), "photo2.jpg" : open(r"../photo2.jpg", 'rb')} temp…
1
vote
1 answer

How to send file from Telegram bot using C++

I am using TgBot for my bot : https://github.com/egorpugin/tgbot I am aware of the Telegram Bot API guidelines specifying that the file needs to be posted via a POST request using multipart/form-data in the usual way that files are uploaded via the…
Mickaël C. Guimarães
  • 1,020
  • 2
  • 14
  • 32
1
vote
1 answer

telethon split Message get number from string

I am using telethon in python. When I write .set 14 in Telegram, I want to receive the number 14 and define it as a variable. @client.on(telethon.events.NewMessage(outgoing=True)) async def outgoing(m): global ss if m.text==".set": …
Sayhag
  • 44
  • 4
1
vote
0 answers

Telegram Bot UNCLOSED CLIENT

Basically I was doing a small bot for telegram to send pictures from a subreddit, but it gives me an error which I don't know how to fix. Everything where it says (not shown) is something I can't show due to it being something with which anyone…
1
vote
1 answer

How fix Error message bot Telegram with JS

How can I fix this error in JS? error_code: 403, description: 'Forbidden: bot was blocked by the user' This initial code bot.start( (ctx) => { console.log(ctx.chat.id) if (newClient(ctx.message.chat.id)) { …
1
vote
1 answer

How to open telegram web application by button from channel (not private chat)?

Is there a way to open the Web Application in Telegram from a channel by clicking on button? That is, what is the algorithm? Adding a bot to the channel The bot sends a message with the button The user clicks the button and the application opens in…
1
vote
1 answer

How can I receive messages from a channel using the Telethon library?

My problem is that it saves a single message in the Json file, but I need more than one message. 2.I already added API ID and API HASH async def get_message(): client=TelegramClient('userBot',API_ID,API_HASH) await client.start() …
noname
  • 17
  • 3
1
vote
1 answer

Pause sending messages in loop, wait for user tap InlineKeyboardButton

User insert some values. Just for not spamming him with many messages, I want to pause sending them in loop and wait user tap inline button. So how can I pause them and wait for user tap "Next result" button? Code beneath just simplified, but works…
1 2 3
99
100