如何在没有机器人的情况下使用 Telegram API? [英] How do I use Telegram API without a bot?
问题描述
我不需要回复机器人.
我只想进行只读调用以读取频道历史记录.可能我需要†他的方法 https://core.telegram.org/method/messages.getHistory 但文档 https://core.telegram.org/api#getting-started甚至没有解释协议.
我所理解的协议是非常自定义的,我应该使用一些最小的包装器,但是我设法找到了指向 https://github.com/atipugin/telegram-bot-ruby 但我不需要机器人.
I don't need a reply bot.
I want to just make a read-only call to read the channel history. Probably I need †he method https://core.telegram.org/method/messages.getHistory but documentation https://core.telegram.org/api#getting-started does not even explain the protocol.
The protocol as I understand is pretty custom and I should use some minimal wrapper but all examples/articles I've managed to find link to https://github.com/atipugin/telegram-bot-ruby but I don't need a bot.
推荐答案
要在没有机器人的情况下使用 Telegram
,您应该使用 Telegram
低级协议 MTProto代码>.有用于 Python 的
MTProto
库,JavaScript 甚至 PHP一>.查看使用这些库获取聊天记录的示例此处、这里和这里
To use Telegram
without a bot you should work with Telegram
low-level protocol MTProto
. There are MTProto
libraries for Python, JavaScript and even for PHP. See examples of getting chat history with those libraries here, here and here
但似乎没有 Ruby
gem
用于此 - 运气不好,您应该创建 MTProto
Ruby
gem
你自己,或者把这个函数移动到另一个用具有 MTProto
库的语言编写的服务.
But it seems that there is no Ruby
gem
for this - bad luck, you should either create MTProto
Ruby
gem
yourself, either move this functional to another service written in language that has MTProto
library.
这篇关于如何在没有机器人的情况下使用 Telegram API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!