eternnoir / pyTelegramBotAPI

Python Telegram bot api.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how do i respond to messages from business_message_handler?

MatLumin opened this issue · comments

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using?
    4.17.0
  2. What OS are you using?
    ubuntu
  3. What version of python are you using?
    3.11.9

assume i have a code like this

@bot.business_message_handler(func=lambda m:m.text=="say meow")
def say_mewo(msg):
	bot.send_message(msg.chat.id, "meow");

i expect it to respond to incoming messages inside the chat its connected to by "business connection"
like this
20240508_085512
but instead ;
it responds in its own chat with user;

how do i make it respond in business connected chat?

some extra notes:
+bot is has business mode support enabled
+the account which bot is connected to has premium subscription
+bot has the can_reply permission

Try to get business_connection_id from Message and use it in business_connection_id of send_message...