The txAdmin panel comes with many features for your FiveM game server, including a Discord bot integration. In this guide, we'll show you how to set up and use the Discord bot.
To set up the Discord bot for your txAdmin server, you first need to log in to your txAdmin panel. You can find the login details on your server's overview page, as shown here:
This guide assumes that txAdmin is already set up. For instructions, see our FiveM: txAdmin Setup guide.
To connect the bot to txAdmin, you need to create a Discord application. Your bot will be assigned to this application and act under its name. To create an application, open the Discord Developer Portal.
Now create a new application by clicking New Application and entering a name, as shown below:
Then create the application by clicking Create. Make a note of the Application ID for the next steps:
A bot is created automatically when you create the application. You can get the token by clicking Reset Token. You'll then receive a user token, which you should also make a note of:
Never share the bot token. This helps keep your bot running smoothly and prevents security vulnerabilities. The token is like a secret key and must not be shared.
On the same page, scroll down and enable the "Server Members Intent" option, then save your changes:
To invite the bot, enter the Client ID you noted earlier in the appropriate place in the link below. Then open the link in your browser and add the bot to your Discord server. The link should look like this:
https://discordapp.com/oauth2/authorize?&client_id=1364549558197026816&scope=bot&permissions=18432
For the bot to work properly with txAdmin, you need the ID of the server where the bot should be active. To find it, right-click the server icon in Discord and select Copy Server ID. Make a note of this ID.
Here's an example:
You can also choose a channel where status updates, such as restart schedules, will be posted. Copy the channel ID in the same way. Make sure the bot has permission to read and send messages in that channel.
If you don't see the option to copy the server or channel ID, first enable Developer Mode in your Discord user settings:
You can now enable the Discord bot in txAdmin and enter all the IDs and tokens you noted earlier:
You can optionally send a one-time status message that continually updates with the current server status, player count, and more.
To do this, go to the desired Discord channel and enter /status add. Make sure the bot has permission to send messages in that channel.
This should create a message like this:
You can customize everything in this message on the Discord settings page in txAdmin.
