[Deprecated] Discord to Roblox Ban Bot

Glitch is a decent host. We use their premium version on Keyon Air: Flight Simulator to host the ban database and on Animations: Mocap to host various web services. The free version, however, is not suitable for production hosting; do not use it for hosting anything in production!!!

4 Likes

Glitch has stopped supporting hosting Discord bots. If you are going to use this, you are going to either have to self-host it or host it on another platform. Also, you should upload it to github as not everyone may be comfortable with running terminal importing commands on their computers.

1 Like

Heroku is a good free alternative to glitch now that discord bot hosting has been depreciated @zachariapopcorn

2 Likes

I would’ve used Heroku, but when I tried a bot with a database before on in, it kept deleting the database file. Another reason why I didn’t use Heroku is that I really don’t know if there’s like a direct ping url for the project. I also “love” that support is locked behind a paywall. I didn’t use repl because I’ve had database issues on it.
@DevXML

1 Like

If you know how to get Heroku to not overwrite the database, comment below and I’ll check it out. If this bot didn’t need a database, then I would’ve use repl

1 Like

Is there any chance for us to be able to see the source code?

1 Like

You can see if by 2 ways
Running the command that gets the index.js file in step 4
OR
Clicking here
@UnknownZeal

2 Likes

Try using heroku, it reliable and has better uptime

1 Like

2 reasons: 1: Support is locked behind a paywall and 2: Everytime I reboot/redeploy/restart the bot, it wipes data/db.sqlite back to nothing @Ashp116

1 Like

As I’ve stated before on @GeneralLPrince 's Post. You can check it out here.

1 Like

The only reason why there is a webserver in these type of bots is because there’s no api in the public docs that can manage in-game datastores. Since Roblox can make requests to out-of-site apis, but other’s cant do the same for datastores, the webserver acts as the datastore for both (in this case Discord and Roblox) to communicate and send data to one website to the other. If Roblox were to add something like this, the webserver wouldn’t really need be used for storing data, but more for like communicating, which sites like repl and heroku also do good at

But also not the most efficient and completely unnecessary to add an extra 3rd party site for an already easy task such as this.

1 Like

thats y you need to use the database that heroku gives you

Then suggest an API endpoint to save data to games

Can you link me the docs for this database that Heroku has?

You’re never gonna believe me… It’s a cool new revolutionary thing called a Datastore

2 Likes

It’s significantly better than using google spreadsheets as a database, but the code needs a massive cleanup.

A few things:

  1. Don’t store a discord bot and a web server in index.js, make them separate modules.
  2. if(request.method !== "GET") return response.sendStatus(400); is this necessary? You’re using app.get, that already ensures It’s going to be a get request.
  3. You need to add client.on('error', console.error) or else your discord bot will crash whenever it runs into an error (it will).
  4. Your bot will benefit greatly from a command handler.
  5. The Lua portion needs a lot of work.

Just my two cents.

I know right, funny thing is that, oh idk, there’s no api to update it. If there is, would you link it to me?

Thanks for your feedback! This reply is just meant to answer the things that you listed above

1: I’m used to writing a Discord bot’s source code in 1 file
2: I always thought that app.get() meant that it’s getting a reply from the “sub url” in the first argument, though I’ll remove it after when I’m done typing this post
3: I’ve barely used client.on(‘error’) because all the errors I’m gotten while writing bots were solved by using try/catch
4: It’s easier for me to code in one big file then separate it within different files. I’m also used to it
5: In what way?
@Meta_data

There’s no need, On the player’s ban it is as easy just to run

local function ban(plr)
    plr("You have been banned.")
    
    banList:FireServer(plr) 
end

to fire if the user is indeed banned and tried to rejoin, such as pulling from the datastore if set up properly with logging the players UserID incase any name changes happen. I can show you how this type of system works and how I personally log my bans if you’d want to see it functioning.

1 Like

I’d like to see your way on how you do it with the way that you explained in the previous posts