69 lines
1.4 KiB
Markdown
69 lines
1.4 KiB
Markdown
# Brahmos
|
|
|
|
Brahmos is a bot built using **discord.py**, designed for interacting with politics and war API.
|
|
|
|
---
|
|
|
|
## Tech Stack
|
|
|
|
- **Language:** Python 3.11+
|
|
- **Library:** [discord.py](https://discordpy.readthedocs.io/)
|
|
- **Database (optional):** asyncpg / PostgreSQL (for persistent storage)
|
|
- **Hosting:** Oracle Cloud / Local
|
|
|
|
---
|
|
|
|
## Installation
|
|
|
|
### 1. Clone the repository
|
|
```bash
|
|
git clone https://git.sudobh.space/sudobh/brahmos.git
|
|
cd brahmos
|
|
```
|
|
|
|
### 2. Create a virtual enviornment
|
|
```bash
|
|
uv venv --python 3.11
|
|
```
|
|
|
|
### 3. Install Dependencies
|
|
```bash
|
|
uv pip install -r requirements.txt
|
|
````
|
|
|
|
### 4. Install pm2
|
|
- [Install Nodejs](https://nodejs.org/en/download)
|
|
```bash
|
|
sudo npm install -g pm2
|
|
```
|
|
|
|
### 5. Create config file for the bot
|
|
create a file named bot.config.js
|
|
```js
|
|
module.exports = {
|
|
apps : [
|
|
|
|
{
|
|
name : 'brahmos',
|
|
script: './brahmos.py',
|
|
cwd: './brahmos',
|
|
interpreter: '/home/user/brahmos/.venv/bin/python',
|
|
env:{
|
|
TOKEN: "BOT token",
|
|
pnwBOTKEY: "API KEY",
|
|
pnwAPIKEY: "API KEY",
|
|
|
|
}
|
|
}
|
|
|
|
]
|
|
}
|
|
```
|
|
- replace path `/home/user/brahmos` with your system's path
|
|
- set the tokens for [discord bot](https://www.writebots.com/discord-bot-token/) and [pnw API](https://politicsandwar.com/pwpedia/article/what-is-the-api).
|
|
|
|
### 6. Start pm2 process
|
|
```bash
|
|
pm2 start bot.config.js
|
|
```
|