问题标签 [tdlib]

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 回答
177 浏览

java - tdlib:GetBasicGroupFullInfo 返回“未找到组”错误

我想从 Telegram 的组中获取所有用户(用户 ID 和用户名)。我使用tdlib。我通过方法getChats收到的组 ID 。当我将收到的 ID 传递给GetBasicGroupFullInfo方法时- 我收到错误响应:

我做错了什么?以及如何从电报组获取所有用户的用户名和用户名?

0 投票
0 回答
414 浏览

node.js - Telegram 无法在节点 js 中导入联系人

使用电话号码导入 excel 并尝试向所有号码发送相同的消息。我在节点 js 中使用“tdlib”作为电报 API。节点版本 10.16。我总是收到以下错误

这是我的代码

在节点 js 中调用上述函数

在这种方法之后,我正在尝试发送消息。我的代码执行在这里停止。帮我解决这个问题。

0 投票
0 回答
211 浏览

ionic-framework - 可以用 Ionic 构建 Telegram 客户端吗?

我想使用 Tdlib 使用 Ionic 制作 Telegram 客户端,即构建到 Web、iOS 和 Android。

我已经让 tdlib 在本地运行,但不清楚 tdlib 将如何包含在已编译的 Ionic 应用程序中,或者是否可以不编写 cordova 插件。

有没有这方面的例子?

0 投票
1 回答
545 浏览

android - 如何将 tdlib 添加到 android studio 项目

我正在尝试将 TDlib 添加到我的 android studio 项目中,但我不能。在 core.telegram.org/tdlib 中只是告诉我使用 android 预构建库,但没有说明如何将其添加到现有项目以开始构建自定义客户端。如果我用 android studio 打开解压缩的 tdlib,它会显示为一个有效的项目结构,但缺少 graddle 文件,如果我选择自动添加丢失的文件,它会在 graddle 同步中失败,ERROR: Plugin with id 'com.android.library' not found. 我被这个卡住了

我正在使用 windows 10 build 1903、android studio 3.5 和可在电报网站上下载的最新 zip

0 投票
0 回答
397 浏览

go - Go build tdlib 非常慢的重建

我正在为 tdlib 使用 2 个 go 绑定:每次我在 main.go 文件中更改一行时,每个绑定都会构建 270 秒。TDLib 是使用 gcc 构建的。每次换行时有没有办法不重建它?我正在使用 go build -v main.go 命令。我使用https://tdlib.github.io/td/build.html中的指南构建 TDLib

我正在构建的示例是

然后我使用 time go build -v main.go,得到了这个结果:

是否可以同时构建(不是使用 1 个 CPU)?在重建期间它得到相同的结果,因为我添加了一些新行。我希望它的构建速度比 257 快得多,只需换行即可。

0 投票
1 回答
1580 浏览

architecture - 15 万用户同时使用的电报机器人架构

我将创建一个电报机器人来同时(每秒)处理 15 万用户。

我将使用 TDLib(因为我确实想面对 Telegram Bot API 每秒约 30 条消息的限制)。

以前我总是使用 Telegram Bot Webhook。我注册了 webhook 以指向我的服务器。我的服务器处理来自 Telegram 的请求并向用户发送消息。我的服务器上没有任何负载。最大加载为每秒 10 或 30 个用户。

现在我将使用 TDLib。所以通过架构进行交互。

交互一、Telegram Webhook + TDLib

它不起作用,因为在 nginx 的日志中,我看到 TDLib 运行时 nginx 没有收到任何 webhook 请求。

交互2. TDLib的几个实例

有用。每个实例都可以发送消息并获取更新。但我担心网络流量,因为每个实例都会获得所有更新。

交互 3. 一个 TDLib 实例(当前选择)

TDLib 的一个实例获取所有更新并将其发送到队列(我们将其称为in.queue)。

我将编写一个程序来处理来自队列in.queue的更新。

队列更新的处理是创建一个响应命令并将其发布到另一个队列(out.queue)。

TDLib 实例监听out.queue并应用命令。


但我想知道在部署到产品之前如何测试我的机器人。

是否有可能以某种方式模拟这种加载(同时有 15 万用户)来测试我的架构?

0 投票
1 回答
335 浏览

go - 使用 go-tdlib 卡在“authorizationsStateWaitPhoneNumber”状态

我正在使用go-tdlib在 Telegram 中收集消息。我尝试修改示例。当我第三次重新启动服务时。它停止工作。所以我打印出消息。它不断地给我authorizationsStateWaitPhoneNumber地位。我什至无法在控制台中输入我的电话号码。下面是代码:

有没有人遇到过这个问题?我究竟做错了什么?

0 投票
1 回答
1786 浏览

telegram - 如何删除 Telegram 应用程序(api_key & api_hash)?

我正在尝试删除电报 api_key 和 api_hash,或者至少重置 api_hash。

但我在此页面中找不到执行此操作的选项https://my.telegram.org/apps

有谁知道如何删除或重置电报api应用程序的api_hash?

0 投票
0 回答
643 浏览

c# - TDLib: Download a file without saving to disk

I am using TDLib to implement my custom Telegram client in C#. When initializing the library, I have to set the folder for the telegram cache files and local databases. Whenever I download a photo with TdApi.DownloadFile, it is saved in that folder, presumably for caching.

Is it possible to disable this, and only receive the file in-memory, as either a Stream or a byte[]?

I understand the benefits of caching, but for security (and storage space) reasons that are specific to my application, I want to completely avoid any caching in the filesystem. I am wiling to sacrifice performance and loading speeds.

There are two possible solutions that I can think of. I could write code that automatically clears the download cache folders on app shutdown and startup, or I could somehow implement what the official desktop client does, and store the cached files in an encrypted format. The first solution is not very good when it comes to security, and I don't know how to implement the second one. So it would be best to just disable the caching.

Is this possible, and if so, how?

0 投票
1 回答
434 浏览

android - 如何使用 API 创建自定义应用电报?

我想构建一个应用程序,它可能只使用 API 继续一个组。有人可以指导我吗?这是一个教育应用程序。