我最近开始根据 telethon 编写脚本。它唯一要做的是 - 检索视频,来自频道/组的照片,将它们保存到文件夹中。
因此,我决定实际制作一个带有命令的机器人来运行Telethon脚本,该脚本将下载特定数量的文件并将其发送回用户。
听起来很简单,但是当尝试使用Telebot库编写一个机器人时,我遇到了很多问题,然后将运行Telethon脚本。我遇到的错误毫无意义,因为我尝试了太多事情并且遇到了太多不同的错误。
所以我的主要问题是Telebot可以运行Telethon作为一个是同步的,另一个是异步??
如果可以的话 - 是否有任何模板/示例?
如果不能 - 是否有示例/可能仅在Telethon上使用命令编写机器人?
如果不可能,是否有任何建议可以给我我一开始就可以实现我所描述的想法。
感谢大家< 3
I have recently started writing a script based on telethon. The only thing it does is - retriving videos, photos from channel/group, saving them to folder.
So then I have decided to actually make a bot with command to run the telethon script which is going to download specific amount of files and send it back to user.
Sounds simple, however I ran to bunch of issues when tried to use telebot library to write a bot which then is going to run the telethon script. Makes no sense to post here errors I got, as I have tried too many things and got too many different errors.
So my main question is Can Telebot run Telethon function as one is sync and the other async?
If it can - are there any templates/example of such usage?
If it cannot - is there an example/possibility to write the bot with commands only on Telethon?
If non of the above is possible, are there any advices you can give me how can I implement the idea i described at first.
Thanks everyone <3
发布评论
评论(1)
请参阅pyrogram库
pyrogram支持。异步,您可以将此库与 celery> celery 用于自动化任务,而且此库也很容易理解。
See pyrogram library
I think you can write your own code with Pyrogram.
Pyrogram supports asyncio and you can combine this library with celery for automation task and also this library is very easy to understand.