当我点击频道上的“喜欢”时,下面的代码没有检测到任何内容。我不知道我的代码有什么问题。
# pyTelegramBotAPI Version 4.14.1
import telebot
from telebot import apihelper
from telebot import types
from telebot import util
from telebot.types import ChatMemberUpdated
from telebot.util import update_types
......
@bot.callback_query_handler(func=lambda call: True)
def handle_callback_query(call):
print(call)
if call.data == "like":
print("user likes!!!")
.....
# in main function:
bot.infinity_polling(allowed_updates=update_types)
目前 Telegram 机器人无法看到对消息的反应,telegram 只是不提供此数据,您可以尝试使用内联或键盘按钮。