小编Pus*_*kar的帖子

Telethon 版本 1.11.3 与 python 3.7.3 似乎不起作用

在 Telethon 1.11.3 、 python 3.7.3 上尝试以下代码后

from telethon import TelegramClient

api_id = xxx #i give my id
api_hash = xxx##i give my 
client = TelegramClient(name, api_id, api_hash)

async def main():

    # Now you can use all client methods listed below, like for example...
    await client.send_message('me', 'Hello to myself!')

with client:
    client.loop.run_until_complete(main())
Run Code Online (Sandbox Code Playgroud)

我收到错误 RuntimeError: You Must use "async with" 如果事件循环正在运行(即您位于“async def”内部)

python telegram telethon

3
推荐指数
1
解决办法
1170
查看次数

标签 统计

python ×1

telegram ×1

telethon ×1