refactor: 重构数据库逻辑
This commit is contained in:
@@ -6,15 +6,15 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
handler.RegisterHandler("记下", say)
|
||||
handler.RegisterHandler("kw", say)
|
||||
}
|
||||
|
||||
func say(msg model.Message) (reply model.Reply) {
|
||||
if len(msg.Msg) <= 5 {
|
||||
if len(msg.Msg) <= len("kw ") {
|
||||
return model.Reply{}
|
||||
}
|
||||
return model.Reply{
|
||||
ReplyMsg: msg.Msg[5:],
|
||||
ReplyMsg: "记下了",
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user