diff --git a/README.md b/README.md index 4a46b5a..7b8321c 100644 --- a/README.md +++ b/README.md @@ -1,61 +1,89 @@ # request-bot + A Telegram bot which takes requests for modules.lol -# Setting up and self hosting -## With Docker -1. **Install dependancies** +## Setting up and self hosting + +### Using Docker + +1. **Fetch needed files** + + Pick your preferred option to get the files needed for Docker. Either option is fine, although Git is arguably the best option. + + **Option One:** Clone Git Repo ```bash - bun install + git clone https://git.pontusmail.org/aidan/request-bot.git ``` - **OR** + + **Option Two:** Download only needed files + ```bash - npm install + wget https://git.pontusmail.org/aidan/request-bot/raw/branch/main/docker-compose.yml + wget https://git.pontusmail.org/aidan/request-bot/src/branch/main/.env.example ``` + You may have to install `wget`, or you could use `curl` instead. + 2. **Change variables** - - Copy `.env.example` to `.env` and open the file in a text editor. - + + Copy `.env.example` to `.env` and open the file in a text editor: + + ```bash + cp .env.example .env # Copy .env file + nano .env # Open in nano (or vim, if you prefer) + ``` + Replace `ADMIN_ID` with your Telegram user ID. This will be used for admin-only commands. Replace `BOT_TOKEN` with your Telegram bot token you created through @BotFather -3. **Build Image and Start** +3. **Bring up the containers** ```bash - docker compose up -d --build + docker compose up -d ``` Please note: `sudo` may be required. - You may customize the container with the included `docker-compose.yml` file. -## The "Normal" way -1. **Install dependancies** + You may customize the container with the included `docker-compose.yml` file if needed. + +### Using Node + +1. **Clone repository** + + ```bash + git clone https://git.pontusmail.org/aidan/request-bot.git + ``` + +2. **Install dependencies** ```bash bun install ``` + **OR** + ```bash npm install ``` -2. **Change variables** - +3. **Change variables** + Copy `.env.example` to `.env` and open the file in a text editor. - + Replace `ADMIN_ID` with your Telegram user ID. This will be used for admin-only commands. Replace `BOT_TOKEN` with your Telegram bot token you created through @BotFather -3. **Start the bot** - +4. **Start the bot** + ```bash bun index.js ``` + **OR** + ```bash node index.js ``` - diff --git a/docker-compose.yml b/docker-compose.yml index 90a8e18..e8e7a5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,5 @@ services: request-bot: - build: . - ports: - - "3000:3000" + image: "git.pontusmail.org/aidan/request-bot:latest" volumes: - - .:/app - command: ["bun", "run", "index.js"] \ No newline at end of file + - .env:/app/.env \ No newline at end of file