https://github.com/grachale/telegram_bot_ads
The script defines a Telegram bot that allows users to schedule and manage advertisements. It utilizes the Telebot library for the Telegram Bot API, Schedule for scheduling tasks, and psycopg2 for interacting with the PostgreSQL database.
https://github.com/grachale/telegram_bot_ads
json postgresql psycopg2 python scheduling telebot telegram-bot thread
Last synced: 3 months ago
JSON representation
The script defines a Telegram bot that allows users to schedule and manage advertisements. It utilizes the Telebot library for the Telegram Bot API, Schedule for scheduling tasks, and psycopg2 for interacting with the PostgreSQL database.
- Host: GitHub
- URL: https://github.com/grachale/telegram_bot_ads
- Owner: grachale
- Created: 2024-01-12T19:52:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-12T19:56:17.000Z (over 1 year ago)
- Last Synced: 2025-01-13T01:20:40.059Z (9 months ago)
- Topics: json, postgresql, psycopg2, python, scheduling, telebot, telegram-bot, thread
- Language: Python
- Homepage:
- Size: 280 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Telegram Bot Server for Scheduled Adds
The script `app/src/main.py` defines a Telegram bot that allows users to schedule and manage advertisements. It utilizes the Telebot library for the Telegram Bot API, Schedule for scheduling tasks, and psycopg2 for interacting with the PostgreSQL database.
## Features
- User authentication
- Creating and scheduling new advertisements
- Displaying user and advertisement information
- Deleting users or advertisements
- Storing adds and users in PostgreSQL database.## Dependencies
- Telebot
- Schedule
- Psycopg2
- Tabulate## How to Run Server
To run the script go to the `app/src` directory, provide it with a configuration file path as a command-line argument:
```bash
python main.py
```The configuration file should be in JSON format and include the token for the Telegram Bot API, as well as the configuration for the PostgreSQL database.
Example of usage (must be executed in the `app/src` directory):```bash
python main.py ../configs/config.json
```## How to Run Tests
```bash
pytest
```
Before running the server and tests, ensure you have the required dependencies installed, started PostgreSQL database with correct configuration as you have provided as a command-line argument - .