Custom Prefix In glitch

Here is my project https://glitch.com/~knowing-sharp-meadow
I am planning on purchasing glitch premium but I wanna make sure I get the best out of it
So anyone pls help how to allow people to choose their own prefix for their own server
Pls I am not good at coding so pls explain clearly
Thanks

Please do not ask to be spoon-fed. Say things that you’ve tried & what has/hasn’t worked.

Make a database, make bot listen for command that allows users to set to their own prefix and then once you get their preferred prefix, save it to database (if it already exists then update the values). Make sure to make to save with key which is user’s id. Once someone messages something, make bot go through the database and check if they are in it, if they are use their saved prefix to check if they said a command, but if it doesn’t exist in database, then use default prefix.

1 Like

I am not asking for spoon-feed
I am asking for help
Like how to create a dB

That’s the main problem
There isn’t any tutorial on YouTube for database

You can either use MySQL, Json file or whatever you like.

A cleaner approach:

  1. Listen for command to change prefix.
  2. Get the guild ID.
  3. Save the new prefix to the database as a value for the guild ID, with the guild ID as a key.
  4. Listen for messages.
  5. Get prefix of the server based on the guild ID from the database and use a default prefix if the guild doesn’t exist in the database.

The end.

1 Like

Best free database to use with Glitch I found is MongoDB Atlas. Use mongoose to use it :slight_smile:
Here’s a video showing exactly how to do what over people suggest (saving a prefix):


@PGamerX make sure that when he types localhost or whatever that you use the Connection String provided by MongoDB Atlas :slight_smile: