It is my first coding, so I had hart time trying to get message from telegram.
I made this codes searching internet, but the result has lots of information. I want only message like SNXUSDT below.
Maybe it is very basic question but I don't know how. help me please.
from telethon import TelegramClient, events, sync
import config
api_id = '****'
api_hash = '****'
client = TelegramClient('session_read', api_id, api_hash)
@client.on(events.NewMessage)
async def my_event_handler(event):
print('{}'.format(event))
client.start()
client.run_until_disconnected()
result
NewMessage.Event(original_update=UpdateNewChannelMessage(message=Message(id=31, p
eer_id=PeerChannel(channel_id=*****), date=datetime.datetime(2021, 9, 5, 7,
5, 41, tzinfo=datetime.timezone.utc), message='SNXUSDT', out=False, mentioned=Fal
se, media_unread=False, silent=False, post=True, from_scheduled=False, legacy=Fal
se, edit_hide=False, pinned=False, from_id=None, fwd_from=None, via_bot_id=None,
reply_to=None, media=None, reply_markup=None, entities=[], views=1, forwards=0, r
eplies=None, edit_date=None, post_author=None, grouped_id=None, restriction_reaso
n=[], ttl_period=None), pts=32, pts_count=1), pattern_match=None, message=Message
(id=31, peer_id=PeerChannel(channel_id=******), date=datetime.datetime(2021,
9, 5, 7, 5, 41, tzinfo=datetime.timezone.utc), message='**SNXUSDT**', out=False, ment
ioned=False, media_unread=False, silent=False, post=True, from_scheduled=False, l
egacy=False, edit_hide=False, pinned=False, from_id=None, fwd_from=None, via_bot_
id=None, reply_to=None, media=None, reply_markup=None, entities=[], views=1, forw
ards=0, replies=None, edit_date=None, post_author=None, grouped_id=None, restrict
ion_reason=[], ttl_period=None))