WizBot CLI Guide (via Bash Installer)¶
Supported Operating Systems¶
Prerequisites¶
macOS:
Linux:
24/7 Up-time via VPS (Digital Ocean Guide)
Creating a Discord Bot & Getting Credentials
Installation Instructions¶
Open Terminal (if you're on an installation with a window manager) and navigate to the location where you want to install the bot (for example cd ~)
-
First make sure that curl is installed
/// tab | Ubuntu | Debian | Mint
/// /// tab | Rocky | Alma | Fedora
/// /// tab | openSUSE
/// /// tab | Arch | Artix
/// /// tab | macOS
///
-
Download and run the new installer script
- Install the bot (type
1and press enter) - Edit creds (type
3and press enter)- ALTERNATIVELY, you can exit the installer (option
6) and editwizbot/creds.ymlfile yourself
- ALTERNATIVELY, you can exit the installer (option
- Follow the instruction below to create your own Discord bot and obtain the credentials needed to run it.
- After you're done, you can close nano (and save the file) by inputting, in order:
CTRL+XYEnter
- After you're done, you can close nano (and save the file) by inputting, in order:
- Run the installer script again
bash w-install.sh
- Run the bot (type
3and press enter) - Done!
Update Instructions¶
- ⚠ Stop the bot ⚠
- Navigate to your bot's folder, we'll use home directory as an example
cd ~
- Simply re-install the bot with a newer version by running the installer script
curl -L -o w-install.sh https://raw.githubusercontent.com/Wizkiller96/bash-installer/refs/heads/v6/w-install.sh && bash w-install.sh
- Select option 1, and select a NEWER version
Running WizBot¶
There are two main methods to run WizBot: using tmux (macOS and Linux) or using systemd with a script (Linux only).
/// tab | Tmux (Preferred Method)
Using tmux is the simplest method, and is therefore recommended for most users.
Warning
Before proceeding, make sure your bot is not currently running by either running .die in your Discord server or exiting the process with Ctrl+C.
- Access the directory where
w-install.shandwizbotis located. - Create a new tmux session:
tmux new -s wizbot- The above command will create a new session named wizbot. You may replace wizbot with any name you prefer.
- Run the installer:
bash w-install.sh - Start the bot by typing
3and pressingEnter. - Detach from the tmux session, allowing the bot to run in the background:
- Press
Ctrl+B - Then press
D
- Press
Now check your Discord server, the bot should be online. WizBot should now be running in the background of your system.
To re-open the tmux session to either update, restart, or whatever, execute tmux a -t wizbot. (Make sure to replace "wizbot" with your session name. If you didn't change it, leave it as it is.)
/// /// tab | Systemd
Note
Systemd is only available on Linux. macOS utilizes Launchd, which is not covered in this guide. If you're on macOS, please use the tmux method, or use WizBot Updater to run WizBot.
This method is a bit more complex and involved, but comes with the added benefit of better error logging and control over what happens before and after the startup of WizBot.
- Access the directory where
w-install.shandwizbotis located. - Use the following command to create a service that will be used to execute
WizBotRun.bash:echo "[Unit] Description=WizBot service After=network.target StartLimitIntervalSec=60 StartLimitBurst=2 [Service] Type=simple User=$USER WorkingDirectory=$PWD ExecStart=/bin/bash WizBotRun.bash #ExecStart=./wizbot/WizBot Restart=on-failure RestartSec=5 StandardOutput=journal StandardError=journal SyslogIdentifier=WizBot [Install] WantedBy=multi-user.target" | sudo tee /etc/systemd/system/wizbot.service - Make the new service available:
sudo systemctl daemon-reload - Use the following command to create a script that will be used to start WizBot:
cat <<EOF > WizBotRun.bash #!/bin/bash export PATH="$HOME/.local/bin:$PATH" is_python3_installed=\$(command -v python3 &>/dev/null && echo true || echo false) is_yt_dlp_installed=\$(command -v yt-dlp &>/dev/null && echo true || echo false) [[ \$is_python3_installed == true ]] \\ && echo "[INFO] python3 path: \$(which python3)" \\ && echo "[INFO] python3 version: \$(python3 --version)" [[ \$is_yt_dlp_installed == true ]] \\ && echo "[INFO] yt-dlp path: \$(which yt-dlp)" echo "[INFO] Running WizBot in the background with auto restart" if [[ \$is_yt_dlp_installed == true ]]; then yt-dlp -U || echo "[ERROR] Failed to update 'yt-dlp'" >&2 fi echo "[INFO] Starting WizBot..." while true; do if [[ -d $PWD/wizbot ]]; then cd "$PWD/wizbot" || { echo "[ERROR] Failed to change working directory to '$PWD/wizbot'" >&2 echo "[INFO] Exiting..." exit 1 } else echo "[WARN] '$PWD/wizbot' doesn't exist" >&2 echo "[INFO] Exiting..." exit 1 fi ./WizBot || { echo "[ERROR] An error occurred when trying to start WizBot" >&2 echo "[INFO] Exiting..." exit 1 } echo "[INFO] Waiting 5 seconds..." sleep 5 if [[ \$is_yt_dlp_installed == true ]]; then yt-dlp -U || echo "[ERROR] Failed to update 'yt-dlp'" >&2 fi echo "[INFO] Restarting WizBot..." done echo "[INFO] Stopping WizBot..." EOF
With everything set up, you can run WizBot in one of three modes:
- Auto-Restart Mode: WizBot will restart automatically if you restart it via the
.diecommand.- To enable this mode, start the service:
sudo systemctl start wizbot
- To enable this mode, start the service:
- Auto-Restart on Reboot Mode: In addition to auto-restarting after
.die, WizBot will also start automatically on system reboot.- To enable this mode, run:
- Standard Mode: WizBot will stop completely when you use
.die, without restarting automatically.- To switch to this mode:
- Stop the service:
sudo systemctl stop wizbot - Edit the service file:
sudo <editor> /etc/systemd/system/wizbot.service - Modify the
ExecStartline:- Comment out:
ExecStart=/bin/bash WizBotRun.bash - Uncomment:
#ExecStart=./wizbot/WizBot
- Comment out:
- Save and exit the editor.
- Reload systemd:
sudo systemctl daemon-reload - Disable automatic startup:
sudo systemctl disable wizbot - Start WizBot manually:
sudo systemctl start wizbot
- Stop the service:
- To switch to this mode:
///