mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Zeppelin is a moderation bot for Discord, designed with large servers and reliability in mind.
![]() This loose pre-check checks the config schema by treating every object as partial. This means that if a property exists, it's guaranteed to be the correct type (e.g. object). However, there's no guarantee that all or any properties exist. This allows preprocessStaticConfig implementations to be much less defensive and thus reduce boilerplate. |
||
---|---|---|
backend | ||
dashboard | ||
shared | ||
.editorconfig | ||
.gitignore | ||
.nvmrc | ||
.prettierrc | ||
package-lock.json | ||
package.json | ||
process-api.json | ||
process-bot.json | ||
README.md | ||
tslint.json | ||
update.sh |
Development
These instructions are intended for bot development only.
👉 No support is offered for self-hosting the bot! 👈
Running the bot
cd backend
npm ci
- Make a copy of
bot.env.example
calledbot.env
, fill in the values - Run the desired start script:
npm run start-bot-dev
to run the bot withts-node
npm run build
followed bynpm run start-bot-prod
to run the bot compilednpm run watch-bot
to run the bot withts-node
and restart on changes
- When testing, make sure you have your test server in the
allowed_guilds
table or the guild's config won't be loaded at all
Running the API server
cd backend
npm ci
- Make a copy of
api.env.example
calledapi.env
, fill in the values - Run the desired start script:
npm run start-api-dev
to run the API server withts-node
npm run build
followed bynpm run start-api-prod
to run the API server compilednpm run watch-api
to run the API server withts-node
and restart on changes
Running the dashboard
cd dashboard
npm ci
- Make a copy of
.env.example
called.env
, fill in the values - Run the desired start script:
npm run build
compiles the dashboard's static files todist/
which can then be served with any web servernpm run watch
runs webpack's dev server that automatically reloads on changes
Notes
- Since we now use shared paths in
tsconfig.json
, the compiled files inbackend/dist/
have longer paths, e.g.backend/dist/backend/src/index.js
instead ofbackend/dist/index.js
. This is because the compiled shared files are placed inbackend/dist/shared
. - The
backend/register-tsconfig-prod-paths.js
module takes care of registering shared paths fromtsconfig.json
forts-node
,ava
, and compiled.js
files - To run the tests for the files in the
shared/
directory, you also need to runnpm ci
there
Config format example
Configuration is stored in the database in the configs
table
# role id: level
levels:
"12345678": 100 # Example admin
"98765432": 50 # Example mod
plugins:
mod_plugin:
config:
kick_message: 'You have been kicked'
can_kick: false
overrides:
- level: '>=50'
config:
can_kick: true
- level: '>=100'
config:
kick_message: 'You have been kicked by an admin'
other_plugin:
config:
categories:
mycategory:
opt: "something"
othercategory:
enabled: false
opt: "hello"
overrides:
- level: '>=50'
config:
categories:
mycategory:
enabled: false
- channel: '1234'
config:
categories:
othercategory:
enabled: true