Questions tagged [python-telegram-bot]

This is a Python library that wraps around the Telegram Bot API. Note that this is not a general tag for "Telegram bots written with Python", but only for question about this particular library.

This is a library that wraps around the bot HTTP API. It is compatible with only (please check the PyPi/GitHub page for detailed info).

Telegram Bot API

The Telegram Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.

1454 questions
0
votes
1 answer

How can I remove inline keyboard after click? (python)

My bot sends a message and two buttons. After the user clicks the + or - button, I want this built-in keyboard to disappear. Here's how I make the buttons: markup_command = types.InlineKeyboardMarkup() btn_p1 = types.InlineKeyboardButton(text='+',…
0
votes
2 answers

Telegram Bot InlineKeyboardButton Full Text

I am using InlineKeyboardButton to create buttons in telegram bot, like the following. keyboard = [[InlineKeyboardButton("Option 1", callback_data='1'), InlineKeyboardButton("Option 2. Long text here. Long text here. Long text here.",…
com
  • 2,606
  • 6
  • 29
  • 44
0
votes
1 answer

Python Telegram bot callback with a custom message not working

I am using Python telegram bot api (https://python-telegram-bot.org/) to reply to commands. My dispatcher looks like this: updater.dispatcher.add_handler(CommandHandler('show', hello, tweet)) And callback function is: def hello(bot, update,…
0
votes
0 answers

Telegram bot commands stopped responding abruptly, what’s wrong?

I’ve been working on a telegram bot and I just managed to design it to handle commands and issue responses to users. I was able to achieve this successfully and started testing each and every command repeatedly to ensure they work, mind you these…
0
votes
2 answers

Telegram Bot without command line through python

I am a new beginner in Telegram bot now I test a telegraom bot with simple respond. As we know, we can use python for telegram. There is my code: from telegram.ext import Updater, CommandHandler def hello(bot, update): …
Edwin Cheng
  • 63
  • 1
  • 8
0
votes
1 answer

passing text/string in url of telegram bot by python

I want to pick a data from a website and need to send on telegram bot as message i'm able to send a text message "Hello" on telegram bot by pyhton code: r =…
0
votes
1 answer

Django global variable to store immutable object

I'm trying to set up python-telegram-bot library in webhook mode with Django. That should work as follows: on Django startup, I do some initial setting of python-telegram-bot and get a dispatcher object as a result. Django listens to /telegram_hook…
0
votes
1 answer

Python: bot send a file during conversation

I have created a bot using python-telegram-bot module. Bot generates barcode with the pybarcode module. During bot conversation, I would like send to user the image created: from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove,…
Francesco
  • 352
  • 1
  • 8
  • 19
0
votes
1 answer

Python-telegram-bot buttons handler invokes multiple times

When I press an inline button, handler button_pressed invokes multiple times. How to fix it? I need only one invocation. def button_pressed(bot, update): query = update.callback_query keyboard = [] for article in nn: …
0x1337
  • 1,074
  • 1
  • 14
  • 33
0
votes
0 answers

Can't delete message telegram

I have a channel where the bot sends messages and today(27.03) Im trying to delete the message that the bot sent 19.03 using python wraper for telegram api. Request to api return "Bad Request: message can't be deleted" Bot have full privileges as…
0
votes
1 answer

Bot stopped responding with self signed certificate

I used pyTelegrambotAPI, cherrypy as webserver, update method webhook, self signed ceritficate and tonight after six month working without any problem 2 of my bots stop responding. When I use…
user8794562
0
votes
1 answer

Save Gif in python Telegram bot

I have a telegram bot, users send GIF images to me, and I want to download them. Is there any way to do this? I have already tried to download the GIF as a video file, but telegram would not recognize the GIF as video.
0
votes
1 answer

How to add text and Inline buttons in switch_inline_query button?

I have a Inline button with attribute switch_inline_query, and I want after pressing the button and choosing conversation from bot sent a message in inline mode with the text and inline buttons, how can I make it? Please any ideas.
user8794562
0
votes
1 answer

InlineKeyboardMakeup is shown, but doesnt resrond

I am new to telegram bots. I read about Inline keyboards and try to create my own one. here is my code: def Choice(bot,update): quest = [[InlineKeyboardButton('1st question', callback_data = '1'), InlineKeyboardButton('2nd…
0
votes
1 answer

Read channel recent actions with telegram bot

My bot is admin in a channel and I want to read channel's recent actions(like who joined the channel and etc) using python-telegram-bot. How can I achive this?