|
@@ -378,7 +378,7 @@ class Config extends Controller
|
|
|
$msg = [];
|
|
$msg = [];
|
|
|
$msg['chat_id'] = "@{$config['chatId']}";
|
|
$msg['chat_id'] = "@{$config['chatId']}";
|
|
|
$msg['protect_content'] = false;
|
|
$msg['protect_content'] = false;
|
|
|
- if (in_array($type, ['image', 'text']) && !empty($config['button'])) {
|
|
|
|
|
|
|
+ if (!empty($config['button'])) {
|
|
|
$msg['reply_markup'] = json_encode(['inline_keyboard' => $config['button']]);
|
|
$msg['reply_markup'] = json_encode(['inline_keyboard' => $config['button']]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -406,7 +406,7 @@ class Config extends Controller
|
|
|
$telegram->pinChatMessage(['chat_id' => "@{$config['chatId']}", 'message_id' => $messageId]);
|
|
$telegram->pinChatMessage(['chat_id' => "@{$config['chatId']}", 'message_id' => $messageId]);
|
|
|
}
|
|
}
|
|
|
} catch (TelegramSDKException $e) {
|
|
} catch (TelegramSDKException $e) {
|
|
|
- return $this->error(HttpStatus::CUSTOM_ERROR, '保存成功,发送失败',$e->getMessage());
|
|
|
|
|
|
|
+ return $this->error(HttpStatus::CUSTOM_ERROR, '保存成功,发送失败', $e->getMessage());
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
return $this->error($e->getCode(), '保存成功,发送失败');
|
|
return $this->error($e->getCode(), '保存成功,发送失败');
|
|
|
}
|
|
}
|