Skip to main content

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

nonebot-plugin-filehost-0.1.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_filehost-0.1.0-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

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