Ken 2 天之前
父節點
當前提交
a27308efa1
共有 1 個文件被更改,包括 16 次插入16 次删除
  1. 16 16
      app/Services/KeyboardService.php

+ 16 - 16
app/Services/KeyboardService.php

@@ -245,22 +245,22 @@ class KeyboardService extends BaseService
             $keyboard = [];
             if ($keyboardText['buttons']) {
                 $keyboard = json_decode($keyboardText['buttons'], true);
-//                $newKeyboard = [];
-//                foreach ($keyboard as $item) {
-//                    $t = [];
-//                    foreach ($item as $item1) {
-//                        if(static::isValidURL($item1['url'])){
-//                            $t[] = $item1;
-//                        }else{
-//                            $t[] = [
-//                                'text' => $item1['text'],
-//                                'callback_data' => $item1['url']
-//                            ];
-//                        }
-//                    }
-//                    if (!empty($t)) $newKeyboard[] = $t;
-//                }
-//                $keyboard = $newKeyboard;
+                $newKeyboard = [];
+                foreach ($keyboard as $item) {
+                    $t = [];
+                    foreach ($item as $item1) {
+                        if(static::isValidURL($item1['url'])){
+                            $t[] = $item1;
+                        }else{
+                            $t[] = [
+                                'text' => $item1['text'],
+                                'callback_data' => $item1['url']
+                            ];
+                        }
+                    }
+                    if (!empty($t)) $newKeyboard[] = $t;
+                }
+                $keyboard = $newKeyboard;
             }
             Util::delCache($chatId);
             $res = [