Giter Club home page Giter Club logo

Comments (2)

atian25 avatar atian25 commented on July 18, 2024

/^(?:my name is|i am|我(?:的名字)?(?:是|叫)?)\s*(.*)$/i 这个正则式不严谨,所以优先匹配到了。
建议不用dialog.yaml (它纯碎是为了演示零规则编码使用类库的例子),或者dialog.yaml放在最前面,只用于最简单的匹配。

示例里面很多规则都是为了演示而写的,并不符合真实的场景,建议参考而已

from weixin-robot.

powerbsd avatar powerbsd commented on July 18, 2024

@atian25 好的,那我在rules.js中来定义!
我定义了如下自动回复规则:

# 随机回复一个
我爱你: 
  - 可以吗?你确定,不是在和我开玩笑?
  - 您在开玩笑吧!
  - 今儿个真开心,有人类说爱我了!我可以发微博公布于众吗?
  - 我也好想爱啊!可是现在一个也没有!
  - 怎么,亲爱的你失恋了?
  - 不会吧,亲,您该吃药了吧?
  - 不至于吧,我不缺爱,我的主人更爱我!
  - 长夜慢慢无心睡眠,原以为我一个机器人不睡觉,原来你也不睡觉!

from weixin-robot.

Related Issues (20)

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.