refactor: 重构数据库逻辑

This commit is contained in:
lixiangwuxian
2024-10-11 00:14:11 +08:00
parent 7aebdeae56
commit 769308389a
16 changed files with 289 additions and 164 deletions

View File

@@ -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,
}