diff --git a/core/function.go b/core/function.go index d937c59..67ffe7d 100644 --- a/core/function.go +++ b/core/function.go @@ -33,6 +33,12 @@ var name = func() string { } var functions = []Function{ + { + Rules: []string{"^name$"}, + Handle: func(_ im.Sender) interface{} { + return name() + }, + }, { Rules: []string{"^升级$"}, Admin: true, diff --git a/core/test.go b/core/test.go index f4fd933..ef8b869 100644 --- a/core/test.go +++ b/core/test.go @@ -10,7 +10,7 @@ import ( func init() { AddCommand("", []Function{ { - Rules: []string{"raw 命令"}, + Rules: []string{"raw ^命令$"}, Handle: func(_ im.Sender) interface{} { ss := []string{} for _, f := range functions {