0
#!/usr/bin/env python3
#-*- encoding: utf-8 -*-

from apikey import tgbottoken,authedchat
from telebot import types
import telebot,logging

bot =telebot.TeleBot(tgbottoken)
telebot.logger.setLevel(logging.DEBUG)


def extract_arg(arg):
    return arg.split()[1:]

@bot.message_handler(commands=['newmail'])
def mailwithsg(msg):
    cid = msg.chat.id
    sendto = types.ForceReply(selective=False)
    bot.send_message(cid, "Send me another word:", reply_markup=sendto)

bot.polling(none_stop=True)

after I use the methods and send a reply markup message, how should I get user's reply text (like user feedback)? which method should I use?

I now use pyTelegramBotAPI as a Python Wrapper.

4

2 回答 2

0

它会回复一条正常的消息。

只有内联键盘应该使用 CallBackQuery 来处理它。

因此,只需使用 message_id 来识别所有消息并执行您想要的操作。

于 2018-02-08T16:24:25.590 回答
0

使用我的 php 方法——我认为你可以将它翻译成 python;

switch($reply_to_message_text)
   case 'Send me another word:':
        $usersreply =  $message ;
        $this->db->addfeedback($user_id,$usersreply)

     --------->here you can send some text to user and say Thanks)
于 2020-02-14T19:09:00.557 回答