This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathexample-config.yaml
79 lines (73 loc) · 2.01 KB
/
example-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
sys:
path: []
auth:
webui:
username: admin
password: pass
bot-users:
- username: admin
password: pass
chat-rules:
all:
# nickname: 昵称/备注的正则表达式
## 为list时 则每个元素为 OR 关系, 只要满足一个即可
nickname: ".*"
# senderid: wxid中的个人id
## 字符串匹配, 不支持正则
senderid: []
# roomid: 群id, 以@chatroom结尾
## 字符串匹配, 不支持正则
roomid: []
admin:
nickname: [FOOO, BARR]
minibots:
smartbot:
# function: 内置的minibots, 可以直接引用
function: minibots.smartbot
shellbot:
# import: 指明import路径
import: wesdk.minibots
function: shellbot
filebot:
import: wesdk.minibots
function: filebot
echobot:
# function: 也支持lambda表达式
function: "lambda bot, msg:bot.send_msg(msg['content'],msg['senderid'],msg['roomid'],msg['nickname'])"
hippopbot:
# ./minibot.py 演示脚本
import: minibot
function: hippopbot
weatherbot:
function: "minibots.make_weatherbot('101010100')"
reply-rules:
# 按顺序匹配, 命中则短路(不会继续执行)
- # pattern: 正则表达式
## 如果为list, 则每个元素为 OR 关系, 只要满足一个即可
pattern: "^/sh(\\.exec)?\\s"
# pattern-trim: 去掉匹配pattern的字符串
## '/sh.exec ls' ==> 'ls'
pattern-trim: true
# minibot: 负责回复消息
## 声明形式为foo(bot, msg)
minibot: "shellbot"
# chat-rule: 机器人聊天权限
## 如果为list, 则每个元素为 AND 关系, 必须全部满足
chat-rule: admin
- pattern: ["吗$", "\\?$", "?$", "是不是"]
minibot: "smartbot"
chat-rule: admin
- pattern: "^/f(ile)?\\s"
pattern-trim: true
minibot: "filebot"
chat-rule: admin
- pattern: "^/echo\\s"
pattern-trim: true
minibot: "echobot"
chat-rule: admin
- pattern: "^hey$"
minibot: "hippopbot"
chat-rule: admin
- pattern: "天气"
minibot: "weatherbot"
chat-rule: admin