Skip to content

Repository files navigation

How to develop Moonbot (bot)

Prerequisites

How to setup Postgres

To save data about users and keys, we must setup postgres

brew services start postgres psql -U {your username} -d moondb -h localhost

Now get your url, it's how you connect to your db. Save it into /bot/.env. It will be the beginning of the rest of your info

DATABASE_URL=postgresql://svapnil:{your_password}@localhost:5432/moondb

How to setup your Discord Dev Bot

Go to https://discord.com/developers/applications and make a new Application

Screenshot 2024-04-23 at 5 09 00 PM

Create a new app title "Name's Moonbot Dev"

You should then make the profile image of the app a Blackpink member Get Client ID and Client Secret here:

Screenshot 2024-04-23 at 5 08 16 PM

Save these variables here:

# Dev 
DISCORD_BOT_TOKEN=
DISCORD_CLIENT_ID=

Select these things to invite OAuth Link in the OAuth tab. Screenshot 2024-04-23 at 5 02 56 PM

Registering slash commands

You will have to register /wallet, etc on the bot. Make sure the bot credentials are in the /scripts/sync_commands folder via another .env then run bun i && bun run.ts in sync_commands

Running prisma

bun i
bunx prisma migrate dev

This should basically run through the schema and setup your db.

Get the rest of the dev variables from Svap

lol

Running

bun i npm run dev

Congrats! Now use your dev bot on the dev group chat.

About

A crypto trading app built on top of Discord.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages