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
0 answers

python telegram bot, "socket.error: [Errno 98] Address already in use"

Im developing a telegram bot with this api and I tried to use its webhook example to set up my own bot with webhook method. I have an Ubuntu server and I have set up nginx on it. now when trying to run my python bot, I get this error: Traceback…
ganjim
  • 1,234
  • 1
  • 16
  • 30
0
votes
1 answer

I built a telegram bot with Python-Telegram-Bot;But do not work

I built a telegram bot with Python-Telegram-Bot.I added the bot to a group and got the bot in the admin group.I have defined a list(mlist) for the bot and put it in a list of words.The bot should check the messages the users send to the group.And if…
Sajjad
  • 41
  • 1
  • 4
  • 13
0
votes
1 answer

The telegram bot does not work for Persian messages

I create a telegram bot whit python-telegram-bot.I want to post the message to the group after sending messages to the group,and the bot check the message, and if the word in the mlist is in messages, the bot will delete the message, but if the…
user8424508
0
votes
1 answer

Telegram Bot Is Not Working

I made a telegram bot with python-telegram-bot. I have defined a list of words for the bot and I want to manage the chat bot in the group. That is, if there is a word in the chat that is found in the defined list, the bot will delete it. I added the…
Sajjad
  • 41
  • 1
  • 4
  • 13
0
votes
1 answer

I create a telegram bot;but dont work

I create a telegram bot whit python-telegram-bot. I have defined a list of words for the bot,and I want to manage the chat bot in the group, that is, if there is a word in the chats in the list defined, the bot will delete it. I added the bot to a…
Sajjad
  • 41
  • 1
  • 4
  • 13
0
votes
0 answers

Use one inline query to lead into another inline query? Telegram Bot (Python)

My bot passes a simple string (query.query) through a function that returns a "big" dictionary with many subdictionaries (each representing "card" data) inside it. As it works right now, all keys and values for all returned subdictionaries get…
Mike R
  • 1
  • 2
0
votes
1 answer

How to solve updater.dispatcher.add_hanlder in python Telegram bot API

I'm writing a python telegram bot and I want to work with inline keyboard bottom. I write this code below: from telegram import * from telegram.ext import * mbti_message = 'This is a test massage that should sent in MBTI part' def startx(bot,…
0
votes
1 answer

How to send multiple image in telegram bot sendPhoto() method if one URL not respond

i'm new in python and have a problem. I want to send some photos with telegram bot with using below code.E.g.i want to send 5 image with different URL and i write below code 5 times with different URL.my problem is that when one of the URLs is wrong…
user3480650
  • 19
  • 1
  • 5
0
votes
1 answer

python-telegram-bot menu creation util library import issue

I'm trying to build menu in telegram using python-telegram-bot module and in it's sample there is: button_list = [ InlineKeyboardButton("col 1", ...), InlineKeyboardButton("col 2", ...), InlineKeyboardButton("row 2", ...) ] reply_markup…
Masoud Motallebipour
  • 414
  • 3
  • 16
  • 33
0
votes
1 answer

Call variable from cherrypy webhook class

I set webhook to my telegram chatbot with the help of CherryPy. And now I am trying to handle data which I receive through webhook. I found the variable in cherrypy webhook class which contains needed json data. In my code, the variable name is…
0
votes
1 answer

How do I print on the console if a user use a regex?

I've written a regex so when a user writes in the chat "Kosovo", my bot will send him an audio and a text. regex = "k+o+s+o+v+o" try: nick = update.message.from_user.username if re.search(regex, contLower): …
0
votes
1 answer

How to make a press on a button in ReplyKeyboardMarkup not to send a message (python-telegram-bot)

I have to ask user for his phone number, so I made a custom ReplyKeyboardMarkup with digits to make it easier for user to reply. But whenever user presses a digit, it automatically sends a message containing this digit. How to disable this feature…
0
votes
1 answer

How would I upload a BytesIO image to Telegram through telepot Bot.sendPhoto(uid, photo)?

So, I want to be able to upload a photo I have generated with the qrcode class to Telegram through telepot. This is the code I have originally tried! img = qrcode.make(totp.provisioning_uri(settings.OTPNAME)) # This creates the raw image (of the qr…
0
votes
1 answer

Telegram echo bot for channels

I have the following telegram bot written in Python (3.x): import telebot import subprocess from telebot import types import os bot = telebot.TeleBot(os.environ['BOT_API_TOKEN']) @bot.message_handler(commands=['start']) def save(messages): for…
Néstor
  • 351
  • 1
  • 5
  • 20
0
votes
2 answers

send binary with sendDocument in python-telegram-bot

this work : mybot.sendDocument(chat_id=chatid, document=open('bla.pdf', rb')) But if I did before : with open('bla.pdf', 'rb') as fp: b = fp.read() I can't do : mybot.sendDocument(chat_id=chatid, document=b) The error is : TypeError:…
jgirardet
  • 109
  • 2
  • 9