A multi-purpose bot that enhances Discord.
- Khafra-Bot does not sell access to any content or features.
♥️
- Install dependencies using
npm i
. - Follow nodesource's guide for running Node.js apps with
systemd
. - Create a
.env
file in the root directory and fill in the required values. - Edit the config file.
- For multiple bot owners, an array can be used, or a single string.
- Install Postgres. For Windows:
- Download and setup WSL2
- Installing Postgres with WSL2
- Create a new user account in Postgres with the same name as specified in the
.env
file.sudo -u postgres psql
CREATE USER [username] WITH PASSWORD '[password]';
ALTER USER [username] WITH SUPERUSER;
- Run the bot:
- dev:
node --run dev:build && node --run dev:run
- prod:
node --run dev:build && node --run prod:run
- dev:
khafra_bot.service:
[Unit]
Description=Khafra Bot
Documentation=https://example.com
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/var/Khafra-Bot
ExecStart=/root/.volta/tools/image/node/21.7.3/bin/node --disable-proto=throw --env-file=.env build/src/index.mjs
Restart=on-failure
[Install]
WantedBy=multi-user.target
.env:
HERE_WEATHER: string
NASA: string
OWLBOTIO: string | undefined
POCKET_CONSUMER_KEY: string
POCKET_SECRET_KEY: string
POSTGRES_USER: string | undefined
POSTGRES_PASS: string | undefined
TMDB: string
TOKEN: string
WORKER_API_BASE: string | undefined
WORKER_BIBLE_BASE: string | undefined
npm run v1.10
(dumps the current postgres databases for a few commands to JSON).npm i better-sqlite3
npm run dev:build && npm run prod:run
- Open postgres shell and
ALTER TABLE kbGuild ADD COLUMN reactRoleChannel TEXT DEFAULT NULL;
- Windows tutorial here!
- Linux:
sudo -u postgres psql
,\c kb
, run the command above,\q
.
npm rebuild esqlite
if moving to Node v17+
--prod
(none): runs the bot in production mode--disabled
(string[]): disables commands listed