fix: 修改多个处理函数的返回类型为指针类型,以提高内存使用效率并避免不必要的拷贝

This commit is contained in:
lixiangwuxian
2025-04-09 23:28:39 +08:00
parent 144034939c
commit 7f0560b56e
32 changed files with 211 additions and 210 deletions

View File

@@ -11,11 +11,11 @@ func init() {
handler.RegisterHelpInform("echo", "echo", "echo <message> 再说一遍")
}
func echo(msg model.Message) (reply model.Reply) {
func echo(msg model.Message) (reply *model.Reply) {
if len(msg.RawMsg) <= 5 {
return model.Reply{}
return &model.Reply{}
}
return model.Reply{
return &model.Reply{
ReplyMsg: msg.RawMsg[5:],
ReferOriginMsg: true,
FromMsg: msg,