Skip to main content

无数据问答插件

Project description

nonebot-plugin-word-bank2

✨ 无数据库的轻量问答插件 ✨

!!! 注意

由于 #770

因此需要改动nonebot bata1的源码才能正常使用 /atself 功能

beta2 不需要

...site-packages/nonebot/adapters/_template.py

L178

if inspect.ismethod(method):
                formatter = getattr(segment_class, format_spec)
        return (

改为

if callable(method):
                formatter = getattr(segment_class, format_spec)
        return (

功能

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

安装

pip install nonebot-plugin-word-bank2

开始使用

问答教学

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

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

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

    • 例如
      问
      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

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-word-bank2-0.1.5.2.tar.gz (23.5 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_word_bank2-0.1.5.2-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file nonebot-plugin-word-bank2-0.1.5.2.tar.gz.

File metadata

  • Download URL: nonebot-plugin-word-bank2-0.1.5.2.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.13.0-1023-azure

File hashes

Hashes for nonebot-plugin-word-bank2-0.1.5.2.tar.gz
Algorithm Hash digest
SHA256 0dccb168e138873f868aa28f922906c8370356a38bbaf6137294cc6dc8d0b92b
MD5 2623062cd63d322a005cadc8182a5531
BLAKE2b-256 f537a4fc4435dcb9c7c91e78f7e13cb4d455ba949e780423eb715d2d62345a6e

See more details on using hashes here.

File details

Details for the file nonebot_plugin_word_bank2-0.1.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_word_bank2-0.1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abeaee6eed04f964876a34a616dce577d3cfd47637d16ad28666ea15d95cf423
MD5 e0b11b937f36a686ccbe2f97fb7e1020
BLAKE2b-256 92994e60e688d9b4551c7c4529604c91139ceaf025c9e96630c85523d8fafc59

See more details on using hashes here.

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