Skip to content

Commit

Permalink
Update README (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
imxeno authored May 18, 2024
1 parent 60c6d68 commit 57f06bb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ Discord bot used primarily on the official server of [Mistwood](https://mistwood

</div>

# License
## Setup

To run or develop Mist you will need `node` v20 and `pnpm` v8. We recommend using [fnm](https://github.com/Schniz/fnm) and [corepack](https://nodejs.org/api/corepack.html).

```
pnpm i
pnpm dev
```

## Scripts
- `pnpm build` - builds all apps and packages
- `pnpm dev` - runs the bot in watch mode
- `pnpm lint` - runs the formatter, linter and import sorter
- `pnpm lint:fix` - the same as above, but applies easy fixes

Keep in mind that this repository, although small at the moment, uses [turbo](https://turbo.build) for building. Prisma client gets regenerated, if needed, every time `pnpm build` or `pnpm dev` is ran. Additional scripts can be found in relevant packages.

## Environment variables

- `CLIENT_ID`, `BOT_TOKEN` - Discord authentication details
- `DATABASE_URL` - connection URL of a MySQL database
- `GUILD_IDS` - comma-separated list of server IDs that the bot will sync commands to

## Contributing

We welcome and encourage contributions. Don't hesitate to make a PR with a bugfix, but please consult us first on [our Discord server](https://discord.gg/mistwood) if you would like to implement new features.

## License

Distributed under the MIT License. See [LICENSE](/LICENSE) for more information.
5 changes: 1 addition & 4 deletions apps/bot/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { container } from "@sapphire/pieces";
import * as dotenv from "dotenv";
import { z } from "zod";
import { coerceBooleanSchema, coerceableTrue } from "./utils/schemas.js";

dotenv.config({ path: [".env", "../../.env"] });

const envSchema = z.object({
NODE_ENV: z.string().default("development"),
CLIENT_ID: z.string(),
BOT_TOKEN: z.string(),
ENABLE_API: coerceBooleanSchema.default(coerceableTrue),
DATABASE_URL: z.string().url(),
PORT: z.coerce.number().default(8080),
NODE_ENV: z.string().default("development"),
GUILD_IDS: z
.string()
.transform((value) => value.replaceAll(" ", "").split(",")),
Expand Down

0 comments on commit 57f06bb

Please sign in to comment.