Giter VIP home page Giter VIP logo

nonebot-plugin-word-bank2's Introduction

nonebot-plugin-word-bank2

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

!!! 注意

由于 #770

因此需要改动nonebot bata1的源码才能正常使用 发送图片功能

...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
      
  • 问答句中的首首尾空白字符会被自动忽略

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

问句选项

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

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

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

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

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

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

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

答句选项

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

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

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

    • 例如: 问 谁是牛头人 答 @这是群昵称
  • /ban, 当答句中包含/ban后紧跟数字时将会禁言发送者, 单位为秒, 默认为300

    • 例如: 问 牛头人天下第一 答 /ban 114514 ???

删除词条

  • 以下指令需要结合自己的COMMAND_START 这里为 /

  • 删除词条+需要删除的问句

    • 例如: /删除词条 你好
  • 删除全局词条+需要删除的问句

    • 例如: /删除全局词条 你好
  • 删除全局词库

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

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

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

更新记录

  • v0.0.1
    • 基于fork进行重构

特别感谢

优化建议

  • 请提交issue或者pr

nonebot-plugin-word-bank2's People

Contributors

joenothing-lst avatar kexue-z avatar meetwq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.