Push message to from anywhere to your bot through webhook.
Project description
nonebot-plugin-report
Push message from anywhere to your bot through webhook.
功能
该插件提供了一个位于 /report
的路由,通过此路由可向 bot 推送消息,实现消息推送机器人的功能
使用
webhook template
{
"token": "your token here",
"title": "report title",
"content": "report content",
"send_to": "send to"
}
字段
token
: 令牌,当与设置的 REPORT_TOKEN
相同时才会推送消息,否则返回 403
title
: 消息标题
content
: 消息内容,* 必需字段
send_to
: 推送对象。若为 null
则推送给所有超管;若为字符串则将其视为推送对象 user_id;若为字符串列表同上
配置
REPORT_TOKEN
: 令牌,若不设置则不会进行验证,即所有人都可以触发 webhook
REPORT_ROUTE
: 路由,默认为 /report
,若与其它路由冲突可以更换该值
其它
- 应向路由发送 POST 请求
- 仅支持发送纯文本消息
使用例
python
import requests
data = {'token': '...', 'content': '...'}
requests.post('http://127.0.0.1:8080/report', json=data)
curl
curl -L -X POST \
-d '{"token": "...", "content": "..."}' \
-H "Content-Type: application/json" \
-- http://127.0.0.1:8080/report
todo
- 支持设置消息模板
- 支持使用 GET 触发
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nonebot-plugin-report-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e59fadd843903a87d156580d45ce2a854e438862ed4fe3e515520ae547f7cf20 |
|
MD5 | 3c827c83274702c390d4be6d5635ee13 |
|
BLAKE2b-256 | 1927620d196a7e99d84b37918c0d0ff2cbcbe321a478608c2504b032139e1c4b |
Close
Hashes for nonebot_plugin_report-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e10bd6e0b3efda95656c0de1d4db3389ef4a7815fd7f9c22f67fe4ee0e9ec16 |
|
MD5 | 038455ffafe7cb4671d49ad372b7265d |
|
BLAKE2b-256 | 1ea0ad3f7d0ce4c666f26d549513ddddda59fcebc4e49f0fd98e1427253ef61a |