Skip to content

Instantly share code, notes, and snippets.

@yeralexey
yeralexey / pyrogram_forward_to_topic.py
Last active May 11, 2024 21:12
Forward message to certain topic in group, with pyrogram, using raw.
from pyrogram import Client
from pyrogram.types import Message
from pyrogram.raw import functions, types
async def forward_to_topic(
source_channel_id: int, destination_channel_id: int,
forwarded_message_id: int, topic_init_message_id: int, client: Client) -> Message:
"""
Forward a message from one channel to another channel and associate it with a specified topic using raw functions,