From 1e6022df080b1838ed18a52bf083181e1d330c5b Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Thu, 23 May 2024 15:30:10 +0300 Subject: [PATCH] vote for the task via reply --- internal/handler/group/poll.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/handler/group/poll.go b/internal/handler/group/poll.go index 0c6215f..996ceb4 100644 --- a/internal/handler/group/poll.go +++ b/internal/handler/group/poll.go @@ -41,18 +41,21 @@ func (h *Poll) Handle(wh telego.Update) error { return err } loc := h.Localizer(user.Language) - _ = loc if len(wh.Message.Entities) == 0 || (len(wh.Message.Entities) > 0 && wh.Message.Entities[0].Type != telego.EntityTypeBotCommand) || (len(wh.Message.Entities) > 0 && wh.Message.Entities[0].Offset != 0) { return nil } + taskInfo := strings.TrimSpace(wh.Message.Text[wh.Message.Entities[0].Length:]) + if taskInfo == "" && wh.Message.ReplyToMessage != nil { + taskInfo = wh.Message.ReplyToMessage.Text + } + var ( taskID int canRedmine bool ) - taskInfo := strings.TrimSpace(wh.Message.Text[wh.Message.Entities[0].Length:]) if taskInfo != "" { for _, integrationData := range chat.Integrations { id, info := integration.New(integrationData, h.App.Log()).GetTaskInfo(taskInfo)