|
@@ -99,6 +99,18 @@ class Home extends Controller
|
|
return $this->success();
|
|
return $this->success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function setMenuButton()
|
|
|
|
+ {
|
|
|
|
+ try {
|
|
|
|
+ $telegram = new Api(config('services.telegram.token'));
|
|
|
|
+ $res = $telegram->setMenuButton(['text' => '菜单', 'web_app' => ['url' => url('/api/onMessage')]]);
|
|
|
|
+ } catch (TelegramSDKException $e) {
|
|
|
|
+ return $this->error($e->getCode(), $e->getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $this->success($res);
|
|
|
|
+ }
|
|
|
|
+
|
|
public function getUpdates()
|
|
public function getUpdates()
|
|
{
|
|
{
|
|
try {
|
|
try {
|