|
|
@@ -106,15 +106,22 @@ class TelegramWebHook extends Controller
|
|
|
BetService::alertNotice($callbackId, $alertText);
|
|
|
}
|
|
|
|
|
|
+ //选择充值地址
|
|
|
+ if ($data === "topup@@TRC20" || $data === "topup@@ERC20") {
|
|
|
+ $type = preg_replace('/^topup@@/', '', $data);
|
|
|
+ $topService = new TopUpService();
|
|
|
+ $res = $topService->scan($chatId, $messageId);
|
|
|
+ $telegram->sendPhoto($res);
|
|
|
+ }
|
|
|
+
|
|
|
//点击充值按钮
|
|
|
if ($data === 'topup@@topup') {
|
|
|
$telegram->deleteMessage([
|
|
|
'chat_id' => $chatId,
|
|
|
'message_id' => $messageId,
|
|
|
]);
|
|
|
- $topService = new TopUpService();
|
|
|
- $res = $topService->scan($chatId, $messageId);
|
|
|
- $telegram->sendPhoto($res);
|
|
|
+ $res = TopUpService::chooseAddress($chatId, $messageId);
|
|
|
+ $telegram->editMessageText($res);
|
|
|
}
|
|
|
|
|
|
//点击充值的账单按钮
|
|
|
@@ -353,12 +360,12 @@ class TelegramWebHook extends Controller
|
|
|
|
|
|
$returnMsg = $this->processChatMessage($chatId, $messageId, $message, $message['from']);
|
|
|
if ($returnMsg) {
|
|
|
- if(isset($returnMsg['photo']) && $returnMsg['photo'] != ''){
|
|
|
+ if (isset($returnMsg['photo']) && $returnMsg['photo'] != '') {
|
|
|
$this->telegram->sendPhoto($returnMsg);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$this->telegram->sendMessage($returnMsg);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
DB::commit();
|
|
|
} catch (MessageException $e) {
|
|
|
@@ -566,13 +573,13 @@ class TelegramWebHook extends Controller
|
|
|
unset($res['text']);
|
|
|
$res['caption'] = $text;
|
|
|
$res['protect_content'] = true; // 防止转发
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return $res;
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$stepStatus = Cache::get(get_step_key($chatId), -1);
|
|
|
$stepStatus = intval($stepStatus);
|
|
|
switch ($stepStatus) {
|
|
|
@@ -619,20 +626,20 @@ class TelegramWebHook extends Controller
|
|
|
['投注大群']
|
|
|
];
|
|
|
|
|
|
- if($replyInfo && $replyInfo->buttons){
|
|
|
+ if ($replyInfo && $replyInfo->buttons) {
|
|
|
$keyboard = [];
|
|
|
$buttons = json_decode($replyInfo->buttons, true);
|
|
|
|
|
|
foreach ($buttons as $rowIndex => $row) {
|
|
|
- if(!empty($row)){
|
|
|
+ if (!empty($row)) {
|
|
|
foreach ($row as $buttonIndex => $button) {
|
|
|
$keyboard[$rowIndex][$buttonIndex] = $button['text'];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
$keyboard = array_values($keyboard); // 重新索引数组
|
|
|
- Log::error('自定义开始使用按钮: '.json_encode($keyboard));
|
|
|
+ Log::error('自定义开始使用按钮: ' . json_encode($keyboard));
|
|
|
|
|
|
}
|
|
|
|