问题标签 [telethon]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
75 浏览

telethon - Are there any more example regard how to use Updates?

I have been trying to improve my application by incorporating updates. However, the current documentation is very confusing on for example how updates would be structure for a chat or a channel.

Any advice on this topic would be much appreciated. Thank you in advance!

0 投票
1 回答
3565 浏览

python - 无法使用 GetParticipantsRequest(Telethon API)获取 Telegram 频道用户

当我尝试让用户进入我自己的电报频道(我是管理员)时,我正在使用Telethon AP我并在函数 GetParticipantsRequest 中出现权限错误

毫无意义,因为当我对我的一个电报组执行相同的代码例程时,它就像一个魅力。

下面是例程:

0 投票
3 回答
3161 浏览

python-3.x - 如何在 Telethon 中获取电报的频道描述?

我正在使用 Telethon 编写电报客户端。如何获取频道说明?get_entity方法不提供通道描述。

0 投票
1 回答
7366 浏览

python - 从 Telegram 频道下载所有文件

我确实知道如何使用Telethonget_message_history的方法获取所有短信,但我想知道是否有办法下载在 Telegram 频道中发送的所有文件。

0 投票
2 回答
8079 浏览

python - Telethon 库:如何通过电话号码添加用户

我正在研究 Telegram 的 Telethon 库,它可以使用 Telegram API 充当 Telegram 客户端(重要:这是Telegram 客户端 API,而不是 Bot API)。

我需要的功能是创建群聊并在那里邀请用户。当我添加联系人列表中的某个人时,这很好用:

但是,如果我传递的号码不在我的联系人列表中,则会中断(我确定此电话号码已在 Telegram 中注册)

我的怀疑是CreateChatRequest只适用于我PeerUser的s,即这种方法禁止使用非对等电话。

所以问题是,如果他不是我的联系人之一,我如何将某人添加到群聊中?

0 投票
1 回答
83 浏览

python-3.x - 从方法 Python 的输出中获取所需的值

我在 Telethon python3 库中使用了一个方法:“client(GetMessagesRequest(peers,[pinnedMsgId]))”

这个回报:

我只需要消息文本 ------> 测试消息测试

一个人怎么能得到这个?

Telethon 团队说:“这与库无关。您只需要更多 Python 知识,所以请在其他地方询问”

谢谢

0 投票
2 回答
1922 浏览

python - Want to extract pinned messages from the groups/channels on Telegram i am part of using Telethon

I'm using Telethon API Want to extract pinned messages of all the channels i am member. Please guide me with the procedure.

Thank you.

0 投票
2 回答
774 浏览

telegram - Telegram api_hash 应该保密吗?

我想我对 api_id 和 api_hash 到底是什么感到有些困惑。我正在使用 Telethon 制作电报客户端工具。我在 Telethon 文档中读到我应该对我的 api_hash 保密。真的吗?但是,我将如何分发我的源代码?通过将 api_id 和 api_hash 留空?如果是这样的话,那么我可以安全地在分布式二进制文件中使用我的 api_id 和 hash 吗?

0 投票
1 回答
1853 浏览

python - 使用 Telethon 设置@username、名字和姓氏

如何在 Telethon 的帮助下更改usernameFirstNameLastName ?我只找到了启用2F验证的方法client.edit_2fa(new_password='12345')。是否有类似更改用户名、名字和姓氏的东西。

0 投票
1 回答
3170 浏览

python - 使用 Python3 将联系人列表从 CSV 文件导入 Telegram

我正在尝试使用 Python3 从 CSV 文件中导入联系人。

代码运行良好,没有显示任何错误,但联系人没有添加到 Telegram 中。任何想法为什么?

请看下面的代码: