当我使用sendMessage()方法在聊天时发送消息当我在组中使用电报机器人时自动回复最后一条消息 我怎么能解决这个问题?
[在此处输入图像说明] [1]
function Start($obj_tblTemp, $Token) {
$Keyboard = array(
'keyboard' => array(
array(INSERT_EXPENSE, DELETE_EXPENSE),
array(EXPENSE_SITUATION, RULES_AND_HELP),
array(CANCEL)
)
);
$Key_board = json_encode($Keyboard);
$url = 'https://api.telegram.org/bot' . $Token . '/sendMessage?text='. $obj_tblTemp->get_message() . '&chat_id=' . $obj_tblTemp->get_chat_Id() . '&reply_markup=' . $Key_board;
file_get_contents($url);
}
以上问题还存在以下问题:
function InsertExpenseMode($obj_tblTemp, $Token, $con, $obj_tblTempLatestSession) {
if ($obj_tblTemp->get_message() == INSERT_EXPENSE) {
$url = 'https://api.telegram.org/bot' . $Token . '/sendMessage?text='
. INSERT_EXPENSE_INSTRUCTION . '&chat_id=' . $obj_tblTemp->get_chat_Id();
file_get_contents($url);
} else {
if (is_numeric($obj_tblTemp->get_message()) && $obj_tblTemp->get_message() > 0) {
$url = 'https://api.telegram.org/bot' . $Token . '/sendMessage?text='
. $obj_tblTemp->get_message() . '&chat_id=' . $obj_tblTemp->get_chat_Id();
file_get_contents($url);
} else {
$url = 'https://api.telegram.org/bot' . $Token . '/sendMessage?text='
. NUMERAL_FAIL . '&chat_id=' . $obj_tblTemp->get_chat_Id();
file_get_contents($url);
}
}
}
实际上我将类对象发送到这些函数并想要评估用户输入然后将它们插入到数据库中,但是开发还没有完成。