Installation
Last updated
Last updated
Some methods of the API not may fully work or be broken. I was able to test most and 75% of it works. If something does not work, please just submit an issue or pull request for it on the GitHub page. Thanks!
This is essentially a Discord API for FiveM. It utilizes the REST API of Discord for all your essential needs :) Things that are heavy in Discord rate limiting (such as retreiving all server roles and player avatars) will be automatically stored to a cache for developers automatically. I will be moving all my scripts over to use this API for better ease of use. Some features include not having to gather role IDs at all, since the script gets the server's roles automatically, so you can just specify the role's name instead of role IDs at all (however, be aware that this will break then if someone changes the roles' names on Discord)... I hope you can all find some use for this, I know I will :P
Set up a Discord bot via the developer portal on Discord. (https://discord.com/developers/applications)
Invite the Discord bot you created to your Discord.
Get the Discord bot token from the newly created bot.
Place the Discord bot token in Bot_Token = '{BOT_TOKEN}',
in the config.lua
file in place of {BOT_TOKEN}
Get your Guild ID by copying the ID of your Discord server's logo in the sidebar of Discord.
Place the Guild ID in Guild_ID = '{GUILD_ID}',
in the config.lua
file in place of {GUILD_ID}
You can now choose to set up the RoleList
or not. Utilizing the RoleList
makes you able to use keys in the other Discord scripts that will correspond to the config's value when checking a user for matching roles.