|
|
@@ -106,17 +106,27 @@ class TelegramWebHook extends Controller
|
|
|
BetService::alertNotice($callbackId, $alertText);
|
|
|
}
|
|
|
|
|
|
- //点击充值按钮
|
|
|
- if ($data === 'topup@@topup') {
|
|
|
+ //选择充值地址
|
|
|
+ if ($data === "topup@@TRC20" || $data === "topup@@ERC20") {
|
|
|
+ $type = preg_replace('/^topup@@/', '', $data);
|
|
|
+ $topService = new TopUpService();
|
|
|
+ $res = $topService->scan($chatId, $messageId);
|
|
|
+
|
|
|
+
|
|
|
$telegram->deleteMessage([
|
|
|
'chat_id' => $chatId,
|
|
|
'message_id' => $messageId,
|
|
|
]);
|
|
|
- $topService = new TopUpService();
|
|
|
- $res = $topService->scan($chatId, $messageId);
|
|
|
$telegram->sendPhoto($res);
|
|
|
}
|
|
|
|
|
|
+ //点击充值按钮
|
|
|
+ if ($data === 'topup@@topup') {
|
|
|
+
|
|
|
+ $res = TopUpService::chooseAddress($chatId, $messageId);
|
|
|
+ $telegram->editMessageText($res);
|
|
|
+ }
|
|
|
+
|
|
|
//点击充值的账单按钮
|
|
|
if ($data === 'topup@@bill') {
|
|
|
$res = (new TopUpService())->bill($chatId, $firstName, $messageId);
|
|
|
@@ -156,15 +166,22 @@ class TelegramWebHook extends Controller
|
|
|
|
|
|
//充值首页
|
|
|
if ($data === "topUp@@home" || $data === "topUp@@home1") {
|
|
|
- // $res = (new TopUpService())->index($chatId, $firstName, $messageId);
|
|
|
- $telegram->deleteMessage([
|
|
|
- 'chat_id' => $chatId,
|
|
|
- 'message_id' => $messageId
|
|
|
- ]);
|
|
|
$returnMsg = WalletService::getBalance($chatId);
|
|
|
if ($returnMsg) {
|
|
|
- $this->telegram->sendMessage($returnMsg);
|
|
|
+ if ($data === "topUp@@home1") {
|
|
|
+ $telegram->deleteMessage([
|
|
|
+ 'chat_id' => $chatId,
|
|
|
+ 'message_id' => $messageId
|
|
|
+ ]);
|
|
|
+ $this->telegram->sendMessage($returnMsg);
|
|
|
+ } else {
|
|
|
+ $returnMsg['message_id'] = $messageId;
|
|
|
+ $telegram->editMessageText($returnMsg);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ // $res = (new TopUpService())->index($chatId, $firstName, $messageId);
|
|
|
// if ($data === "topUp@@home1") {
|
|
|
// $telegram->deleteMessage([
|
|
|
// 'chat_id' => $chatId,
|
|
|
@@ -353,12 +370,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 +583,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 +636,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));
|
|
|
|
|
|
}
|
|
|
|