adimania/telegram-xkcd_bot

语言: Python

git: https://github.com/adimania/telegram-xkcd_bot

一个电报聊天机器人,为您提供最新的xkcd漫画
A telegram chat bot to get you the latest xkcd comic
README.md (中文)

电报xkcd_bot

一个电报聊天机器人,让你得到xkcd漫画

这是什么?

这是一个聊天机器人。您可以访问https://web.telegram.org/#/im?p=@xkcd_bot并开始聊天。您可以索取最新的xkcd漫画或随机漫画。如果你知道你最喜欢的xkcd漫画的数量,那么你也可以要求它。

组件

  • image_fetch.py​​:在cron中运行它。这将检查是否发布了新图像。请注意,我使用etcd来存储已解析的RSS源数据。这看起来似乎有点矫枉过正,但想法是添加更多功能,我认为在这种情况下etcd会很方便
  • xkcd.py:一个简单的烧瓶应用程序,它在5001上侦听来自电报的传入webhook,并将图像发送到任何人ping机器人。

去做

  • 得到随机的xkcd
  • 得到编号xkcd
  • 为有兴趣在聊天中投放漫画的用户添加订阅。

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

telegram-xkcd_bot

A telegram chat bot to get you the xkcd comic

What is this?

It is a chat bot. You can go to https://web.telegram.org/#/im?p=@xkcd_bot and start a chat. You can request for latest xkcd comic or a random one. If you know the number of your favorite xkcd comics then you can ask for that as well.

Components

  • image_fetch.py: Run this in cron. This will check if a new image is published or not. Note that I am using etcd to store parsed rss feed data. This may seems like an overkill at the moment but idea is to add more features and I think etcd will be handy in that case
  • xkcd.py: A simple flask app which listens on 5001 for the incoming webhooks from telegram and send image to anyone pings the bot.

To Do

  • get random xkcd
  • get numbered xkcd
  • add subscription for users who are interested in getting comics delivered on the chat.