From d2fc755df5284555dd3fdbfc303e002375c6b691 Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Sat, 21 Dec 2024 22:31:03 +0800 Subject: [PATCH] refactor: streamline UnRegisterLiveHandler calls in xiBaoTemp and beiBaoTemp functions --- handler/xibao/xibao.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler/xibao/xibao.go b/handler/xibao/xibao.go index b7808f3..156c5d3 100644 --- a/handler/xibao/xibao.go +++ b/handler/xibao/xibao.go @@ -40,10 +40,10 @@ func xiBao(msg model.Message) (reply model.Reply) { } func xiBaoTemp(msg model.Message) (reply model.Reply, isTrigger bool) { + handler.UnRegisterLiveHandler(msg.GroupInfo.GroupId, msg.UserId) fileName := uuid.New().String() filePath := "./tmp/" + fileName + ".png" xibao.GenerateCongratulationImage(msg.RawMsg, "./resource/xibao_background.png", filePath, true) - handler.UnRegisterLiveHandler(msg.GroupInfo.GroupId, msg.UserId) return model.Reply{ ReplyMsg: fmt.Sprintf("[CQ:image,file=file:///root/qqbot/tmp/%s]", fileName+".png"), ReferOriginMsg: true, @@ -73,10 +73,10 @@ func beiBao(msg model.Message) (reply model.Reply) { } func beiBaoTemp(msg model.Message) (reply model.Reply, isTrigger bool) { + handler.UnRegisterLiveHandler(msg.GroupInfo.GroupId, msg.UserId) fileName := uuid.New().String() filePath := "./tmp/" + fileName + ".png" xibao.GenerateCongratulationImage(msg.RawMsg, "./resource/beibao_background.png", filePath, false) - handler.UnRegisterLiveHandler(msg.GroupInfo.GroupId, msg.UserId) return model.Reply{ ReplyMsg: fmt.Sprintf("[CQ:image,file=file:///root/qqbot/tmp/%s]", fileName+".png"), ReferOriginMsg: true,