[DiscordJS] Learning to Code

Project: honey-axiomatic-count

At the very moment, I am trying to implement my very own bot onto my Discord server and not having to rely on other bots. I want to figure out how to code a bot that has a leveling system, but I don’t know how to get the database to work with glitch and I looked up some tutorials, but I am afraid that some databases aren’t safe.

I would recommend using mongoose for mongodb

Hello Misly,

I just signed up for mongoDB, but how would I implement the mongodb to glitch? Or the mongoose… Sorry I am very new! Also are there an tutorials on the “leveling system” I can take a look at.

This video shows the basics of integrating a discord bot with mongo

I would recommend using SQLite but currently I use JSON as a database.
Never use JSON as a database though. It’s a bad practice.

I aim to change that with Jsoning.

1 Like

JSON is good for basic configuration but not for large scale purposes unless you’ve implemented a way to seek through the file instead of loading it entirely into memory. Maybe we should just configure our ides to refuse to save an incorrectly formatted json file.

1 Like

Is it possible to run a database with glitch? I followed an Enmap tutorial and it didn’t work and I am now aiming to attempt one but with MongoDB. It would be nice to get some assistance :slight_smile: Thank you all for the wonderful responses so far!

Sort of, you can run a database, and then use make a socket.io to socket proxy on that server. On the server you want to access the database you make a socket to socket.io proxy. Considering their interfaces are almost indentical this should be easy. Unfortunatly this sacrfices lots of speed, but glitch’s reverse proxy doesn’t understand non-http(s) requests