nonebot-plugin-gocqhttp-cross-machine-upload-file
为go-cqhttp与nonebot部署于不同机器的系统提供上传群文件、私聊文件的能力。
只适用于FastAPI反向驱动器
用法
from io import StringIO
from nonebot import on_startswith, require
from nonebot.adapters.onebot.v11 import Bot, MessageEvent
require("nonebot_plugin_gocqhttp_cross_machine_upload_file")
from nonebot_plugin_gocqhttp_cross_machine_upload_file import upload_file
@on_startswith("test").handle()
async def handle(bot: Bot, event: MessageEvent):
# 上传指定路径文件
await upload_file(bot, event, "image.png", path="image.png")
# 上传打开的IO流
with StringIO() as f:
f.write("Hello World")
f.seek(0)
await upload_file(bot, event, "hello.txt", f)
# 上传bytes
await upload_file(bot, event, "hello.txt", "Hello World".encode())
配置
callback_host
回调HOST,设置为nonebot所在的主机名/IP。务必保证go-cqhttp所在主机可访问,用于让go-cqhttp下载本机文件。
默认值:127.0.0.1
callback_port
回调端口,保持默认值即可。
默认值:与PORT保持一致即可
Metadata
Release files for nonebot-plugin-gocqhttp-cross-machine-upload-file 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_gocqhttp_cross_machine_upload_file-0.1.5.tar.gz | 3.1 kB | Without provenance | Details for nonebot_plugin_gocqhttp_cross_machine_upload_file-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_gocqhttp_cross_machine_upload_file-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_gocqhttp_cross_machine_upload_file-0.1.5-py3-none-any.whl |
Total release size: 7.6 kB
Release files / nonebot_plugin_gocqhttp_cross_machine_upload_file-0.1.5.tar.gz
| Download URL | nonebot_plugin_gocqhttp_cross_machine_upload_file-0.1.5.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d0b3551748d47e75dc00ff2ef3851acd158655cfcd599731898857aa205d576
|
|
BLAKE2b-256 checksum How to use checksums |
60887800a04be91c9e259f8ed8d543af0b252986abd043e9edf6b8db93b86a2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.10.2 Windows/10
|
Release files / nonebot_plugin_gocqhttp_cross_machine_upload_file-0.1.5-py3-none-any.whl
| Download URL | nonebot_plugin_gocqhttp_cross_machine_upload_file-0.1.5-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce84fe33e70871875ea0dc70922f6b05cdbb741372581e855eebf1ae0554b636
|
|
BLAKE2b-256 checksum How to use checksums |
09acf0e4007625ac21d97342fd6b88e5d65b61f9a29d6fe43f2dad9c7f3c7874
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.10.2 Windows/10
|
Security for nonebot-plugin-gocqhttp-cross-machine-upload-file 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.