class TgClient:
def __init__(self, session_file, api_id, api_hash):
...
client = TelegramClient(self.session_file, self.api_id, self.api_hash)
@client.on(events.NewMessage(incoming=True)
def handler(event):
# some action after reciving a message