seven vor 4 Tagen
Ursprung
Commit
a18b6107ea
1 geänderte Dateien mit 69 neuen und 4 gelöschten Zeilen
  1. 69 4
      app/Http/Controllers/api/TelegramWebHook.php

+ 69 - 4
app/Http/Controllers/api/TelegramWebHook.php

@@ -73,7 +73,24 @@ class TelegramWebHook extends Controller
 
                     $this->processChatMessage($chatId, $messageId, $message, $message['from']);
 
-                } catch (\Exception $e) {
+                } 
+                 catch (MessageException $e) {
+                    DB::rollBack();
+                    $msg = $e->getMessage();
+                    $msg = json_decode($msg, true);
+                    $telegram->sendMessage($msg);
+                } //
+                catch (TelegramSDKException $e) {
+                    DB::rollBack();
+                    $m = new Message();
+                    $m->json = $e->getMessage();
+                    $m->save();
+                    $telegram->sendMessage([
+                        'chat_id' => $chatId,
+                        'text' => '‼️‼️系统发生了错误,请联系客服'
+                    ]);
+                }//
+                catch (\Exception $e) {
                     DB::rollBack();
                     $m = new Message();
                     $m->json = json_encode([
@@ -81,6 +98,10 @@ class TelegramWebHook extends Controller
                         'message' => $e->getMessage()
                     ]);
                     $m->save();
+                    $telegram->sendMessage([
+                        'chat_id' => $chatId,
+                        'text' => '‼️‼️系统发生了错误,请联系客服'
+                    ]);
                 }
             }
 
@@ -136,12 +157,56 @@ class TelegramWebHook extends Controller
                         $username = config('services.telegram.username');
                         $this->setReplyKeyboard($chatId);
                         break;
-                    case "/tutorial":
+                    case "近期注单":
+                        Util::delCache($chatId);
+                        $this->telegram->sendMessage([
+                            'chat_id' => $chatId,
+                            'text' => $text
+                        ]);
+                        break;
+                    case "今日流水":
+                        Util::delCache($chatId);
+                        $this->telegram->sendMessage([
+                            'chat_id' => $chatId,
+                            'text' => $text
+                        ]);
+                        break;
+                    case "联系客服":
+                        Util::delCache($chatId);
+                        $this->telegram->sendMessage([
+                            'chat_id' => $chatId,
+                            'text' => $text
+                        ]);
+                        break;
+                    case "开奖历史":
                         Util::delCache($chatId);
-                        
+                        $this->telegram->sendMessage([
+                            'chat_id' => $chatId,
+                            'text' => $text
+                        ]);
+                        break;
+                    case "当期下注":
+                        Util::delCache($chatId);
+                        $this->telegram->sendMessage([
+                            'chat_id' => $chatId,
+                            'text' => $text
+                        ]);
+                        break;
+                    case "查看余额":
+                        Util::delCache($chatId);
+                        $this->telegram->sendMessage([
+                            'chat_id' => $chatId,
+                            'text' => $text
+                        ]);
+                        break;
+                    case "投注大群":
+                        Util::delCache($chatId);
+                        $this->telegram->sendMessage([
+                            'chat_id' => $chatId,
+                            'text' => $text
+                        ]);
                         break;
                     default:
-                        //输入结算分数
                         $this->telegram->sendMessage([
                             'chat_id' => $chatId,
                             'text' => '‼️‼️未知命令,请点击下方菜单按钮选择功能'