Local / Vps Deploy

Requirements

  • Debian Based Vps (Ubuntu etc.)

  • Python 3.10+

1

Upgrade and Update:

sudo apt-get update && sudo apt-get upgrade -y
2

Installing Required Packages:

sudo apt-get install python3-pip ffmpeg -y
3

Setting up PIP

sudo pip3 install -U pip
4

Installing Node

curl -fssL https://deb.nodesource.com/setup_20.x | sudo -E bash - \
&& sudo apt-get install nodejs -y \
&& sudo npm i -g npm
5

Clone the Repository

git clone https://github.com/xbitcode/StrangerMusicBot \
&& cd StrangerMusicBot
6

Install tmux

sudo apt-get install tmux
7

Create a tmux session

creating a tmux session will make the bot run in backgroud , even if you close the application.

tmux new -S stranger
8

Setup Virtual Enviroment.

python -m venv .venv
9

Activate Venv and Install Requirements

source .venv/bin/activate \
&& pip3 install -U -r requirements.txt
10

Create .env with sample.env

cp sample.env .env
vi .env

Edit .env with your vars

Edit .env with your values or you can simple copy a config from here and paste it to your notepad, then edit and paste there.

Press I button on keyboard to start editing.

Press Ctrl + C once you are done with editing vars and type :wq to save .env or :qa to exit editing.

11

Start the bot

bash start
12

Finally Exit from Tmux session

Ctrl + b d

Stopping the bot

1

Launch the tmux session

  • Launch the tmux session which have created during stating of the bot

  • Example: my session name was starnger

tmux a -t stranger
2

Stop the bot

  • Option 1: Ctrl + c

  • Option 2: Forcefully terminate the bot Ctrl + \

  • Option 3: Forcefully terminate the process

pkill -9 python
3

Exit from tmux session

Ctrl + b d

Last updated