介绍
- 可以在bot断开与nonebot2的连接时向指定邮箱发送邮件通知,用来通知是否掉线
安装及更新
第一种方式(不推荐)
- 使用
git clone https://github.com/ZM25XC/BotMailNotice.git指令克隆本仓库或下载压缩包文件
第二种方式(二选一)
- 使用
pip install nonebot-plugin-BotMailNotice来进行安装,使用pip install nonebot-plugin-BotMailNotice -U进行更新 - 使用
nb plugin install nonebot-plugin-BotMailNotice来进行安装,使用nb plugin install nonebot-plugin-BotMailNotice -U进行更新
导入插件
使用第一种方式安装看此方法
-
将
nonebot_plugin_BotMailNotice放在nb的plugins目录下,运行nb机器人即可 -
文件结构如下
📦 AweSome-Bot ├── 📂 awesome_bot │ └── 📂 plugins | └── 📂 nonebot_plugin_BotMailNotice | └── 📜 __init__.py ├── 📜 .env.prod ├── 📜 .gitignore ├── 📜 pyproject.toml └── 📜 README.md
使用第二种方式安装看此方法
- 在
pyproject.toml里的[tool.nonebot]中添加plugins = ["nonebot_plugin_BotMailNotice"]
配置
运行插件前,需要在 nonebot2 项目的.env.prod文件中添加下表中配置项
| 配置项 | 必填 | 值类型 | 默认值 | 说明 |
|---|---|---|---|---|
| username | 是 | str | "" | 邮箱账号 |
| password | 是 | str | "" | 邮箱密码或授权码 |
| hostname | 是 | str | "" | 邮箱服务器地址 |
| port | 是 | int | 465 | 邮箱端口号,ssl模式时为465 |
示例配置
mail_notice='{
"username":"xxx@qq.com",
"password":"qflgxxxxxx",
"hostname":"smtp.qq.com",
"port":587
}'
Metadata
Release files for nonebot-plugin-botmailnotice 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nonebot-plugin-BotMailNotice-0.0.3.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nonebot_plugin_botmailnotice-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / nonebot-plugin-BotMailNotice-0.0.3.tar.gz
| Download URL | nonebot-plugin-BotMailNotice-0.0.3.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25e4aacc00979d3399face8127f8a0b0fecfd17b06157fb2659dbc30f66d3dae
|
|
BLAKE2b-256 checksum How to use checksums |
348333546932f5dd474adfa2c60e7f567dbcd6c27eb7f69aa21ee7e375410118
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.0
|
Release files / nonebot_plugin_botmailnotice-0.0.3-py3-none-any.whl
| Download URL | nonebot_plugin_botmailnotice-0.0.3-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2103ab211a2ea327734dd5c619b7e6217d8f16d362e9da85c708ede6c267cb9f
|
|
BLAKE2b-256 checksum How to use checksums |
5c70f648921e27407e0e7ba19781d7cace629308d9ec26e4e3d0d1b58ecd64fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.0
|