Skip to main content

QQ聊天二维码插件

Project description

nonebot-plugin-qrcode

  • 本地识别二维码
  • 支持一图片多个二维码
  • 支持多图片(>=0.1.0)
  • 支持回复图片进行识别(>=0.1.0)
  • 支持带遮罩与内嵌图生成二维码(>=0.2.0)

下载&安装

插件本体

pip install -U nonebot-plugin-qrcode

!!!必须要的库 libzbar0

此操作仅在非 Windows 环境下需要进行

docker / ubuntu 等使用 apt

apt install -y libzbar0

centos

dnf install -y zbar/yum install -zbar

在部分 Windows 设备下可能出现的问题

此操作仅在 Windows NT 环境下需要进行

当你真的在使用 Windows Server 作为机器人运行环境的时候,你可能真的不怎么会在意一些常用支持库的安装。
因此,特别是在一些需要蛮多系统支持库的库的运行时,会出现报错;比如出现如下情况:

FileNotFoundError: Could not find module '.\[Python包目录]\pyzbar\libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

这很可能是由于 msvcr 库没有正常安装导致的。请前往 微软 Visual C++ Redistributable Packages for Visual Studio 2013 下载页 下载对应你系统的版本。

使用

以下默认你设置了 COMMAND_START=""

  • scan | 扫码

    扫描一个码,支持多种码。什么种类?试试就知道了。

    • 如果指令后有图片,则直接识别图片
    • 如果没有图片,则会询问图片
    • 如果在指令的回复中含有图片,则会识别回复内容
  • gqr | 生成二维码

    生成二维码,支持图片转链接地址,支持自定义遮罩图片和中央嵌入图片。

    • 指令后的内容为二维码内容。其中图片会转为链接。
    • -e|--embeded 开关控制是否在二维码中心嵌入图片
    • -m|--mark 开关控制是否增加遮罩图片

    注意:
    考虑到部分手机用户无法通过全屏输入的方式在文字中穿插图片,所以当启用 -e 或 -m 开关时,可以在消息末尾提交图片;如果直接穿插在开关后面也是没问题的。但是,如果图片数量与开启的选项开关的数量不符,则会停止生成。当使用 GIF 图像作为内嵌的图片(-e)时,二维码生成会失败。
    如果在开关之后混入了其他不是图像消息的内容,也会视作二维码内容的一部分,生成进二维码中。
    当你只发起指令而不给任何内容时,机器会好心问你讨要二维码内容;但是如果你是在指令后面带了选项开关还不给内容时,机器也不会理你的。

  • pqr (已弃用)

    • 识别聊天中,上一条图片消息中的二维码
    • 仅版本 <= 0.0.6

有疑问

  • 自己想
  • pr 或 issue

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_qrcode-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_qrcode-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_qrcode-0.1.0.tar.gz.

File metadata

  • Download URL: nonebot_plugin_qrcode-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for nonebot_plugin_qrcode-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c100e239996e7e03911a351d1a8b1ffea09ce19ae24805ad9b1fa0c9427af703
MD5 f6a03c90b9a6c59c08199ae78efd344d
BLAKE2b-256 d82375d6d69d7c1b2c35033249375b91c20c1b8a6a3a2cb11cd40654bb8200b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_qrcode-0.1.0.tar.gz:

Publisher: publish.yml on kexue-z/nonebot-plugin-qrcode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_qrcode-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_qrcode-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41ce2e2bc4f37dd904446507f98bd17670e6a7fe935720a489fce401280db791
MD5 a1d0ee0779b42c224f8bfec2961328e4
BLAKE2b-256 b74b9589fc9b61b4f85696401cf91ee5b5c0e4b24fefccae8c4879b10a0a9b15

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_qrcode-0.1.0-py3-none-any.whl:

Publisher: publish.yml on kexue-z/nonebot-plugin-qrcode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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