Answer the question
In order to leave comments, you need to log in
How to fix tegmo or msgs = client.get_messages(tegmo, limit=30) NameError: name 'tegmo' is not defined?
I decided to make a small program. I have this piece of code:
tegmo = dlg
msgs = client.get_messages(tegmo, limit=30)
msgs = client.get_messages(tegmo, limit=30)
NameError: name 'tegmo' is not defined
from telethon import TelegramClient
api_id =
api_hash = ''
client = TelegramClient('', api_id, api_hash)
client.start()
dlgs = client.iter_dialogs()
for dlg in dlgs:
print(dlg.title)
for dlg in dlgs:
if dlg.title == '':
tegmo = dlg
msgs = client.get_messages(tegmo, limit=30)
for msg in msgs:
if msg.reply_markup is not None:
button.data = msg.reply_markup.rows[0].buttons[0].data
message_id = message_id
print(button_data, message_id)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question