Am trying to send a message to a Telegram channel after a new message event is invoked in another. The code i have below utilizes the channel name as the entity but it doesn't work all the time. Any ideas how i would go about it in better and effecient way.
@client.on(events.NewMessage(chats=channel))
async def my_event_handler(event):
values = formatter(event.raw_text)
await client.send_message('destination', template.format(coin=values[0], buy=values[1]))
client.start()
client.run_until_disconnected()