Questions tagged [telepot]

telepot is a python library to access the Telegram Bot API and work with it via python script or console

109 questions
0
votes
1 answer

Is there a way to get a complete expression with the ReplyKeyboard in python-telepot for telegram bot?

I'm doing a telegram bot with python-telepot and I want to create a keyboard with ReplyKeyboardMarkup, this keyboard has the function of entering a mathematical expression that I want to derive (apply the function of derivatives) I show you the…
0
votes
1 answer

How to use getUpdates() with JSON

I found a method online that I am using for retrieving messages and updating bot. Here is the code I found: def getMessage(self, offset): if offset: update = self.bot.getUpdates(offset=offset) else: update =…
0
votes
1 answer

Trying to put a variable as command

My variable urls finds URLs from messages. I want my bot to send yes if it finds a URL from the received messages. Here is what I tried, def action(msg): chat_id = msg['chat']['id'] command = msg['text'] urls =…
0
votes
1 answer

Python3 Telepot SSL Error while connected to VPN

I am currently working with VPN and telepot library which is used to manage telegram bots. When I tried to listen messages, It gives me this SSL error. Traceback (most recent call last): File…
0
votes
1 answer

Thread Save Serial Connection in Telepot (Python)

I have a serial device (Arduino) regularly outputting log data, which shold be written in a Log file. Also the device takes spontaneous commands over serial. I send the commands to a Raspberry over Telegram, which are handled and sent to the arduino…
0
votes
1 answer

how to forward a message from the bot(not a person) to a chat

I want to forward the whole conversation of my bot and another person to myself This is my code: import telepot bot = telepot.Bot('') def handle(msg): my_id = 123456789 # this is my id for example chat_id = telepot.glance(msg)[2] …
0
votes
2 answers

How to be notified on telepot error?

My telegram bot consists of a telepot DelegatorBot. When the internet connection goes down, telepot notices, throws an error, catches it (so I assume) and retries. How can I notice that an error happened and log accordingly, without just redirecting…
lucidbrot
  • 5,378
  • 3
  • 39
  • 68
0
votes
1 answer

How can make conversation between bot and user with telepot

I want to create the bot with telepot that ask the users frequent questions. For example first ask 'whats your name.?' then the user reply 'user-name',then ask how old are you? and the user reply his age and ... I had written a code for this chat…
samira
  • 118
  • 1
  • 2
  • 18
0
votes
2 answers

How to append in python for telegram bot

I am doing a telegram bot with something like a calculator, I'm trying to append all the inputted values so that i can save the value in a variable. numpad = InlineKeyboardMarkup(inline_keyboard=[ [InlineKeyboardButton(text='1',…
Xavier Tan
  • 53
  • 8
0
votes
2 answers

urllib3 using an ssh connection as proxy

I have an ssh connection as below in my local laptop: ssh -f -N -D 3232 USER@IP now in telepot which using from urllib3 i want to pass all connections to this ssh connection because Telegram servers has been banned in my office. I read this and do…
user5201134
0
votes
1 answer

How to put a variable in bot.sendMesage (python)

I'm creating a telegram bot with python and I can't find the way to make the output of a variable with bot.sendMessage. Can anyone help me please? var = '123' bot.sendMessage(chat_id, "The number is:"var)
Andrea Rossi
  • 45
  • 1
  • 5
0
votes
0 answers

BadHTTPResponse(response.status, text, response) telegram bot api

I have an inline bot that gets a string from the user(inline mode) and sends back some data. This is my code: # -*- coding: utf-8 -*- import sys import time import telepot from telepot.loop import MessageLoop from telepot.namedtuple import * from…
user8488890
0
votes
1 answer

How can I get information from the user telegram bot?

For example, the bot sends "Send me your name", "Send me your last name" and saves this data in two variables.my language is python and i used telepot package for make the bot
samira
  • 118
  • 1
  • 2
  • 18
0
votes
0 answers

How to convert a YouTube video to mp3 and get the download link URL to end with .mp3

I was working on a telegram bot to convert YouTube videos to mp3 using Python. I already know about youtube-dl but I wanted the URL to end with .mp3 particularly because in bot.sendAudio(chat_id,file) file must be a URL that ends with .mp3.
chris
  • 139
  • 1
  • 1
  • 6
-1
votes
1 answer

Telepot on python, can't send multiple photos with sendGroupMedia

I'm trying to send 2 or 3 photos at the same time, so they're displayed as one message on my channel. To send one photos I used python's requests library, with this line of code; pic = {'photo' : open('p.jpeg',…
Serge
  • 1
  • 1