FiveM Forum Post: https://forum.cfx.re/t/tommys-discord-api-tool-for-devs/4806569
Tommy's Discord API 🏮
This tool easily allows for discord integration in scripts.
Why this API?
There are many resources that already serve a similar purpose. However, the methods in which these resources acquire discord information are not reliable. Discord Data Saver solves this problem by storing players' discord IDs and caching role information. With this API, your players will no longer have issues with discord permissions.
Client Exports
The following functions are available for client-side usage:
exports.ddSaver:getRoles()- Returns a table of role IDs.exports.ddSaver:getId()- Returns the player's discord ID.exports.ddSaver:refreshData()- Refreshes the player's discord data.exports.ddSaver:hasRole("roleid")- Returns true or false.
Server Exports
The following functions are available for server-side usage:
exports.ddSaver:getRoles(source)- Returns a table of role IDs.exports.ddSaver:getId(source)- Returns the player's discord ID.exports.ddSaver:refreshData(source)- Refreshes the player's discord data.exports.ddSaver:hasRole(source, "roleid")- Returns true or false.