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

How to work with Cron and Telegraf-bot in Nestjs?

I use Telegraf and cron from @nestjs/schedule in my Nestjs app. Below you can see my app.module: import { Module } from '@nestjs/common'; import { BotModule } from 'src/bot/bot.module'; import { TypeOrmModule } from '@nestjs/typeorm'; import {…
Roman Savka
  • 11
  • 1
  • 2
1
vote
1 answer

telegram bot - Bad Request: file must be non-empty

I want to send a text file in telegram bot for c# version 15.7.1 with the following code : var csvFile = new StringBuilder(); foreach ( var person in persons) { var output = new List
behroozbc
  • 1,992
  • 2
  • 12
  • 25
1
vote
1 answer

How can I get file_id with Telethon?

I'm creating a Telegram Bot and I need to get file_id.for example, photos. For example: "AgACAgIAAx0CW7VwqQAD3GE80mUSC6AbGV2lcHFzI5J3me7zAAJwtTEbkWJISbKzPMDueHfrAQADAgADeAADIAQ" Is there such a possibility and how can I do it? If you need more…
Lans
  • 21
  • 2
1
vote
1 answer

Telethon receive location from user

What is a proper way to listen to "send location" messages from the user? My solution is to filter out messages by type of their media (process_location): @bot.on(events.NewMessage(pattern=commands('/start'))) async def send_welcome(event:…
Yevhen Kuzmovych
  • 10,940
  • 7
  • 28
  • 48
1
vote
1 answer

Telegram Laravel Bot Reply

I'm pretty new to laravel and Telegram API and I want to develop a bot that can reply your input messages. For now I can send messages when I refresh a route, but I would like it to send a message and reply once your start a conversation with…
Charg3r
  • 29
  • 2
1
vote
1 answer

How can I send multiple answer poll using Telethon (user can select more then one options)

I did my best but I'm unable to find a resource and my current code sends an anonymous poll but I want to send 'Multiple Answer poll' so one user can choose more than one option. also, how do the bot will know which option is pressed? await…
user14023488
1
vote
3 answers

Defining which option returned by JSON is greater according to the combination of two data values

In order for me to download an image published on a Telegram channel, I need this path: var contents = JSON.parse(e.postData.contents); Logger.log(contents.channel_post.photo); And the answer is: [{ "file_id":"AAAAA", "file_size":11111, …
Digital Farmer
  • 1,705
  • 5
  • 17
  • 67
1
vote
2 answers

Telegram.Bot.Args.MessageEventArgs is missing in Telegram.Bot v17.x.x package

I'm using .NET 5.0, and have installed a pack of Telegram.Bot v17.0.0-alpha.3. When I tried to write an argument as MessageEventArgs type I couldn't find this class. There're only two classes in the namespace Telegram.Bot.Args, like…
1
vote
1 answer

Can't send audio file with telegram bot

I've got stuck trying to get my bot to send audio file and tried reading everything I can and for some reason still not working... this is my code, its quite long so i've just included relevant parts: import Constants as keys from telegram.ext…
sade mae
  • 13
  • 4
1
vote
1 answer

How to save telegram data in a google spreedsheet?

I have built a simple telegram bot using telegraf and used this code to log a specific information that I need : bot.on('text', (ctx, next) => { console.log(`[text] ${ ctx.message.chat.id } ${ ctx.from.username } ${ ctx.message.chat.first_name+ "…
1
vote
1 answer

How to get parallel access to the method for multiple users

My telegram bot is necessary so that the user can answer questions in order and save these answers in the same order for a specific user in parallel. static readonly ConcurrentDictionary Answers = new ConcurrentDictionary
coxcoxgo
  • 39
  • 1
  • 5
1
vote
1 answer

Set chat permissions via telegram bot

I want to add a function to the bot "change chat permissions" and I can't figure out how to do it. Using an aiogram lib with postgresql database (psycopg2) Python 3.9.5 aiogram==2.14.3 Callback handler (for example: call.data =…
rvbsm
  • 13
  • 6
1
vote
0 answers

Python. How to make the previously entered value in telegram appear in the line "Write a message"

Hello. Need help) There is a code: def edit(message): num = int(message.text) num = num - 1 bot.send_message(message.chat.id, list[num]) The logic is simple. The person enters data. They are saved in the list under their own number. The…
Zvezda_013
  • 11
  • 1
1
vote
1 answer

Unable to call function using python-telegram-bot in ConversationHandler

In my code when the bot is triggered the function user_exist() is triggered. If returns False, the function new_account() is triggered and works perfectly, instead, when returns True, it should trigger the function wallet_handler(), but it can't.…
1
vote
1 answer

Telegram Bot deep linking: Is there a maximum payload length of 64 chars?

I am currently trying to send some payload via deep linking, and it seems there is a maximum length limit of 64 chars to be added after the start parameter in the url. I tried both plaintext and base64 encoding and when I enter more than 64 chars,…
Christoph S
  • 697
  • 1
  • 6
  • 29