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

Telebot outputs a lot of messages

I am writing my bot on telebot. If I quickly press the button several times, the bot will respond with a bunch of messages. Moreover, to fix this, you need to restart the bot. How can I fix this? Example: enter image description here Example…
-1
votes
1 answer

how can i schedule these 2 functions?

I have these 2 functions, by the end of each bot will send random message from txt file. For example i want to schedule 1 func at 9 AM, and second at 10 PM. But module schedule doesn't work and idk why. @bot.message_handler(commands=['start']) def…
Max
  • 1
  • 2
-1
votes
1 answer

Not called register_next_step_handler

I'm just beginner at python. I need to create a bot in telegram. I ran into a problem that no register_next_step_handler is called in a_handler. It seems that I need to send a new message to the user in order to pass a new message parameter,…
-1
votes
1 answer

Telebot, Python and InlineKeyboard

Im triyng to make filter inside inlinekeyboard, in short: markup = types.InlineKeyboardMarkup() button_4 = types.InlineKeyboardButton('Да, все верно', callback_data = 'yes') button_5 = types.InlineKeyboardButton('Нет, нужно изменить',…
-1
votes
1 answer

Python telebot does not send messages via dockerfile

I wrote a simple bot, to send results from main script bot = telebot.TeleBot("API") cost_sum = str(data2['cost'].sum()) date = last_date.strftime('%Y-%m-%d') result = 'Capterra costs export done \n' + date + ' - ' +…
-1
votes
1 answer

While writing a telegram bot (with pyTelegramBotAPI) I encounter an error TypeError: 'NoneType' object is not callable

I am writing my first bot. The problem occurs right after send_to_club() function sends "hello". I tried to instead use a message handler with a lambda function but it didn't help either. Can you please help me find the mistake? import telebot from…
-1
votes
1 answer

On Heroku can't save dataframe as imgafe and send to user

My telegram bot code has line (tried all three). This code works normally on local computer but when upload to Heroku, can't make it to create image of dataframe and send to user. Can't understand why it happens. import dataframe_image as…
Zaur
  • 23
  • 7
-1
votes
1 answer

Find every match in Json File with Python

I have a Json file like this: { "cat": "FILE3", "cat flag dog": "FILE5", "zebra tiger": "FILE9", "home cat": "FILE10", "tv snow": "FILE12", } In a Telegram bot, I would like to extract all the values that contain the word "cat"…
-1
votes
2 answers

How do I install pytelegrambotapi on visual code studio

I am quite confuse as I tried to install it using the command $ pip install pyTelegramBotAPI on VS terminal but it does not seem to work https://i.stack.imgur.com/ZYXMA.png (image of the error), I tried looking up for telegrambot extension but could…
bryan
  • 1
  • 1
  • 1
-2
votes
0 answers

How to catch an error from the telebot module?

Loosing internet connection, the output console is filled with errors. I am trying to catch those exceptions. I added the try and except blocks but to no use: try: bot = telebot.TeleBot(API_KEY) …
-2
votes
1 answer

how do I get a users ID via their username?

I am trying to create my own admin bot that can handle a lot of the admin stuff. how do I get a users ID via their username? I don't see any way to get it from the API, or did I just miss it? If you are interested, I'm using Telebot. user =…
SA ED
  • 1
-2
votes
1 answer

Is sending direct message to user id using telebot impossible now

At first the code was working well, I could send a broadcast to all bot users using there IDs stored on a database. But it brings an error now. My code def send_cast(message): msg1 = message.text.split(None,1)[1] user = message.chat.id …
-2
votes
1 answer

How to send message to a telegram bot using telebot api or telegram api

I currently have created a bot in telegram and am using it to perform some action whenever a msg is sent to the bot uisng the telebot api. I now am creating a new app where my back end gets the data from a webhook and I want to directly send that…
Lcx
  • 3
  • 2
-2
votes
1 answer

Telegram Bot does not return the response to the administrator to the user

from telebot import types import telebot token = 'token' bot = telebot.TeleBot(token) admin_id = 12345678 user_id = None @bot.message_handler(commands=['start']) def start(message): if message.chat.id == admin_id: …
IRF
  • 1
-2
votes
1 answer

@my_bot.message_handler(content_types="text") AttributeError: 'TeleBot' object has no attribute 'message_handler'

if you're facing this problem while you try to create your Telegram Bots. problem: @my_bot.message_handler(content_types="text") AttributeError: 'TeleBot' object has no attribute 'message_handler' Try this solution: 1- open the terminal on your…
MB Dev
  • 1
  • 1
1 2 3
14
15