https://github.com/devvsima/jsoner
Return json in response to a message
https://github.com/devvsima/jsoner
aiogram aiogram3 i18n json postgresql redis sqlalchemy sqlite telegram telegram-bot
Last synced: 12 days ago
JSON representation
Return json in response to a message
- Host: GitHub
- URL: https://github.com/devvsima/jsoner
- Owner: devvsima
- License: mit
- Created: 2025-10-03T15:53:47.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-10-03T18:11:35.000Z (3 months ago)
- Last Synced: 2025-10-03T18:20:32.259Z (3 months ago)
- Topics: aiogram, aiogram3, i18n, json, postgresql, redis, sqlalchemy, sqlite, telegram, telegram-bot
- Language: Python
- Homepage: https://t.me/jsoner_bot
- Size: 1.25 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Jsoner
- `Aiogram 3`
- `i18n`
- `Redis`
- `SQLAlchemy`
- `PostgreSQL \ Sqlite`
---
## 📥 How to Install?
### 1. Clone the Repository
First, clone the repository and navigate to its directory:
```bash
git clone https://github.com/devvsima/jsoner.git
cd tgbot
```
### 2. Setting up a virtual environment ".venv"
#### Linux
Install dependencies and activate the virtual environment:
```bash
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
```
#### Windows
Similar steps for Windows:
```bash
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
```
> 💡 Note: The name `.venv` can be changed to anything else you wish.
### 3. Setting environment variable
First, copy the `.env.dist` file and rename it to `.env`:
```bash
cp .env.dist .env
```
Then edit the environment variables file:
```bash
vim .env
# or
nano .env
```
### 4. Bot settings
#### `ADMINS` - Admin IDs
Add admin IDs, separating them with commas
```bash
# example
ADMINS=12345678,12345677,12345676
```
#### `TOKEN` - Bot token from [@BotFather](https://t.me/BotFather)
Add your bot token:
```bash
# example
BOT_TOKEN=123452345243:Asdfasdfasf
```
### 5. Configuring the PostgreSQL database
Set the database connection parameters:
- `DB_NAME` - database name
- `DB_HOST` - database host (default = 'localhost')
- `DB_PORT` - database port (default = `5432`)
- `DB_USER` - database user
- `DB_PASS` - database password
### 6. Configuring Redis
Redis is used for caching and storing session data. Set up the Redis connection parameters in the `.env` file:
- `REDIS_HOST` - Redis server host (default: `localhost`)
- `REDIS_PORT` - Redis server port (default: `6379`)
- `REDIS_DB` - Redis database index (default: `5`)
- `REDIS_URL` - Redis connection URL (optional)
Example:
```bash
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=5
```
Ensure that Redis is installed and running before launching the bot. You can start Redis with:
```bash
redis-server
```
---
Now the bot is ready to run! 🎉