{"id":28092690,"url":"https://github.com/vlymar-dev/channel-admin-bot","last_synced_at":"2025-05-13T13:35:47.248Z","repository":{"id":289622791,"uuid":"868225381","full_name":"vlymar-dev/channel-admin-bot","owner":"vlymar-dev","description":"Chanael Admin Bot — is a simple Telegram bot designed for managing content and users in a Telegram channel.","archived":false,"fork":false,"pushed_at":"2024-10-12T20:55:19.000Z","size":4449,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T07:53:14.442Z","etag":null,"topics":["admin-panel","aiogram","babel","flake8","postgresql","postmaker","python","ruff-python","sqlalchemy","telegram-bot","telegram-channel","telegram-helper"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vlymar-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-05T19:55:17.000Z","updated_at":"2025-01-17T20:00:03.000Z","dependencies_parsed_at":"2025-04-24T07:53:21.482Z","dependency_job_id":"38a78e3a-d4d5-483d-87df-75c25a9a40ea","html_url":"https://github.com/vlymar-dev/channel-admin-bot","commit_stats":null,"previous_names":["vlymar-dev/channel-admin-bot"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlymar-dev%2Fchannel-admin-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlymar-dev%2Fchannel-admin-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlymar-dev%2Fchannel-admin-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlymar-dev%2Fchannel-admin-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlymar-dev","download_url":"https://codeload.github.com/vlymar-dev/channel-admin-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253950818,"owners_count":21989413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin-panel","aiogram","babel","flake8","postgresql","postmaker","python","ruff-python","sqlalchemy","telegram-bot","telegram-channel","telegram-helper"],"created_at":"2025-05-13T13:35:46.504Z","updated_at":"2025-05-13T13:35:47.235Z","avatar_url":"https://github.com/vlymar-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# channel-admin-bot\n[![Python](https://img.shields.io/badge/Python-3.12.2-3776AB?style=flat\u0026logo=Python\u0026logoColor=yellow)](https://www.python.org/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16.3-336791?style=flat\u0026logo=PostgreSQL\u0026logoColor=white)](https://www.postgresql.org/)\n[![SQLAlchemy](https://img.shields.io/badge/SQLAlchemy-2.0-D71F00?style=flat\u0026logo=sqlalchemy\u0026logoColor=white)](https://www.sqlalchemy.org/)\n[![aiogram](https://img.shields.io/badge/aiogram-3.13.1-3776AB?style=flat\u0026logo=telegram\u0026logoColor=white)](https://aiogram.dev/)\n[![Ruff](https://img.shields.io/badge/Ruff-0.6.9-FCC21B?style=flat\u0026logo=ruff\u0026logoColor=white\"/)](https://github.com/astral-sh/ruff)\n[![Ruff](https://img.shields.io/badge/Babel-2.16-F9DC3E?style=flat\u0026logo=babel\u0026logoColor=white)](https://github.com/astral-sh/ruff)\n[![Flake8](https://img.shields.io/badge/flake8-checked-blueviolet?style=flat)](https://flake8.pycqa.org/en/latest/)\n\n**Admin Bot** —  is a simple and user-friendly Telegram bot designed for efficient management of content and users within a Telegram channel.\nThe project is built using Python 3.12.2, leveraging `aiogram` for seamless interaction with the Telegram API, \n`asyncpg` for efficient asynchronous database operations, `Babel` for easy localization, \nand `SQLAlchemy` for robust database modeling with `PostgreSQL`. \nThis combination ensures high performance, scalability, and ease of use for administrators and content managers.\n\n![Admin Bot](./img/image.png)\n\n## Table of Contents\n - [Key Features 🎯](#Key-Features)\n - [Installation and Setup ⚙️](#Installation-and-Setup)\n - [Project Structure 🗂️](#Project-Structure)\n - [Makefile Commands 🛠️](#Makefile-Commands)\n - [Adding New Languages 🌐](#Adding-New-Languages)\n - [Future Plans 🚀](#Future-Plans)\n - [Contributing 💡](#Contributing)\n - [License 🏷️](#License)\n - [Author 👤](#Author)\n\n## Key Features:\n- **Post Management:** *View, create, edit, and delete posts.*\n  - Administrators can maintain full control over content, ensuring that all posts meet the desired standards before publication\n- **Publish to Channel:** *Publish posts directly to a Telegram channel.*\n  - Content managers can quickly share updates or announcements with their audience, streamlining communication.\n- **User Roles:** *Assign and manage roles like administrator or content manager.*\n  - Manage permissions directly through the bot, ensuring that access to functions is given only to authorized users.\n- **Localization:** *Supports English and Russian (en/ru).*\n  - Ready to expand to additional languages, offering flexibility for different user bases and international audiences.\n\n## Installation and Setup\n**Requirements:**\n- Python 3.12.2\n- PostgreSQL 16.3\n\n***Install dependencies from `requirements.txt`***\n\n### Installation Steps\n#### Clone the repository:\n```sh\ngit clone https://github.com/dev-lymar/channel-admin-bot.git\n```\n#### Create and activate a virtual environment:\n```sh\npython3 -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n#### Install dependencies:\n```sh\npip install -r requirements.txt\n```\n#### Create a `.env` file: Copy `.env.example` file:\n```sh\ncp .env.example .env\n```\n#### Edit the `.env` file with your API token and PostgreSQL database details:\n```sh\nAPI_TOKEN=your_bot_token\nADMIN_ID=administrator_ID (For initial setup)\nDB_URL=postgresql+asyncpg://user:password@localhost:5432/database_name\nCHAT_ID=channel_ID_for_publications\n```\n#### Run the bot with automatic translation compilation and migrations:\n```sh\nmake run\n```\n## Project Structure\n```sh\n.\n├── main.py                 # Entry point of the application\n├── config/                 # Configuration files\n│   ├── .env.example        # Example environment variables file\n│   └── bot_config.py       # Bot configuration and settings\n├── db/                     # Database management\n│   ├── db_handler/         # Handlers for posts and user roles\n│   └── models/             # Database models\n├── handlers/               # Command and function handlers for the bot\n│   ├── admin_panel/        # Logic for the admin panel\n│   └── start/              # Start command\n├── locales/                # Localization files\n│   ├── en/                 # English translations\n│   └── ru/                 # Russian translations\n├── keyboards/              # Telegram keyboards for user interaction\n├── states/                 # User state management\n├── requirements.txt        # Project dependencies\n├── README.md               # Project documentation\n└── LICENSE                 # License for project usage\n```\n\n## Makefile Commands\n- `make run`: Runs the bot and compiles translation files `.po` into `.mo`.\n- `make lint`: Checks the code for style compliance using `ruff` and `flake8`.\n\n## Adding New Languages\n1. If there are changes in the text, update the message template (`if not, proceed to step 3`):\n```sh\npybabel extract -k _:1,1t -k _:1,2 -k __ --input-dirs=. -o locales/messages.pot\n```\n2. Update existing locales:\n```sh\npybabel update -d locales -D messages -i locales/messages.pot\n```\n3. Create a new locale (e.g., `uk` for Ukrainian):\n```sh\npybabel init -i locales/messages.pot -d locales -D messages -l uk\n```\n4. Compile translations automatically using `make run` or manually:\n```sh\npybabel compile -d locales -D messages\n```\n\n## Future Plans\n- **Docker Integration**: Implement a Docker file for easier project deployment.\n- **Documentation**: Provide detailed documentation for all modules, including usage examples and possible scenarios.\n- **Role Expansion**: Add more roles and access management capabilities.\n\n## Contributing\nWe welcome contributions from the community! If you want to add new features or fix bugs, please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch: `git checkout -b feature/feature-name`\n3. Make your changes and commit them: `git commit -m 'Added a new feature'`\n4. Push your changes: `git push origin feature/feature-name`\n5. Create a **pull request**.\n\n*Before creating a pull request, make sure your code passes all **ruff** and **flake8** checks.*\n\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Author\nThis project was developed by [dev-lymar](https://github.com/dev-lymar). \nIf you enjoyed the project, please give a star ⭐️ on the [repository](https://github.com/dev-lymar/channel-admin-bot).\n\nIf you have any questions or suggestions, feel free to reach out:\n\n\u003ca href=\"https://t.me/vlymar\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge\u0026logo=telegram\u0026logoColor=white\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"mailto:lymarvolodymyr1@gmail.com\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Gmail-D14836?style=for-the-badge\u0026logo=gmail\u0026logoColor=white\"/\u003e\n\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlymar-dev%2Fchannel-admin-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlymar-dev%2Fchannel-admin-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlymar-dev%2Fchannel-admin-bot/lists"}