v3

Sanaei
2026-06-03 00:48:59 +02:00
parent 17bb993740
commit fb5eaed98f

@@ -2,55 +2,62 @@
#### Usage
The web panel supports daily traffic, panel login, database backup, system status, client info, and other notification and functions through the Telegram Bot.
The web panel supports daily traffic, panel login, database backup, system status, client info, and other notifications and functions through a Telegram Bot.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/MHSanaei/3x-ui/raw/main/media/07-bot-dark.png">
<img alt="3x-ui" src="https://github.com/MHSanaei/3x-ui/raw/main/media/07-bot-light.png">
</picture>
To use the bot, you need to set the bot-related parameters in the panel, including:
To use the bot, set the bot-related parameters in the panel (`Panel Settings → Telegram Bot`), including:
- Telegram Token
- Admin Chat ID(s)
- Notification Time (in cron syntax)
- Expiration Date Notification
- Traffic Cap Notification
- Database Backup
- CPU Load Notification
- **Telegram Bot Token** — the token from BotFather
- **Admin Chat ID(s)** — one or more Telegram user IDs that act as bot admins (comma-separated)
- **Notification Time** — when periodic reports are sent, in cron syntax
- **Login Notification** — alert on panel logins
- **CPU Load Threshold (%)** — alert when CPU usage exceeds this value
- **Database Backup** — send a database backup with the periodic report
- **Bot Language** — the language the bot replies in
- **Bot Proxy** *(optional)* — route the bot's connection through a SOCKS5 proxy (useful where Telegram is blocked)
- **Custom Bot API Server** *(optional)* — use a self-hosted Telegram Bot API server instead of `api.telegram.org`
Periodic reports also warn ahead of time about clients nearing their **expiration date** or **traffic cap**.
**Reference syntax:**
**Reference syntax (cron):**
- `@every 10s` - Notify every 10 seconds
- `@every 10m` - Notify every 10 minutes
- `@every 8h` - Notify every 8 hours
- `@daily` - Daily notification (00:00 in the morning)
- `@weekly` - weekly notification
- `@every 10s` — notify every 10 seconds
- `@every 10m` — notify every 10 minutes
- `@every 8h` — notify every 8 hours
- `@hourly` — hourly notification
- `@daily` — daily notification (00:00)
- `@weekly` — weekly notification
- `@monthly` — monthly notification
Standard cron expressions are supported as well.
### Telegram Bot Features
- Report periodic
- Periodic reports
- Login notification
- CPU threshold notification
- Threshold for Expiration time and Traffic to report in advance
- Support client report menu if client's telegram username added to the user's configurations
- Support telegram traffic report searched with UUID (VMESS/VLESS) or Password (TROJAN) - anonymously
- Advance warnings for expiration time and traffic thresholds
- Client report menu when the client's Telegram username is added to their config
- Anonymous traffic lookup by UUID (VMESS/VLESS) or Password (Trojan)
- Menu-based bot
- Search client by email (only admin)
- Search client by email (admin only)
- Check all inbounds
- Check server status
- Check depleted users
- Receive backup by request and in periodic reports
- Receive backups on request and in periodic reports
- Multi-language bot
### Setting up Telegram bot
### Setting up the Telegram bot
- Start [Botfather](https://t.me/BotFather) in your Telegram account:
- Start [BotFather](https://t.me/BotFather) in your Telegram account:
![Botfather](https://github.com/MHSanaei/3x-ui/raw/main/media/botfather.png)
- Create a new Bot using /newbot command: It will ask you 2 questions, A name and a username for your bot. Note that the username has to end with the word "bot".
- Create a new bot using the `/newbot` command. It will ask you 2 questions: a name and a username for your bot. Note that the username has to end with the word "bot".
![Create new bot](https://github.com/MHSanaei/3x-ui/raw/main/media/newbot.png)
@@ -58,16 +65,16 @@ To use the bot, you need to set the bot-related parameters in the panel, includi
![token](https://github.com/MHSanaei/3x-ui/raw/main/media/token.png)
- Enter your panel and config Telegram bot settings like below:
- Enter your panel and configure the Telegram bot settings as below:
![Panel Config](https://github.com/MHSanaei/3x-ui/raw/main/media/panel-bot-config.png)
Enter your bot token in input field number 3.
Enter the user ID in input field number 4. The Telegram accounts with this id will be the bot admin. (You can enter more than one, Just separate them with ,)
Enter the user ID in input field number 4. The Telegram accounts with this ID will be the bot admins. (You can enter more than one, just separate them with `,`)
#### How to get Telegram user ID?
Use this [bot](https://t.me/useridinfobot), Start the bot and it will give you the Telegram user ID.
#### How to get your Telegram user ID?
Use this [bot](https://t.me/useridinfobot). Start the bot and it will give you your Telegram user ID.
![User ID](https://github.com/MHSanaei/3x-ui/raw/main/media/user-id.png)
@@ -75,28 +82,28 @@ Use this [bot](https://t.me/useridinfobot), Start the bot and it will give you t
### What is it?
Cloudflare WARP is a free service developed by Cloudflare that enhances internet security and performance by masking traffic between your server and the internet. WARP is required for the following cases:
Cloudflare WARP is a free service developed by Cloudflare that enhances internet security and performance by masking traffic between your server and the internet. WARP is useful in the following cases:
- When you need to hide the IP address of a server.
- When some services do not open.
### Setup
1. Open the panel and go to `Xray Setting`.
2. Open `Outbounds` tab, click `WARP` and `Create` button.
1. Open the panel and go to `Xray Configs`.
2. Open the `Outbounds` tab, click `WARP`, then the `Create` button.
![image](https://github.com/user-attachments/assets/6fdeee5a-f0f4-424b-99e5-68c29bc01611)
We have created a WARP profile, but not set `WARP` outbound. To create an outbound to which we will redirect traffic, click `Add outbound` and close the dialog box
We have created a WARP profile, but not yet set a `WARP` outbound. To create an outbound to redirect traffic to, click `Add outbound` and close the dialog box.
### Redirect trafic to WARP
### Redirect traffic to WARP
1. Open the panel and go to `Xray Setting`.
1. Open the panel and go to `Xray Configs`.
2. Open `Routing Rules` and click `Add Rule`.
3. Add the following rule
3. Add the following rule:
![image](https://github.com/user-attachments/assets/3570af28-d958-449d-bf0b-0122ece82851)
In this rule, we redirect all traffic from Reddit and Google (and all its services) to WARP outbound
In this rule, we redirect all traffic from Reddit and Google (and all its services) to the WARP outbound.
## Setting TOR proxy
@@ -107,22 +114,22 @@ Tor, short for The Onion Router, is a free and open-source software designed to
### Setup
> [!TIP]
> Before you start, make sure you have Docker installed. If it is not installed, see [here](https://github.com/MHSanaei/3x-ui/wiki/Installation#docker-recommended) for the installation script
> Before you start, make sure you have Docker installed. If it is not installed, see [here](https://github.com/MHSanaei/3x-ui/wiki/Installation#docker) for the installation script.
1. Open terminal and run this command
1. Open a terminal and run this command:
```bash
docker run --restart unless-stopped -i -t -p 9050:9050 dperson/torproxy
```
This will start a SOCKS5 proxy with TOR, now it needs to be configured in the panel
This will start a SOCKS5 proxy with TOR; now it needs to be configured in the panel.
2. Go to panel and open `Xray Settings`
3. Go to `Outbound` tab and click `Add Outbound`
4. Fill out the form as follows and click `Add Outbound`
2. Go to the panel and open `Xray Configs`.
3. Go to the `Outbounds` tab and click `Add Outbound`.
4. Fill out the form as follows and click `Add Outbound`:
![Outbound Modal](https://github.com/user-attachments/assets/ef36ec1c-ee6c-4661-85a4-a66835ccc4a7)
### Redirect traffic
Same [thing](https://github.com/MHSanaei/3x-ui/wiki/Advanced#redirect-trafic-to-warp) as with WARP, but instead of `warp` outbound, we use `tor`.
Same [thing](https://github.com/MHSanaei/3x-ui/wiki/Advanced#redirect-traffic-to-warp) as with WARP, but instead of the `warp` outbound, we use `tor`.