Ken 2 долоо хоног өмнө
parent
commit
62e0609e29

+ 49 - 0
app/Services/SecretService.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Services;
+
+use Telegram\Bot\Api;
+use Telegram\Bot\Exceptions\TelegramSDKException;
+
+class SecretService
+{
+    /**
+     * @param Api $telegram
+     * @param $data
+     * @param $chatId
+     * @param $firstName
+     * @param $messageId
+     * @throws TelegramSDKException
+     */
+    public static function init(Api $telegram, $data, $chatId, $firstName, $messageId): void
+    {
+        if ($data === "secret@@index") {
+            $res = SecretService::index($chatId, $messageId);
+            $telegram->editMessageText($res);
+        }
+    }
+
+    private static function index($chatId, $messageId): array
+    {
+        $keyboard = [
+            [
+                ['text' => '查看秘钥', 'callback_data' => 'secret@@view'],
+                ['text' => '找回账号', 'callback_data' => 'secret@@retrieve'],
+            ],
+
+            [
+                ['text' => '返回', 'callback_data' => 'topUp@@home'],
+            ]
+        ];
+
+        $text = "秘钥管理\n";
+        $text .= "请选择业务类型";
+
+        return [
+            'chat_id' => $chatId,
+            'text' => $text,
+            'message_id' => $messageId,
+            'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
+        ];
+    }
+}

+ 3 - 0
app/Services/WalletService.php

@@ -252,6 +252,9 @@ class WalletService extends BaseService
                 ['text' => '➕ 提现', 'callback_data' => "withdraw@@qb_show_channel"],
                 ['text' => '🧾 提现账单', 'callback_data' => "withdraw@@bill"]
             ],
+            [
+                ['text'=>'秘钥管理','callback_data'=>'secret@@index'],
+            ],
 
 
         ];