Skip to main content

Cloudfare R2 customer service plugin, used to connect the R2 storage bucket

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-cfr2

✨ cloudfare R2 客服端插件,用于连接R2存储桶 ✨

license pypi python

📖 介绍

cloudfare R2 客服端插件,用于连接R2存储桶,可以用作图床。

欢迎提issue。

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-cfr2
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-cfr2
pdm
pdm add nonebot-plugin-cfr2
poetry
poetry add nonebot-plugin-cfr2
conda
conda install nonebot-plugin-cfr2

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_cfr2"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

配置项 必填 默认值 说明
access_key 应用密钥ID
secret_key 应用密钥
bucket_name 桶名
region 地区
endpoint_url 自定义节点(请以https开头)(非Amazon必填)
custom_domain 自定义域名(请以https开头)

🎉 使用

from nonebot import require

require("nonebot_plugin_cfr2")

from nonebot_plugin_cfr2 import uploader

# 上传文件
uploader.upload_file(str(image_file_path))
# 上传字节
uploader.upload_file_bytes(image_file_bytes, "jpg")
# 根据url上传文件
uploader.upload_file_from_url(image_url)

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

nonebot_plugin_cfr2-0.1.4.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_cfr2-0.1.4-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_cfr2-0.1.4.tar.gz.

File metadata

  • Download URL: nonebot_plugin_cfr2-0.1.4.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for nonebot_plugin_cfr2-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7926c6f0ddbd93873062b63d44992122038fb6269643a5f725e2384d4ad3c75b
MD5 d5865339606fe5c89d98bbd79067f0b8
BLAKE2b-256 bf82fa2f7dde1e2ac81e1c84d1a5e121c39bdc11de3b1925c764d1bb3c0c29df

See more details on using hashes here.

File details

Details for the file nonebot_plugin_cfr2-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_cfr2-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e30d75165f8c3570f7df7baf60f24c4c1b4a502ec443e0f0067005502f75bcf4
MD5 11d028a6e857727b71630b3919be389a
BLAKE2b-256 05fa845b697f5cef10ea033759e07ffebbbb28cd836fd3c56d8bcf7680a43699

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page