Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

(未完工)nonebot-plugin-word-bank3

✨ 有数据库的轻量问答插件 ✨ 源自 WordBank2

功能

  • 无数据库的轻量问答插件
  • 支持模糊问答
  • 支持特殊回复
  • 自动转译 CQ 码
  • 支持图片回复
  • 支持指令大杂烩

安装

pip install nonebot-plugin-word-bank3

导入

nonebot.load_plugin("nonebot_plugin_tortoise_orm")  # 务必最先导入数据库
nonebot.load_plugin("nonebot_plugin_word_bank3")

开始使用

问答教学

  • 设置词条命令由问句和答句组成。设置之后, 收到消息时触发。并非所有人都可以设置词条, 详见权限

  • 格式[模糊|全局|正则|@]问...答...

    • 模糊|正则 匹配模式中可任性一个或不选, 不选 表示 全匹配
    • 全局, @ 可与以上匹配模式组合使用
  • 教学中可以使用换行

    • 例如
      问
      123
      答
      456
      
  • 问答句中的首首尾空白字符会被自动忽略

  • 私聊好友个人也可以建立属于自己的词库, 可以实现类似备忘录的功能

问句选项

  • 问...答... 全匹配模式, 必须全等才能触发答

  • 模糊问...答... 当问句出现在消息里时则会触发

  • 正则问...答..., 当问句被消息正则捕获时则会匹配

  • 例如: 正则问[他你]不理答你被屏蔽了

    消息 回复
    他不理 你被屏蔽了
    他不理我 你被屏蔽了
    你不理我 你被屏蔽了
  • 全局问...答..., 在所有群聊和私聊中都可以触发, 可以和以上几种组合使用

    • 例如: 全局模糊问 晚安 答 不准睡
  • @问...答..., 只有 event.tome 时才会触发,如被@、被回复时或在私聊中,可以和以上几种组合使用

    • 例如: 全局模糊@问 晚安 答 不准睡
  • 问句可包含at 即在 QQ 聊天中手动 at 群友

    • 建议只在问...答...中使用
    • 例如: 问 @这是群名称 答 老婆!

答句选项

  • /at + qq号, 当答句中包含/at + qq号时将会被替换为@某人

    • 例如: 问 群主在吗 答 /at 123456789在吗
  • /self, 当答句中包含/self时将会被替换为发送者的群昵称

    • 例如: 问 我是谁 答 你是/self (群昵称为: 我老婆)
  • /atself, 当答句中包含/atself时将会被替换为@发送者

    • 例如: 问 谁是牛头人 答 @这是群昵称

删除词条

  • 删除[模糊|全局|正则|@]词条 + 需要删除的问句

    • 例如: 删除全局模糊@词条 你好
  • 以下指令需要结合自己的COMMAND_START 这里为 /

  • 删除词库: 删除当前群聊/私聊词库

    • 例如: /删除词库
  • 删除全局词库

    • 例如: /删除全局词库
  • 删除全部词库

    • 例如: /删除全部词库
  • 权限

群主 群管理 私聊好友 超级用户
增删词条 O O O O
增删全局词条 X X X O
删除词库 O O O O
删除全局词库 X X X O
删除全部词库 X X X O

特别感谢

优化建议

  • 请提交 issue 或者 pr

Metadata

Release files for nonebot-plugin-word-bank3 0.1.0a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-word-bank3 0.1.0a3
File Size Uploaded
nonebot-plugin-word-bank3-0.1.0a3.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-word-bank3 0.1.0a3
File Interpreter ABI Platform
nonebot_plugin_word_bank3-0.1.0a3-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / nonebot-plugin-word-bank3-0.1.0a3.tar.gz

Download URL nonebot-plugin-word-bank3-0.1.0a3.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0f0c358bef93cc2cd36967be677a84ff0678ddba072393c6b6b6b1337df41c3b
BLAKE2b-256 checksum
How to use checksums
a318d2dd2ca7732417eb2ce930548161df33a657c4b8da1a35c0361940dbfc7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.2 Linux/5.13.0-1031-azure

Release files / nonebot_plugin_word_bank3-0.1.0a3-py3-none-any.whl

Download URL nonebot_plugin_word_bank3-0.1.0a3-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
777dc6500c2d0bdfee8644215aa06a7f1bb837b3ce21a9a14264ff345149a6e1
BLAKE2b-256 checksum
How to use checksums
86330a34efbf5b7e404b9b05c96918552ffb791cb5dfabe1c474f9e88f288382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.2 Linux/5.13.0-1031-azure
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page