aboutsummaryrefslogtreecommitdiff
path: root/telegram/utils.go
diff options
context:
space:
mode:
authorbodqhrohro <bodqhrohro@gmail.com>2019-12-21 02:44:21 +0300
committerbodqhrohro <bodqhrohro@gmail.com>2019-12-21 02:44:21 +0300
commitd439b7a5810cc02a9170d5fd0f2b37ed8a684fd0 (patch)
tree560383c1e22baab48357c8ebb01cd71984ad09d8 /telegram/utils.go
parent472d4b7befe00b8fe862549b774629f29f2ce91c (diff)
Respond for message sending errors
Diffstat (limited to 'telegram/utils.go')
-rw-r--r--telegram/utils.go10
1 files changed, 9 insertions, 1 deletions
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,
+ )
+ }
}
}