Skip to content

Commit 60f4e4a

Browse files
committed
🎨 去掉硬编码
1 parent 8247d65 commit 60f4e4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugin/antiabuse/anti.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func init() {
102102
return true
103103
})
104104

105-
engine.OnPrefix("添加违禁词", zero.OnlyGroup, zero.AdminPermission, onceRule).SetBlock(true).Handle(
105+
engine.OnPrefix(add, zero.OnlyGroup, zero.AdminPermission, onceRule).SetBlock(true).Handle(
106106
func(ctx *zero.Ctx) {
107107
args := strings.TrimSpace(ctx.State["args"].(string))
108108
if err := db.insertWord(ctx.Event.GroupID, args); err != nil {
@@ -112,7 +112,7 @@ func init() {
112112
}
113113
})
114114

115-
engine.OnPrefix("删除违禁词", zero.OnlyGroup, zero.AdminPermission, onceRule).SetBlock(true).Handle(
115+
engine.OnPrefix(delete, zero.OnlyGroup, zero.AdminPermission, onceRule).SetBlock(true).Handle(
116116
func(ctx *zero.Ctx) {
117117
args := strings.TrimSpace(ctx.State["args"].(string))
118118
if err := db.deleteWord(ctx.Event.GroupID, args); err != nil {
@@ -122,7 +122,7 @@ func init() {
122122
}
123123
})
124124

125-
engine.OnPrefix("查看违禁词", zero.OnlyGroup, onceRule).SetBlock(true).Handle(
125+
engine.OnPrefix(list, zero.OnlyGroup, onceRule).SetBlock(true).Handle(
126126
func(ctx *zero.Ctx) {
127127
b, err := text.RenderToBase64(db.listWords(ctx.Event.GroupID), text.FontFile, 400, 20)
128128
if err != nil {

0 commit comments

Comments
 (0)