Executing code when discord command ran and updating roles depending on value

So Im working on a game that is connected to discord and i want to be able to execute functions inside roblox with optional parameters from discord and other way around. For example: (Discord to roblox) “/give abidbmt gold 100” which then triggers a function in a roblox server and changes the datastore gold value of the player to 100. And I want to give players certain roles depending on how much gold the player has (Roblox to Discord)

Ive searched alot in the internet and in the forum but couldnt find anything that suits my needs

So if you have any ideas please post them here :slight_smile:

You can use long polling. Create open, long living sockets, that await for the server to respond. When they close, open a new one.

You will want to use Get Entry as well as Set Entry for Discord to Roblox.

For Roblox to Discord you could use Get Entry periodically (once a day?) to get every users Gold information and update their roles.

How would I implement them in a discord bot? Im just getting started with making discord bots but I dont want to make anything special i just want to set entries, get entries and give roles when entry is updated

I would recommend using something like discord.js (javascript) or discord.py (python similar to lua). Python has the “requests” library and javascript has fetch (built in)/ axios (library) for making requests to the roblox api.

I also recommend taking a look at this documentation on how to handle API requests.

Be careful if you have it set for roblox to send data to discord as their is a rate limit that discord has.

EDIT: didn’t mean to make this a reply to another person.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.