A HTTP static file hosting plugin for NoneBot2, which provides an graceful solution for cross-machine file transfer.
Project description
nonebot-plugin-filehost
NoneBot2 的 HTTP 静态文件托管插件,为跨机文件传输提供了优雅的解决方案
优势
-
跨机器, 跨网络支持, 只要反向WebSocket可以正常连接, 它就可以使用
-
使用临时文件作为中转, 内存占用低
- 临时文件会尝试采用硬链接方式创建, 快速且可靠
- 临时文件在程序退出时会自动删除, 不会永久占用空间
-
自动检测访问来源生成资源URL, 无需手动配置
开始使用
安装插件
- 如果使用了
nb-cli
nb plugin install nonebot-plugin-filehost
-
或者手动安装:
-
使用你的包管理器(如
pip
)安装nonebot-plugin-filehost
:pip install nonebot-plugin-filehost
-
修改
pyproject.toml
文件(推荐)[nonebot.plugins] - plugins = [] + plugins = ["nonebot_plugin_filehost"] plugin_dirs = ["src/plugins"]
-
修改
bot.py
文件, 添加一行:driver = nonebot.get_driver() driver.register_adapter("cqhttp", CQHTTPBot) nonebot.load_from_toml("pyproject.toml") + nonebot.load_plugin('nonebot_plugin_filehost')
-
使用插件
- 请前往示例插件进行查看
开源许可
本项目采用MIT许可
Project details
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-filehost-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80a6847606a51b9d5cfff482925d378cc0d22cf94edd7814ffd42b9c2f1b20e5 |
|
MD5 | 1ef63ce05a8c3d4cd335b812a09b4a92 |
|
BLAKE2b-256 | dc022afefb6d200fdac8e812807a26ad95e22e1e61c48a13e089f048cd290cc9 |
Close
Hashes for nonebot_plugin_filehost-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d1619aa3d2b9220d58ff9db500010f0c491770404eb79a36531e981860eb0e8 |
|
MD5 | 97093edab46407542bf69131a704e2ce |
|
BLAKE2b-256 | 0eba6b4b27eb729d20735ca4990825c42a40d6a5460e40e1f541ad16b05951b9 |