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

Error code: 400. Description: Bad Request: message to forward not found

When I write 1, the bot should forward a certain file from the channel, but the bot cannot find this very file. import telebot from telebot import types bot = telebot.TeleBot('TOKEN') @bot.message_handler(commands=['start']) def start(message): …
NoneGS
  • 1
0
votes
0 answers

Chatbot on Python Telebot for Telegram

I have a problem with a Python chatbot for Telegram. Here is the principle of operation: The user writes a request to the bot, the bot sends a message to me, I write an answer to it, and the bot responds to the user with my answer. The problem in my…
0
votes
0 answers

file_id of individual media in a Grouped Media in telegram

When a user sends a grouped media (let's say three PDF files grouped together) to a Telegram bot, the Message object corresponding to this grouped Media has only the file_id of the first file, but we can't obtain the file_id of the rest of the…
0
votes
1 answer

How to call the vivod method on button 2 click? Python Telebot

I have a question. I am making a telegram bot that writes debts to a database. But I don't know how to make it possible to call the Vivod method by pressing the 2 button. And I also wanted to immediately ask if my code is at least a little bit…
0
votes
1 answer

No module named 'config' when importing from the same directory in Python project

I'm working on a Python project with the following directory structure: lunarcity/ ├── main.py └── modules/ ├── __init__.py ├── config.py ├── voice.py ├── manager.py └── other_module.py In the main.py file, I have a…
0
votes
0 answers

Python Telegram bot unable to forward photos, stickers, and other media in group chats

I have a Python bot for forwarding messages (formatted text, photos with captions, videos, stickers) to groups where the bot is added. However, I'm experiencing issues with forwarding photos, stickers, and similar content. How can I fix this? import…
S1ngle
  • 13
  • 4
0
votes
1 answer

Python, telebot. How to combine callback query handler and states?

I want to use states inside callback handler block, but supposingly have some problems with retrieving data. Here are no normal traceback. I get only 2023-07-18 14:33:00,497 (async_telebot.py:542 MainThread) ERROR - TeleBot: "__enter__" Spent a lot…
Sharmat
  • 25
  • 6
0
votes
0 answers

how to edit last message sent by my own bot with telebot (python)

how to do in python to make two interval counters like the setTimeout of JS for example in python? because time.sleep() becomes a problem when having two because it will generate a delay I need a counter in trigger_message and another one in…
netryx
  • 11
  • 3
0
votes
1 answer

Administrator status in telebot

English is not my native I wrote bot for group chat. And had issue with giving new status to group member. import telebot from telebot import types @bot.message_handler(commands = ['ban']) def ban(message): …
0
votes
0 answers

Telegram bot forwarding a user's message to a group and sending responses from it?

Good afternoon everyone! Recently I started getting acquainted with writing bots for telegrams, I just can’t figure out how to make the bot redirect the user’s message to a specific group, and from there send all the answers back to the chat. I saw…
0
votes
1 answer

Using custom emoji in bot messages // Telegram [Telebot]

I have any custom emoji pack, and need to use emojies from this pack in bot messages, using Telebot(TelegramBotApi) In fact we need an "html tag" to attach our custom emojis in a message. We didn't find these tags where ever we searched for them.
0
votes
0 answers

Pyrogram accs gots banned after .start()

async def convert(sessionId, isShadow=None, userId=None): if userId: try: if conn.cursor().execute(f'SELECT * FROM users WHERE userId == {userId}').fetchone()[0]: path = f'users\\{userId}\\sessions\\' …
0
votes
0 answers

Sending a message to a certain user with TeleBot in telegram

How should I send a message to a certain member of the robot? I tried with @RawDataBot robot bot it just passes the chat id of two users in telegram and I can't get the message from the robot to forward it to the @RawDataBot robot
Amin
  • 1
  • 1
0
votes
1 answer

telebot missing 1 required positional argument: 'message'

i'm trying to make a telegram bot (telebot) i am having a problem with my code @bot.message_handler(commands=['testes']) def testes(send_photo,message): qr75 = open('qr75.jpg', 'rb') bot.send_photo(send_photo.chat.id, qr75) …
0
votes
0 answers

telegram bot python, commands does not work

I write the code by telegrambotAPI, but when i write in telegram these commands and messages bot do nothing import random import webbrowser import telebot from telebot import types mytoken = 'here is token' bot =…