How would I go around creating a Discord to Roblox bot?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want to create a discord to roblox bot which can ban players, kick players, edit datastores, etc.

  1. What is the issue? Include screenshots / videos if possible!

I’m not sure how to code it on js

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I searched for tutorials on devfourm and youtube, I know I need to use messagingservice or datastoreservice api.

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

2 Likes

For Roblox-to-Discord you only need to use a webhook.

For Discord-to-Roblox Open Cloud might be of interest. I did some quick searching and I couldn’t find what functionality it provided, but considering it is able to update scripts it might have the ability to use some form of the MessagingService or DataStoreService.

Assuming it can use both of those, I’d probably do this:

When the bot is told to ban someone, update the DataStore for the game, and use MessagingService to let all active servers know that a new user has been banned. Probably smart to Include the UserId in this, so they can simply kick the player banned instantly.

It is possible to achieve this using only DataStoreService as well, but in that case you would have to iterate through all players in the server and see if they are in the list every X seconds. Otherwise it would not be able to ban an active player, and instead only prevent banned players from rejoining.

3 Likes

How would this look like in the discord bot’s code?

Pretty sure you don’t really have to do anything on the bot side. I think it’s mostly on the Roblox side but I’m not too sure. I’m going to have to look into this a bit more and I suggest you should too