gpt4 book ai didi

python - Telethon 问题,需要从 channel 读取消息

转载 作者:行者123 更新时间:2023-12-05 08:07:09 32 4
gpt4 key购买 nike

我在这里阅读了很多答案并尝试了他们的代码,但我无法让示例为我工作,我不明白为什么。

我想从 Telegram channel 捕获消息,但没有一个 telehon 方法适合我...

我正在使用 telethon,但如何使用并不重要。我只需要捕获这些消息。

from telethon import TelegramClient, events,utils
from telethon.tl.functions.messages import GetFullChatRequest
from telethon.tl.functions.messages import GetHistoryRequest
from telethon.tl.functions.channels import GetChannelsRequest
from telethon.tl.functions.contacts import ResolveUsernameRequest
from telethon.tl.types import PeerUser, PeerChat, PeerChannel , sync
import re


client = TelegramClient('session_name', api id, api hash )
client.start()
my_self=client.get_me()
print(myself)

这是我得到的输出:

 C:/Users/Riccardo/Desktop/yobitpumpR.py:15: RuntimeWarning: coroutine 
'AuthMethods._start' was never awaited

C:/Users/Riccardo/Desktop/yobitpumpR.py:19: RuntimeWarning: coroutine
'get_me' was never awaited
<coroutine object get_me at 0x00000083F93E9410>

我应该如何进行?

最佳答案

https://telethon.readthedocs.io/en/latest/basic/quick-start.html这是非常有帮助的,它从头到尾都经历过

关于python - Telethon 问题,需要从 channel 读取消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57084901/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com