AS
Size: a a a
AS
AS
<telethon.tl.custom.inlineresult.InlineResult object at 0x10b727d68>
Message(id=1614, to_id=PeerChannel(channel_id=1178763127), date=datetime.datetime(2019, 11, 30, 19, 41, 54, tzinfo=datetime.timezone.utc), message='\u200b🚀Crypto Inc.\n\n⚠️ Warning: Many users reported this account as a scam. Please be careful, especially if it asks you for money.', out=True, mentioned=False, media_unread=False, silent=False, post=False, from_scheduled=False, legacy=False, from_id=855333390, fwd_from=None, via_bot_id=464131652, reply_to_msg_id=None, media=MessageMediaWebPage(webpage=WebPagePending(id=7857226306085820620, date=datetime.datetime(2019, 11, 30, 19, 43, 54, tzinfo=datetime.timezone.utc))), reply_markup=ReplyInlineMarkup(rows=[KeyboardButtonRow(buttons=[KeyboardButtonUrl(text='Перейти в канал', url='http://t.me/btc_crypto_inc')]), KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='▼ Категории', data=b'categories'), KeyboardButtonSwitchInline(text='🔎 Поиск', query='crypto', same_peer=True)])]), entities=[MessageEntityTextUrl(offset=0, length=1, url='https://tgstat.ru/channel/@btc_crypto_inc/searchee-widget.png?v_20191130224ru'), MessageEntityBold(offset=1, length=13), MessageEntityItalic(offset=16, length=111)], views=None, edit_date=None, post_author=None, grouped_id=None)
J
ᔕ
V
client = TelegramClient('name', api_id, api_hash, proxy=proxy)вывод вот такой:
client.start
...
c = Commands(client)
...
@client.on(events.NewMessage())
async def handler(event):
await client.get_me() # it working ok
c.list()
class Commands:
@classmethod
def __init__(cls,client):
cls.client = client
@classmethod
def list(cls):
print('list:')
me = cls.client.get_me()
print(me)
26: RuntimeWarning: coroutine 'get_me' was never awaitedэто без принта await client.get_me() # it working ok
c.list()
<coroutine object get_me at 0x05CAE810>
️️
️️
️️
V
V
@classmethod
async def list(cls):
print('list:')
me = await cls.client.get_me()
print(me)
V
𝖊
️️
V
V
V
V
Е
Е