Bedlessbot uses Bun and is incompatible with Node. Therefore you first have to install Bun.
Follow the instructions at https://bun.sh/docs/installation
- Clone the repository:
git clone https://github.com/MesterMan03/Bedlessbot.git
cd Bedlessbot- Install dependencies:
bun installThis will create an empty data.db SQLite database file in the root directory with the correct tables set up.
- Set up .env:
Create a .env file by following .env.example.
- 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.
- (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).
- (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.
bun start- Start the bot in production mode.bun dev- Start the bot in development mode.bun biome- Run biome (equivalent tobiome).bun lint- Run biome linter (equivalent tobiome lint .).bun format- Run biome formatter (equivalent tobiome format .).bun check- Run full biome check (linter + formatter), (equivalent tobiome check .).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_KEYandVAPID_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 usingbunx web-push generate-vapid-keys.