Skip to content
This repository was archived by the owner on Oct 15, 2022. It is now read-only.

fanaffg/tgbot-thepaper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thepaper telegram bot

获取澎湃新闻热点新闻资讯。

使用

机器人 URL:澎湃新闻

频道 URL:澎湃热点

频道每日 8 点及 20 点发送最新今日热点新闻。

Bot 命令

  • /get_day - 获取今日热点新闻
  • /get_days - 获取三天热点新闻
  • /get_week - 获取这周热点新闻
  • /get_day_topic - 获取今日热点话题
  • /get_days_topic - 获取三天热点话题
  • /get_week_topic - 获取这周热点话题
  • /get_comment - 获取今日热评
  • /get_answer- 获取热点问答

配置

  • Token:机器人 TOKEN,通过@BotFather获取。
  • Allow_User:执行特权命令的允许用户(如重启 Bot),元素为 UserID(在getupdates方式有效)。

说明

  1. getupdates文件夹:使用 getUpdates 方式, 通过使用长轮询不断接受传入的更新(updates),返回更新对象数组。

  2. thepaper_bot文件夹:使用 Webhook 方式,当有请求发送到机器人,机器人将 POST 一个请求到 webhook url,POST 内包含请求的 JSON 数据。

    1. 设置 webhook

      curl https://api.telegram.org/bot{TOKEN}/setwebhook?url={URL}
    2. 查看 webhook 信息

      curl https://api.telegram.org/bot{TOKEN}/getwebhookinfo
    3. 删除 webhook

      curl https://api.telegram.org/bot{TOKEN}/deletewebhook
  3. 即时预览(Instant View)

    原始 URL:https://www.thepaper.cn/newsDetail_forward_5442188

    使用即时预览 URL:https://t.me/iv?url=https://www.thepaper.cn/newsDetail_forward_5442188&rhash=71b085e544938c

About

澎湃新闻(thepaper news) telegram bot.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages