So I'm able to send all the chats of specified group to another group with the help of telethon's telegramclient and events below is my code.
from telethon import TelegramClient, events
api_id = YOUR_ID
api_hash = YOUR_HASH
client = TelegramClient('anon', api_id, api_hash)
@client.on(events.NewMessage(chats=CHAT_ID_A))
async def handle_new_message(event):
await client.send_message(CHAT_ID_B, event.raw_text)
Help me to refactor this code in such a way that I can send messages of only selected users from telegram group A to telegram group B