Skip to content

MesterMan03/Bedlessbot

Bedlessbot

Installation

Bedlessbot uses Bun and is incompatible with Node. Therefore you first have to install Bun.

Follow the instructions at https://bun.sh/docs/installation

  1. Clone the repository:
git clone https://github.com/MesterMan03/Bedlessbot.git
cd Bedlessbot
  1. Install dependencies:
bun install

This will create an empty data.db SQLite database file in the root directory with the correct tables set up.

  1. Set up .env:

Create a .env file by following .env.example.

  1. Set up config:

Finally, set up src/config.ts. It's already prefilled with data, so you will have to change the values to your own.

  1. (optional) Set up secret:

If you want to use the machine-learning API, you must provide the secret you generated for the API. Create a secret file in the root directory and paste the secret in it (it should be a hexadecimal string).

  1. (optional) Set up test.localhost domain:

For hCaptcha to work, you cannot use localhost. To fix this, you can set up a domain in your hosts file. Add the following line to your hosts file:

127.0.0.1 test.localhost

Then you can access the dashboard at http://test.localhost:8146. You might also want to mark this origin as a secure origin, so features like Service Workers work using the Chrome flag chrome://flags/#unsafely-treat-insecure-origin-as-secure.

Usage

Package scripts

  1. bun start - Start the bot in production mode.
  2. bun dev - Start the bot in development mode.
  3. bun biome - Run biome (equivalent to biome).
  4. bun lint - Run biome linter (equivalent to biome lint .).
  5. bun format - Run biome formatter (equivalent to biome format .).
  6. bun check - Run full biome check (linter + formatter), (equivalent to biome check .).
  7. bun devdash - Run the dashboard in dev API mode (no connection to Discord bot, can be ran without secrets).

For the development API to work, you only need the following environment variables:

  • JWT_SECRET - You can set this to any base64-encoded string.
  • VAPID_PRIVATE_KEY, VAPID_PUBLIC_KEY and VAPID_SUBJECT - For push notifications to work, you must set these variables to a valid VAPID private key, public key and subject (mailto: or https:// link) respectively. You can generate valid VAPID keys using bunx web-push generate-vapid-keys.

About

This is an epic bot (by an epic person) that handles role applications and level system for Bedless Nation.

Resources

License

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Contributors