Ever wanted a Bot to help you manage your Server? Well the answer is Proton
It has all the features you want online user tracking or welcome and goodbye messages
Proton runs on Bun — there is no build step and no Node toolchain.
-
Install dependencies:
bun install
-
Provide secrets. Proton reads them from the environment via SecretSpec; the required and optional variables are declared in
secretspec.tomland documented in.env.example:Variable Required Purpose TOKENyes Bot token DISCORD_APPLICATION_IDyes Application id, used to register commands DISCORD_GUILD_IDno Register commands to one guild for instant updates DATABASE_PATHno SQLite file, defaults to ./database.sqliteInstall SecretSpec with
curl -sSfL https://secretspec.dev/install.sh | sh, thensecretspec initand set your values. -
Register the slash commands:
secretspec run -- bun run deploy
-
Start the bot:
secretspec run -- bun run dev
Migrations run automatically at startup, so there is no separate database setup step.
| Script | What it does |
|---|---|
bun run dev |
Start with watch-reload |
bun run start |
Start once |
bun run deploy |
Register commands (--delete-all clears them) |
bun run db:generate |
Generate a Drizzle migration after changing src/db/schema.ts |
bun test |
Run the test suite |
bun run typecheck |
Typecheck with tsc --noEmit |
bun run lint |
Lint with ESLint |
bun run format |
Format with Prettier |
Note: set
DISCORD_GUILD_IDwhile developing — guild-scoped commands update instantly, whereas global ones can take up to an hour to propagate.
sudo ./deploy/install.sh
secretspec export --profile production --format dotenv | sudo tee /etc/proton/proton.env
sudo chmod 600 /etc/proton/proton.env
secretspec run --profile production -- bun run deploy # register slash commands
sudo systemctl start protonThe installer creates a proton system user, installs the application to /opt/proton,
and enables a sandboxed unit that keeps its database in /var/lib/proton. Secrets are read
by systemd from a root-owned 0600 environment file, so the bot's own user never has access
to them. Re-run install.sh to upgrade; it never touches the database or an existing
environment file.
NixOS:
install.shis imperative and will not survive anixos-rebuild. Declare asystemd.services.protonunit in your configuration instead —deploy/proton.serviceis a reasonable starting point for its settings.
The old Sequelize database is imported automatically and losslessly. Rename it to
database.legacy.sqlite in the project root and start the bot once; guilds, warns and
custom messages are copied into the new schema. The import skips any table that already
has rows, so it is safe to leave the file in place.
ℹ️
nix developgives you a shell with Bun available.
/help - shows all of the Bots commands
For support, join our Discord Server
Copyright (c) 2022-2042 Niklas Choinowski and contributors