Questions tagged [telebot]

Telebot is a bot framework for the Telegram Bot API. The package provides a kind API for command routing, inline query requests and keyboards, as well as callbacks.

Telebot is a bot framework for the Telegram Bot API, available at https://github.com/tucnak/telebot

213 questions
0
votes
2 answers

Delete key/value from a dictionary Json

In a simple Telegram bot with Telebot I have a dictionary in json format (parole.json). I'm trying a function that allows me to delete an entry (key value pair) from the dictionary and I used this code example found right on this forum: import…
0
votes
1 answer

How can i send many videos from list in telebot python

So I was writing a python script using telebot and got an error A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: file must be non-empty I have tried different methods from many forums, but nothing…
kavunqwe
  • 1
  • 2
0
votes
2 answers

How can I answer inline queries in telegram bots in php(laravel) with Telebot plugin?

How can I answer inline queries in telegram bots in php(laravel) with Telebot plugin? I'm working on a bot project in laravel and I'm using the Telebot package. does Telebot support answerInlineQuery method? I can't find it. …
0
votes
1 answer

Simple dictionary with Telegram Bot

I'm working on a simple dictionary accessible through a telegram bot. This is my code in Python, what am I wrong? #!/usr/bin/python3 import telebot API_TOKEN = 'MY TELEGRAM TOKEN' bot = telebot.TeleBot(API_TOKEN) Dizio={'cat': 'blue', 'dog':…
0
votes
1 answer

How to use an emoji as prefix instead of "/" on Telebot

I'm trying to write a Telegram bot to help a friend with his online buisness. I'm trying to make an interactive menu, but if I try to use an emoji as a prefix the @bot.message_handler doesn't read the user input, resulting in the menu not…
Markintosh
  • 44
  • 7
0
votes
1 answer

Get user id by forwarded message (telebot)

I can't solve the problem: I can't get the id of the user whose message I forwarded to the bot. When i forward a message i get my id. I'll be glad to help!!!! My cod: import telebot bot = telebot.TeleBot('TOKEN') @bot.message_handler(func=lambda…
arnold
  • 177
  • 7
0
votes
1 answer

local variable 'subprocess' referenced before assignment

Here is it my code, I'm trying to perform command in commandline and get output, but I got error. Please help me import telebot import subprocess token = '' bot = telebot.TeleBot(token) @bot.message_handler(commands=['echo']) def…
kamazz
  • 159
  • 1
  • 2
  • 12
0
votes
1 answer

How to get value of variable call.data when use two IF statement

i have a problem hope someone can help me. Ex: @bot.callback_query_handler(func = lambda call: True) def xu_ly(call): if call.data == 'a': markup = sub_main_1_2() if call.data == 'a_1': markup =…
batuocmu
  • 3
  • 2
0
votes
1 answer

finding file_id of a group media message in telegram by telebot library

In my bot, I received a forwarded media group message which contains 3 different photos. Now I want to catch all these 3 photos and send them again to another chat_id. However, all values in message.photo.file_id are representing the same photo in…
Ali Saghi
  • 11
  • 2
0
votes
1 answer

telebot delete message pytelegrambotapi

How can I delete the last N number of messages from any users. After writing the delete command, the bot must delete the latest messages by the given number. I could not find complete documentation on the pytelegrambotapi library in any way.
0
votes
1 answer

Can send a message using the Telegram API via. the browser but not a python script

I can send a message to a telegram channel that includes my own bot using the following url in a browser: https://api.telegram.org/bot*****/sendMessage?chat_id=-********&text=Hello%20World! #there's a - before the chat id value However, the…
Bhav
  • 1,957
  • 7
  • 33
  • 66
0
votes
2 answers

How can I reply to a message after a command in Telebot API in python

I have this code.. import telebot #telegram API api_key = os.environ['Tele_API_key'] bot = telebot.TeleBot(api_key) @bot.message_handler(commands=['start']) def help_command(message): bot.send_message(chat.id,"send a…
-1
votes
1 answer

/stats command not working in telegram bot

I am writing a bot that will display messages found by keywords in the LAN - this system is fully functional, but I decided to add the /stats command and the bot ignores it! Even print does not output anything, as if the command does not exist at…
Larry Dog
  • 3
  • 1
-1
votes
1 answer

How to handle the error 403 'Forbidden: bot was blocked by the user'?

How to handle the error 403 'Forbidden: bot was blocked by the user'? I have a Telegram bot for anonymous chat using a MySQL database, and it occasionally throws this error even when no one is using the bot. I've tried error handling to prevent the…
Vladyslav
  • 1
  • 1
-1
votes
1 answer

My telegram bot is not responding after I click on a button

I have a telegram bot (I'm using the telebot library) that's integrated with Firebase (especifically with Firestore Database). The bot asks the user if they want to know the power consumed in a room or of a specific device inside a room - the device…