diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2019-12-21 02:44:21 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2019-12-21 02:44:21 +0300 |
commit | d439b7a5810cc02a9170d5fd0f2b37ed8a684fd0 (patch) | |
tree | 560383c1e22baab48357c8ebb01cd71984ad09d8 /telegram/utils.go | |
parent | 472d4b7befe00b8fe862549b774629f29f2ce91c (diff) |
Respond for message sending errors
Diffstat (limited to 'telegram/utils.go')
-rw-r--r-- | telegram/utils.go | 10 |
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, + ) + } } } |