seven před 3 dny
rodič
revize
e92f31376f
1 změnil soubory, kde provedl 27 přidání a 0 odebrání
  1. 27 0
      app/Http/Controllers/api/TelegramWebHook.php

+ 27 - 0
app/Http/Controllers/api/TelegramWebHook.php

@@ -102,6 +102,33 @@ class TelegramWebHook extends Controller
                     BetService::alertNotice($callbackId , $alertText);
                 }
 
+                                //点击充值按钮
+                if ($data === 'topup@@topup') {
+                    $telegram->deleteMessage([
+                        'chat_id' => $chatId,
+                        'message_id' => $messageId,
+                    ]);
+                    $topService = new TopUpService();
+                    $res = $topService->scan($chatId, $messageId);
+                    $telegram->sendPhoto($res);
+                }
+
+                //点击充值的账单按钮
+                if ($data === 'topup@@bill') {
+                    $res = (new TopUpService())->bill($chatId, $firstName, $messageId);
+                    $telegram->editMessageText($res);
+
+
+//                    $text = "📅 请输入查询日期\n";
+//                    $date = date('Y-m-d');
+//                    $text .= "例如您要查询的日期 {$date}\n";
+//                    $text .= "那么请发送:【充值账单】{$date}\n";
+//                    $telegram->sendMessage([
+//                        'chat_id' => $chatId,
+//                        'text' => $text
+//                    ]);
+                }
+
                 //近期注单,下一页
                 $pattern = "/^betRecordNextPage@@\d+$/";
                 if (preg_match($pattern, $data)) {