mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-25 15:25:01 +03:00
feat(tgbot): rebuild the Telegram bot around editable screens and inline lists (#6760)
The bot answered every action with a new message, so a chat filled with stale menus whose buttons still acted, and long client or inbound lists were paged through dozens of buttons. Each chat now has one live screen that is edited in place: the menu is grouped into Server, Clients, Traffic and Maintenance, lists open through inline search, the add-client flow starts from a draft card, QR codes arrive as one labelled sheet, and repeated notices collapse into one with a counter. A client's /start and /usage show only that client's own links and usage, groups are refused, and the settings page warns when the bot's inline mode is off. Admin topics, the indexed Telegram lookup and every locale, Slovak included, carry over.
This commit is contained in:
@@ -48,6 +48,10 @@ _openapi:
|
||||
title: Test Telegram bot connection by sending a test message to the configured
|
||||
chat.
|
||||
url: '#test-telegram-bot-connection-by-sending-a-test-message-to-the-configured-chat'
|
||||
- depth: 2
|
||||
title: Report what the configured bot can do. Inline mode is a BotFather switch,
|
||||
so the panel warns when it is off.
|
||||
url: '#report-what-the-configured-bot-can-do-inline-mode-is-a-botfather-switch-so-the-panel-warns-when-it-is-off'
|
||||
- depth: 2
|
||||
title: Test Discord bot connection by sending a test embed to the configured
|
||||
channel.
|
||||
@@ -90,6 +94,9 @@ _openapi:
|
||||
- content: Test Telegram bot connection by sending a test message to the
|
||||
configured chat.
|
||||
id: test-telegram-bot-connection-by-sending-a-test-message-to-the-configured-chat
|
||||
- content: Report what the configured bot can do. Inline mode is a BotFather
|
||||
switch, so the panel warns when it is off.
|
||||
id: report-what-the-configured-bot-can-do-inline-mode-is-a-botfather-switch-so-the-panel-warns-when-it-is-off
|
||||
- content: Test Discord bot connection by sending a test embed to the configured
|
||||
channel.
|
||||
id: test-discord-bot-connection-by-sending-a-test-embed-to-the-configured-channel
|
||||
@@ -106,7 +113,7 @@ export default function Layout(props) {
|
||||
return (
|
||||
<>
|
||||
{props.children}
|
||||
<OpenAPIPage document="./public/openapi.json" webhooks={[]} operations={[{"path":"/panel/api/setting/all","method":"post"},{"path":"/panel/api/setting/defaultSettings","method":"post"},{"path":"/panel/api/setting/factoryDefaults","method":"post"},{"path":"/panel/api/setting/update","method":"post"},{"path":"/panel/api/setting/validateRegex","method":"post"},{"path":"/panel/api/setting/updateUser","method":"post"},{"path":"/panel/api/setting/restartPanel","method":"post"},{"path":"/panel/api/setting/testSmtp","method":"post"},{"path":"/panel/api/setting/testTgBot","method":"post"},{"path":"/panel/api/setting/testDiscord","method":"post"},{"path":"/panel/api/setting/getDefaultJsonConfig","method":"get"}]} showTitle />
|
||||
<OpenAPIPage document="./public/openapi.json" webhooks={[]} operations={[{"path":"/panel/api/setting/all","method":"post"},{"path":"/panel/api/setting/defaultSettings","method":"post"},{"path":"/panel/api/setting/factoryDefaults","method":"post"},{"path":"/panel/api/setting/update","method":"post"},{"path":"/panel/api/setting/validateRegex","method":"post"},{"path":"/panel/api/setting/updateUser","method":"post"},{"path":"/panel/api/setting/restartPanel","method":"post"},{"path":"/panel/api/setting/testSmtp","method":"post"},{"path":"/panel/api/setting/testTgBot","method":"post"},{"path":"/panel/api/setting/tgBotCapabilities","method":"post"},{"path":"/panel/api/setting/testDiscord","method":"post"},{"path":"/panel/api/setting/getDefaultJsonConfig","method":"get"}]} showTitle />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -4727,6 +4727,35 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"TgBotCapabilities": {
|
||||
"description": "TgBotCapabilities is the browser-safe shape of the bot's own capabilities.",
|
||||
"properties": {
|
||||
"groupPrivacy": {
|
||||
"description": "GroupPrivacy off means the bot reads every group message; when it is on,\na bare /start in a group is invisible to the bot.",
|
||||
"example": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"inlineEnabled": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"running": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"username": {
|
||||
"example": "xui_bot",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"groupPrivacy",
|
||||
"inlineEnabled",
|
||||
"running",
|
||||
"username"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"Traffic": {
|
||||
"description": "Traffic represents network traffic statistics for Xray connections.\nIt tracks upload and download bytes for inbound or outbound traffic.",
|
||||
"properties": {
|
||||
@@ -13360,6 +13389,47 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/panel/api/setting/tgBotCapabilities": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"Settings"
|
||||
],
|
||||
"summary": "Report what the configured bot can do. Inline mode is a BotFather switch, so the panel warns when it is off.",
|
||||
"operationId": "post_panel_api_setting_tgBotCapabilities",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Successful response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {
|
||||
"$ref": "#/components/schemas/TgBotCapabilities"
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"obj": {
|
||||
"groupPrivacy": false,
|
||||
"inlineEnabled": true,
|
||||
"running": true,
|
||||
"username": "xui_bot"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/panel/api/setting/testDiscord": {
|
||||
"post": {
|
||||
"tags": [
|
||||
|
||||
Reference in New Issue
Block a user