如何通过API从电报组获取消息-Python
问题描述:
我一直在寻找某种方法来侦听和捕获电报gropus提供的新消息。
I was looking for some way in order to listen and catch new message provide by telegram gropus.
我没有找到用于执行此操作的库或API
I have not found libraries or API in order to do this in python.
有人有什么建议吗?
谢谢,
RV
答
有两种方法可以实现您的目标:
There are two ways to achieve your goal:
- 创建机器人。
- 将机器人添加到
- 按照您通常在漫游器中侦听的方式收听消息。
方法2:
我建议的python库: Telethon
Method 2:
My suggested library for python: Telethon
- 以用户(不是机器人)的身份加入所需的组。
- 创建一个简单的客户端at收听新消息。