Go to file
Hri7566 9fe48ddff1 Update README.md 2023-12-02 17:44:45 -05:00
config Regenerate config 2023-12-02 17:24:06 -05:00
prisma Add balance system 2023-12-02 16:54:39 -05:00
src Cleanup 1 2023-12-02 17:21:01 -05:00
.env.template services 2023-10-18 01:05:14 -04:00
.gitignore Remove rust 2023-10-17 02:05:30 -04:00
.prettierrc init 2023-10-16 10:09:46 -04:00
README.md Update README.md 2023-12-02 17:44:45 -05:00
bun.lockb Change command permissions and modify help to read permissions 2023-12-01 23:44:04 -05:00
bunfig.toml init 2023-10-16 10:09:46 -04:00
package.json Change command permissions and modify help to read permissions 2023-12-01 23:44:04 -05:00
tsconfig.json init 2023-10-16 10:09:46 -04:00

README.md

supercosmic

This is essentially Cosmic "2.0", but I don't intend to strictly remake everything, it's more of a spiritual successor that shares the name.

Cosmic was a space-themed economy bot that could run on multiple different services, such as Discord and Multiplayer Piano. Initially, it was my learning project. I would implement bad things to learn why they're bad.

Supercosmic is another space-themed economy bot that streamlines tech that I consider new, yet sustainable and active. This way, the dependencies that I use aren't usually outdated.

To give an example, Supercosmic uses Bun.

I also plan to use hyperimport somehow in the future to edge into C++ or rust a bit.

Usage

To install dependencies:

bun install

To copy envorionment variables:

cp .env.template .env

To setup Prisma (PostgreSQL required):

bunx prisma db push

To run:

bun .

Configuring

Pretty much all of the available settings for things are in the config directory. If a config file doesn't exist, it is generated with default data at launch. Configs are only loaded once and are not yet hot-reloadable.

  • balance.yml: Balance (money) configuration
  • mpp_net_channels.yml: MPP.net channels to connect to
  • roles.yml: Roles and corresponding permissions
    • There isn't a clean way to add roles yet. They're handled by an enum in the Prisma schema.
    • In order to give someone a role, currently, the /help menu in the console can help you with that.
    • Roles can be hierarchial by using the inherits property. The best explanation I have is that it works kind of like Lua metatables.
  • services.yml: List of services to connect to
    • This file can control the connection to entire sites, i.e. MPP.net could be disabled, or the console
    • If you receive crashes while using PM2 to host, turn off the console service.
  • switchchat.yml: SwitchCraft Chatbox config
    • SwitchCraft 3 is a Minecraft server that primarily uses the ComputerCraft: Tweaked mod. They have a custom chat system that allows for user-created commands.

Info

This project was created using bun init in bun v1.0.4. Bun is a fast all-in-one JavaScript runtime.