Slash commands (commands with descriptions, easily undastandable for everyone!)
Discord embed message for better design and readability
As a community manager it is always pain in the neck to verify if the user has purchased the product or not. Even though Tebex has a built-in discord integration that allows Tebex Bot to give customers predetermined roles upon purchases, there are few downsides:
Customers need to join discord before the purchase to be assined the role when purchasing
For those who joined the discord after the purchase, they manually need to /claim to claim the role.
To solve this, I introduce Tebex verification bot for Discord!
List of commands
/verify [Transaction ID]
You can verify the Transaction ID that Tebex automatically sends to customers. Ask them to copy and paste it and verify with this command.
You can reference:
Payment status (complete / incomplete)
Price of payment
Date and time
Tebex username
Product name
/search [Tebex Username]
You can get information from Tebex username.
You can reference:
Username
Ban count
Chargeback rate
Total purchases
Most recent payment
/products
Outputs the list of products available on the store.
This is Japanese version but if you deploy English version it will be a bit different.
products command
/createurl [package ID] [Tebex Username]
Creates payment URL for specific user. The link automatically adds products to user's shopping cart. Particularly useful if your customer do not know how to buy things on your store.
createurl
/recentpayments
Get most recent payment information. It will make a list of 25 most recent payments.
recent payments
How to deploy
This is just a source code of the bot. You need to deploy the bot by yourself. There are 2 ways to do so:
Use IaaS(such as Heroku, Railway) to host a bot on rented server (recommended)
Host on your server
Since this bot should be online 24/7, I would not recommend hosting this bot on the same server as your FiveM server. Also, this repo is optimized for IaaS, meaning you can deploy the bot in about 2 mins if you use IaaS. I personally use Railway.app.
Be aware that you need to enable message intent and enable applications.commands when inviting.
After creating a bot, head over to "Bot" tab on developer portal.
bot tab
Enable message content intent here.
message content intent
Now navigate to OAuth2 tab, and open OAuth2 Generator.
auth2 gen
bot permissions
2. Get admin role ID
These commands are intended for server admins and community managers, so go to your server settings and get admin role IDs. You need to enable discord developer mode to do this.
3. Get Tebex secret key
Generate your Tebex secret key in order to connect this bot and your Tebex store.
Fork my repo (or download if you wanna host locally) and edit .env file. Be aware that if you fork it as a public repo, discord will message you that your token has been leaked. Fork it as private repo or use "service variables" if you are using Railway.app. This way you will not leak your precious information.
After editing this, you need to choose IaaS or hosting locally.
Hosting on IaaS
Just connect your github account and it will automatically deploy the bot. Use Dockerfile to deploy it. You do not need to do anything, just wait.
Hosting locally
Use pyinstaller to compile the code and make exe file.
https://pyinstaller.org/en/stable/
This bot makes HTTP request to Tebex plugin API along with Tebex secret key when the command is involked, and output it as embed messages. The API returns Json format file but it is not readable for everyone so this bot converts them into more readable messages.