Xray-DiscordBot
is a Discord bot designed to interact with the Xray Core, allowing you to monitor the online status of users and manage user details directly from your Discord server.
It integrates with the Xray-SaveLog
project to provide real-time statistics and user management features.
- User Online Status: Check the online status of users connected to your Xray Core. ( Assign In Channel And Update ).
- Add Clients: Use the
/addclient
command to add new users to your Xray Core. - User Statistics: Retrieve detailed statistics about users with the
/userstats
command.
Before using this project, you need to set up the Xray-SaveLog project.
-
Clone this repository to your local machine:
git clone https://github.com/AidinShekari/Xray-DiscordBot.git cd Xray-DiscordBot
-
Install the required dependencies:
npm install
-
Configure the bot by editing the
config.json
file:{ "token": "Discord-Bot-Token", "guildId": "guildID", "channelId": "channelID", "apiUrl": "http://localhost:port", "destination": "paneldest", "messageId": "", "vpndbPath": "/root/vpndb.json", "username": "", "password": "" }
token
: Your Discord bot token.guildId
: The ID of the Discord server where the bot will operate.channelId
: The ID of the Discord channel where the bot will post updates.apiUrl
: The URL of your 3x-ui dashboard.destination
: The panel destination (customize as per your setup).messageId
: Leave this blank or use it to specify a message ID for persistent bot messages.vpndbPath
: The path to yourvpndb.json
file.username
andpassword
: Credentials for authenticating with your 3x-ui dashboard.
Once the bot is up and running, you can interact with it using the following commands in your Discord server:
/addclient
: Add a new client to the Xray Core./userstats
: Get detailed statistics for a specific user.