Push message to from anywhere to your bot through webhook.
Project description
nonebot-plugin-report
Push message to 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 -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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c83643e725bfb3a79335de6981aa68480d9a6895076506515bffd5e140e29bfe |
|
MD5 | 45b1f3059d11ba216a293af8a1fe9a78 |
|
BLAKE2b-256 | 85f3cbf6b455be72ff0f9991be2f046bdbed49ec8cf162a3d07eba38ecb7300a |
Close
Hashes for nonebot_plugin_report-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00cc65314b90585a3bb161eadda1717ce2b27b669a064dcfecee52a6887008ba |
|
MD5 | ac4405e94b2215b8414a7960d9fd3867 |
|
BLAKE2b-256 | a1ead6db05b20fc937cec2d3896db1c6bfa44a57781c761c13e5c00cfd444c85 |