Bastion
ApplicationsBastion is a multi-purpose Discord Bot that can help you automate most tasks in your server, from administration and moderation to keeping the members active through various incentives, games and other fun activities
README
Bastion
From their Github
Bastion is a multi-purpose Discord Bot that can help you automate most tasks in your server, from administration and moderation to keeping the members active through various incentives, games and other fun activities.
Running the bot
You need to enable both Privileged Gateway Intents for the bot to run.
Invite link: https://discord.com/oauth2/authorize?client_id=INSERT_APP_ID_HERE&scope=bot&permissions=8
Server Ports
| Port | default |
|---|---|
| Bastion API Port | 8377 |
Mongodb
Mongodb is automaticly running in the background. Leave Mongo URL to the default to use it. If you want to use a external mongodb server a connection string should look like: mongodb+srv://<username>:<password>@<ip>/?retryWrites=true&w=majority
Startup cmd
By default this should be npm start but if you want to register your slash commands set it to npm run commands it will activate the slash commands on discord's side. Then the server will crash, change it back to npm run to start the bot back up and have slash commands enabled.
Docker Images (1)
| Name | Image |
|---|---|
Bastion | ghcr.io/ptero-eggs/yolks:bot_bastion |
Startup Command
{{STARTUP_CMD}} Variables (9)
Bot Token
The Bot Token you get from https://discordapp.com/developers/applications/
- Environment:
BOT_TOKEN- Default:
GETABOTTOKEN- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|max:80
Bot Client ID
The Bot ID you get from https://discordapp.com/developers/applications/
- Environment:
BOT_ID- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|max:32
Mongo URL
use `mongodb://127.0.0.1:27017/bastion` for using the build in mongodb server
- Environment:
MONGO_URI- Default:
mongodb://127.0.0.1:27017/bastion- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|max:128
Music Activity
When enabled, Bastion updates the activity to the currently playing track
- Environment:
BASTION_MUSIC_ACTIVITY- Default:
true- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:true,false
Relay Direct Messages
When enabled, Bastion will relay any direct messages it receives to the owner of the bot application / team.
- Environment:
BASTION_RELAY_DMS- Default:
false- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:true,false
Safe Mode
When enabled, this disables usage of unsafe commands like `exec` and `eval`.
- Environment:
UNSAFE_MODE- Default:
false- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:true,false
Bastion API Port
Port used for Bastion API Server
- Environment:
BASTION_API_PORT- Default:
8377- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|max:10
Bastion API Auth
Auth for accessing the Bastion API Server.
- Environment:
BASTION_API_AUTH- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string|max:128
Startup cmd
set to `npm start` if you just want to start the bot. set to `npm run commands` to activate the slash commands
- Environment:
STARTUP_CMD- Default:
npm start- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:npm start,npm run commands
Installation Script
node:20-bookwormbash#!/bin/bash
# Bastion Bot Installation Script
#
# Server Files: /mnt/server
## Move to install folder
apt update
apt install -y build-essential libtool python3 git tar
mkdir -p /mnt/server/
cd /mnt/server/
if [ -d "/mnt/server/mongodb" ]
then
cd /mnt/server/
echo "backing up mongodb"
REINSTALL=true
tar -czf mongodb_backup.tar.gz mongodb/
mv mongodb_backup.tar.gz /tmp
fi
cd /mnt/server
rm -rf * .git/ .github/ .env.example .eslintrc.yml .gitattributes .gitignore .npm/
## Clone repo
echo "cloning Bastion bot"
git clone -q --depth 1 https://github.com/TheBastionBot/Bastion.git ./
echo "updating npm"
npm install -g npm@latest
echo "npm install --no-package-lock"
npm install --no-package-lock
echo "npm run build"
npm run build
## Move config files.
mv settings.example.yaml settings.yaml
rm -rf bastion.cmd .env.example bastion.sh scrips/
mkdir -p mongodb/
if [ "$REINSTALL" == "true" ]
then
cd /mnt/server
echo "reinstall"
mv /tmp/mongodb_backup.tar.gz /mnt/server
tar xf mongodb_backup.tar.gz
rm mongodb_backup.tar.gz
else
echo "fresh install"
fi
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"