Skip to content

Proxy Messages for Aiogram

A library implementing a simple way to proxy messages from a bot to a selected channel-forum

PyPI PyPI - Python Version GitLab last commit Docs

Test coverage Downloads GitLab stars

Functionality

Installation

pip install proxy-messages-aiogram

Quick start

Mode details in example.

from aiogram import Bot, Dispatcher

from proxy_messages_aiogram.proxy_managers import ProxyManager
from proxy_messages_aiogram.storages.sqlite_storage import SQLiteStorage

dp = Dispatcher()

proxy_manager = ProxyManager(
    SQLiteStorage(),
    {TARGET_TG_CHAT_ID},
)

@dp.message(proxy_manager.proxy_magic_filter)
async def proxy_messages_handler(message: Message) -> None:
    await proxy_manager.proxy(message)


@dp.message(proxy_manager.answer_magic_filter)
async def answer_messages_handler(message: Message) -> None:
    await proxy_manager.answer(message)

Contribute

Issue Tracker: https://gitlab.com/rocshers/python/proxy-messages-aiogram/-/issues
Source Code: https://gitlab.com/rocshers/python/proxy-messages-aiogram

Before adding changes:

make install-dev

After changes:

make format test