fix: 修改多个处理函数的返回类型为指针类型,以提高内存使用效率并避免不必要的拷贝
This commit is contained in:
@@ -13,30 +13,30 @@ func init() {
|
||||
handler.RegisterHelpInform("取消监听新债", "新债", "关闭新债监听")
|
||||
}
|
||||
|
||||
func listenBond(msg model.Message) (reply model.Reply) {
|
||||
func listenBond(msg model.Message) (reply *model.Reply) {
|
||||
if err := AddGroupListen(int(msg.GroupInfo.GroupId)); err != nil {
|
||||
return model.Reply{
|
||||
return &model.Reply{
|
||||
ReplyMsg: "开启新债监听失败,报错: " + err.Error(),
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
return model.Reply{
|
||||
return &model.Reply{
|
||||
ReplyMsg: "开启新债监听成功",
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
|
||||
func unListenBond(msg model.Message) (reply model.Reply) {
|
||||
func unListenBond(msg model.Message) (reply *model.Reply) {
|
||||
if err := RemoveGroupListen(int(msg.GroupInfo.GroupId)); err != nil {
|
||||
return model.Reply{
|
||||
return &model.Reply{
|
||||
ReplyMsg: "关闭新债监听失败,报错: " + err.Error(),
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
return model.Reply{
|
||||
return &model.Reply{
|
||||
ReplyMsg: "关闭新债监听成功",
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
|
||||
Reference in New Issue
Block a user