问题标签 [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 回答
8128 浏览

python - Telethon, how to get an entity?

I started using Telethon to integrate a python app with telegram API. I was able to get it started and send a few messages.

The function for sending messages gets an entity as the first argument. So far I was getting this entity from the get_dialogs function which returns list of entities. I know which group I want to send messages to and don't want to go through get_dialogs every time to get the entity.

So which function can I use to give me an entity to pass it to send message? I am expecting there should be a function which gets a group id (or a similar unique feature from the group) as an input and passes me the entity in response. But so far I wasn't able to locate any function.

0 投票
1 回答
975 浏览

python - Telethon:GetDialogsRequest之类的常用方法在哪里

我可以在Telethon 代码中看到以下导入,但在 Telethon github 存储库中找不到 GetDialogsRequest 和下面提到的其他函数。这些功能在哪里?他们不是电视节目项目的一部分,我应该去别处看看吗?我在 tl 文件夹中看不到任何“功能”模块。

0 投票
1 回答
1135 浏览

python - Telethon:它在哪里存储凭据?

我正在使用Telethon连接到电报 API,现在开发后我需要将项目 api 更改为主帐户。我想知道 Telethon 将凭据存储在哪里,以便我可以删除它们并强制重新验证?

0 投票
3 回答
7132 浏览

python - 在 Telethon python 电报中向联系人发送消息

如何查看我的所有联系人并向他们发送消息?我使用 Telethon(API 电报 python)。

0 投票
4 回答
7606 浏览

python - 在 api 电报 python telethon 中添加新联系人

如何在 Telethon python 中的联系人中保存号码?

添加联系人需要什么模块?

0 投票
2 回答
5996 浏览

python - 我如何在 Telethon 电报中恢复旧会话并再次连接(无需再次发送代码))

我使用这个脚本在 Telethon 中连接和创建会话

有了这个鳕鱼,我可以很好地登录这个号码电报并创建文件:+15159947451.session。

现在我关闭并断开连接,我怎么能用这个文件+15159947451.session再次登录这个号码。

我使用此代码,但此代码有错误:

但我有这个错误

0 投票
1 回答
4039 浏览

python - 如何使用 Telethon 库发送带有 @ID 电报的消息

我想用 Telethon 发送消息,但我没有这个电话号码。我只有@username 电报。使用此代码,我可以为我的联系电话发送消息:

但我想向@username Telegram 发送消息

0 投票
2 回答
2544 浏览

python - 我如何使用 Telethon API python 在我的频道中添加我的联系人

这是我的频道的信息:

我有 3 个联系人:

我不知道如何使用此代码:

什么是 chat_id ?和 user_to_add ?

当我使用此代码时

我看到这个错误

0 投票
1 回答
4825 浏览

python - 在 python telethon 中加入频道的最简单方法

我阅读了 Telethon 文档以检索用户名加入频道。经过一些尝试,我写了这段代码:

此代码工作正常,但我想知道是否有更好或更简单的方法?

0 投票
1 回答
861 浏览

python - Python - Telethon 搜索(Telegram API for python)

如何在特定频道\聊天中进行文本搜索?

在应用程序和网络客户端中,您可以使用文本和日期范围进行搜索,

你会得到结果列表+计数器。

有没有我可以调用的方法?