在使用 nonebot 自带的 logger 写入 ERROR 级别以上的日志时,会自动发送至钉钉机器人
Project description
nonebot-plugin-dingtalk-logger
✨ 将错误日志推送至钉钉机器人的 NoneBot 插件 ✨
📖 介绍
在使用 nonebot 自带的 logger 写入 ERROR 级别以上的日志时,会自动发送至钉钉机器人
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-dingtalk-logger
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-dingtalk-logger
pdm
pdm add nonebot-plugin-dingtalk-logger
poetry
poetry add nonebot-plugin-dingtalk-logger
conda
conda install nonebot-plugin-dingtalk-logger
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_dingtalk_logger"]
⚙️ 配置
在 nonebot2 项目的.env文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| DINGTALK_TOKEN | 是 | 无 | 调用接口的凭证,钉钉提供的 Webhook 链接中 access_token 的值 |
| DINGTALK_SECRET | 否 | "" |
安全密钥,安全设置项选择了加签后,提供的 SEC 开头的字符串 |
| DINGTALK_KEYWORDS | 否 | [] |
自定义关键词,创建机器人时在安全设置项填入的所有关键词 |
| DINGTALK_TIMEOUT | 否 | -1 |
全局请求超时时间,值为正时生效 |
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_dingtalk_logger-0.0.2.tar.gz.
File metadata
- Download URL: nonebot_plugin_dingtalk_logger-0.0.2.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebb81a5e080cd338e1706fc8a2ee70ff721cf549084c0f6e5fcf45ff254c511b
|
|
| MD5 |
94d49ca52079116bf18cb367ee7b96d6
|
|
| BLAKE2b-256 |
f8d467b9110457192d3289a47b0078886266527b300fa3ced3c6976c714798d2
|
File details
Details for the file nonebot_plugin_dingtalk_logger-0.0.2-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_dingtalk_logger-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4d33b5bff3a3e4a3cb781c0578197406ab6bdba3b709ec33efbd9e7f815ee68
|
|
| MD5 |
e78cdd5485b4675c1faaaeecb5536899
|
|
| BLAKE2b-256 |
c4f700bf9fa2084b5b853fa2553581f72ceff41338e5aa93525cf90fdb72ad59
|