Skip to main content

The easiest way to proxy messages from a bot to a selected chat-forum

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxy_messages_aiogram-0.1.3.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

proxy_messages_aiogram-0.1.3-py3-none-any.whl (10.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page