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

TimeoutError aiogram bot

i have a bot which parses some links given by user. When clients want to parse realy huge amount of links, bot parses them, creates csv file from those links, sends it to user(user can download and view this file) and then raise TimeoutError Cause…
alex-uarent-alex
  • 363
  • 1
  • 10
2
votes
2 answers

How to make the Telegram bot work with animated emojis?

Let me quickly explain the situation. I am an administartor of a Telegram public chat (~800 members) and sometimes users are spamming animated emojis like basketball, football, casino slots and etc. I've decided to write a Telegram bot using Python…
wxnzks
  • 43
  • 6
2
votes
1 answer

how can i make this telegram bot calculator work

i am trying to make this calculator work but it automatically sends a message please provide a valid number when i run the command /multiply any help would be muchly appreciated type here import telebot bot = telebot.TeleBot('my token…
Anooos
  • 23
  • 2
2
votes
0 answers

Implementing commands menu button for a telegram bot using telebot

I've been trying to set the list of commands for my telegram bot but it doesn't work, here's what I'm doing: bot = telebot.TeleBot("TOKEN") bot.set_my_commands(commands = ['start','go','help']) bot.set_chat_menu_button(bot.get_me().id,…
Haidara
  • 21
  • 7
2
votes
0 answers

I can't get a poll results in aiogram

So, How can I can get results in aiogram, Telegram bot. For example, there are 30 quizzes and someone solves these quizzes and at the end bot should send the result: "You solved the question: 30/15". Does anybody know how I can code this?
2
votes
0 answers

How to add new button in cycle to InlineKeyboard in Telebot Golang

I am trying to add new inline button to inlineKeyboard every time when i have new iteration in cycle but i dont khow how to do this if there any solution mb in another code without rows i will be glad selector := &tele.ReplyMarkup{} for…
Fortune
  • 31
  • 2
1
vote
0 answers

make sure that only one bot instance is running error

I deployed telegramm bot on a VPS server. After a while (i think a few hours) it gives error ERROR - TeleBot: "Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 409. Description: Conflict: terminated by other…
1
vote
2 answers

I can't make second msg handler after keyboard button in telegram bot on python telebot

@bot.message_handler(content_types=['text']) def get_text_messages(message): if message.text == "/start": begin = types.InlineKeyboardMarkup() namebutton = types.InlineKeyboardButton(text="Name urself", callback_data="nm") …
sword
  • 11
  • 2
1
vote
0 answers

How do I update telegram bot functions without requiring users to restart with /start command?

How to update the functions of the bot in telegram, for users? The bot is written, running, but if you add buttons or delete something, it will not be displayed until you send the /start command again. How to make it updated for those users who have…
Star DK
  • 11
  • 1
1
vote
1 answer

pytelegrambotapi check bot permissions in groups

I am trying to fix an error where the bot tries to send a message to a chat group but doesn't have administration permissions. I need an if statement like the one below before sending the message to the chat group, however this code is not…
Mohammad
  • 21
  • 6
1
vote
0 answers

Bot can't create tables automatically and user exists (PostgreSQL)

Bot can't create tables automatically and user can't use the start button twice because user exists.. import psycopg2 bot = TeleBot("590----86:AAF9_DU9F_6----rvls26HgJMzHyJJpY") I don't know what I didn't do ! def connect_to_db(): conn =…
1
vote
0 answers

Use webhook instead of infinity_polling()

I am trying to add webhook into my code, following this template PyTelegramBotApi webhook_aiohttp. My problem is that I cannot receive any updates from telegram using ngrok. What should be done in order to use webhook? I use in terminal python -m…
Ian
  • 21
  • 3
1
vote
0 answers

Can't handle pre_checkout_query telegram bot payment api

import telebot from telebot import types @tb.message_handler(commands=['pay']) def pay(message): tb.send_invoice(message.chat.id, title='Test title', description='Test description', invoice_payload='test', provider_token='xxx:TEST:xxx',…
K. Sergey
  • 157
  • 1
  • 8
1
vote
2 answers

How to format text in telegram?

I can't figure out how to format the text in the Telegram bot. The code is the following: import telebot bot = telebot.TeleBot(TOKEN) @bot.message_handler(commands=['start', 'help']) def help(message: telebot.types.Message): text = " Test…
1
vote
1 answer

Restricting users from pressing inline button telebot

I want to create inline button which will be available only for user who entered the command which created associated button For example: @bot.message_handler(commands=['start']) def start(message): markup =…
Nikita
  • 21
  • 1
1
2 3
14 15