An all purpose discord bot for everyone.
This bot was created to complement the existance of Codify and as a rewrite of it, since that the code of Codify is already getting old and messy I hope that this will be a more general purpose bot that is not focused on only one community. Of course I will not abandon Codify entirely, since it's easy for me to add new features, but contributing to it, for other people, has proven to be rather difficult because of the setup, which made some people give up on doing it, Morpheus, hopefully will be a lot easier to set up and contribute to. I will also try to bring all of the functionality of Codify to Morpheus and much more.
Please follow the angular commit message conventions, as semantic release is set to use that.
Please use yarn
"dev": "nodemon -r dotenv/config",
"build": "tsc",
"start": "node ./dist/index.js",
"lint": "eslint **/*.ts",
"lint:fix": "eslint **/*.ts --fix",
"migrate": "prisma migrate dev --preview-feature && prisma generate",
"deploy": "prisma migrate deploy --preview-feature",
"studio": "prisma studio"
dev
: This starts the bot. Used in development.build
: This will build the files. There is no need to build the files in development unless you want to test the build system.start
: This will start the files that have been built using thebuild
command.lint
: This will show you linting warnings and errors in your code.lint:fix
: This will try to fix the linting errors and warning but be careful because it could introduce changes that break the code, use with caution.migrate
: Used after making changes to the prisma schema to generate new migrations.deploy
: This will deploy the migrations to the database.studio
: If you want to have an easy way to access the data in the database and make changes this will open a browser window with everything you need.
- Create a discord bot in the discord developer portal, you can use this guide from discord.js, and make sure you include the permission of creating slash commands when generating the invite link for your bot.
- Make sure you have postgresql installed on your computer.
- In
psql
create a new user using this command:CREATE USER morpheus WITH PASSWORD 'password' CREATEDB;
- In
psql
create a new database using this command:CREATE DATABASE morpheus OWNER morpheus;
- In the root directory of the repository, create a new file called
.env
and copy the contents ofdefault.env
in it. - Add the bot token from the bot you made earlier to your
.env
file as well as the guild id you want to test your bot in (If you make new slash commands this will update them faster in the server you are testing, otherwise it takes an hour for discord to update slash commands globally). - Run
yarn
to install the packages, make sure you have yarn installed. - Run
yarn deploy
to deploy the migrations to your database and make it up to date. - You are now done, you can run
yarn dev
to start your bot. You have more information about the scripts, above.