request-bot/README.md

93 lines
2.2 KiB
Markdown
Raw Normal View History

2025-01-07 09:25:51 -05:00
# request-bot
[![Build and Push Docker Image](https://github.com/ihatenodejs/request-bot/actions/workflows/docker.yml/badge.svg)](https://github.com/ihatenodejs/request-bot/actions/workflows/docker.yml)
[![Bump Dependencies](https://github.com/ihatenodejs/request-bot/actions/workflows/bump.yml/badge.svg)](https://github.com/ihatenodejs/request-bot/actions/workflows/bump.yml)
2025-01-07 09:25:51 -05:00
A Telegram bot which takes requests for modules.lol
2025-01-07 12:02:18 -05:00
## 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
2025-01-07 17:52:35 -05:00
```bash
git clone https://git.pontusmail.org/aidan/request-bot.git
2025-01-07 17:52:35 -05:00
```
**Option Two:** Download only needed files
2025-01-07 17:52:35 -05:00
```bash
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
2025-01-07 17:52:35 -05:00
```
You may have to install `wget`, or you could use `curl` instead.
2025-01-07 17:52:35 -05:00
2. **Change variables**
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)
```
2025-01-07 17:52:35 -05:00
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. **Bring up the containers**
2025-01-07 17:52:35 -05:00
```bash
docker compose up -d
2025-01-07 17:52:35 -05:00
```
Please note: `sudo` may be required.
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**
2025-01-07 12:02:18 -05:00
```bash
bun install
```
2025-01-07 12:02:18 -05:00
**OR**
2025-01-07 12:02:18 -05:00
```bash
npm install
```
3. **Change variables**
2025-01-07 12:02:18 -05:00
Copy `.env.example` to `.env` and open the file in a text editor.
2025-01-07 12:02:18 -05:00
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
4. **Start the bot**
2025-01-07 12:02:18 -05:00
```bash
bun index.js
```
2025-01-07 12:02:18 -05:00
**OR**
2025-01-07 12:02:18 -05:00
```bash
node index.js
2025-01-07 12:21:54 -05:00
```