vote for the task via reply
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pavel 2024-05-23 15:30:10 +03:00
parent 9a020253de
commit 1e6022df08

View File

@ -41,18 +41,21 @@ func (h *Poll) Handle(wh telego.Update) error {
return err return err
} }
loc := h.Localizer(user.Language) loc := h.Localizer(user.Language)
_ = loc
if len(wh.Message.Entities) == 0 || 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].Type != telego.EntityTypeBotCommand) ||
(len(wh.Message.Entities) > 0 && wh.Message.Entities[0].Offset != 0) { (len(wh.Message.Entities) > 0 && wh.Message.Entities[0].Offset != 0) {
return nil 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 ( var (
taskID int taskID int
canRedmine bool canRedmine bool
) )
taskInfo := strings.TrimSpace(wh.Message.Text[wh.Message.Entities[0].Length:])
if taskInfo != "" { if taskInfo != "" {
for _, integrationData := range chat.Integrations { for _, integrationData := range chat.Integrations {
id, info := integration.New(integrationData, h.App.Log()).GetTaskInfo(taskInfo) id, info := integration.New(integrationData, h.App.Log()).GetTaskInfo(taskInfo)