diff --git a/telegram/utils.go b/telegram/utils.go index ac100fd..1983367 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -496,10 +496,18 @@ func (c *Client) ProcessOutgoingMessage(chatID int64, text string, messageID int } } - c.client.SendMessage(&client.SendMessageRequest{ + _, err := c.client.SendMessage(&client.SendMessageRequest{ ChatId: chatID, ReplyToMessageId: reply, InputMessageContent: message, }) + if err != nil { + gateway.SendMessage( + returnJid, + strconv.FormatInt(chatID, 10), + fmt.Sprintf("Message not sent: %s", err.Error()), + c.xmpp, + ) + } } }