diff options
author | Wim <wim@42.be> | 2017-08-27 22:59:37 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-08-27 22:59:37 +0200 |
commit | 5a8d7b5f6d30bf4d3ee93fe9593e0b3504ad684a (patch) | |
tree | 62f8534833b4184606980d1b61b44bbec8898fed /bridge/telegram/telegram.go | |
parent | cfb810713872a5f95a5a54c449fef3bce5aa05b5 (diff) | |
download | matterbridge-msglm-5a8d7b5f6d30bf4d3ee93fe9593e0b3504ad684a.tar.gz matterbridge-msglm-5a8d7b5f6d30bf4d3ee93fe9593e0b3504ad684a.tar.bz2 matterbridge-msglm-5a8d7b5f6d30bf4d3ee93fe9593e0b3504ad684a.zip |
Modify Send() to return also a message id
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r-- | bridge/telegram/telegram.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 77704ab9..d0c471b2 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -57,11 +57,11 @@ func (b *Btelegram) JoinChannel(channel config.ChannelInfo) error { return nil } -func (b *Btelegram) Send(msg config.Message) error { +func (b *Btelegram) Send(msg config.Message) (string, error) { flog.Debugf("Receiving %#v", msg) chatid, err := strconv.ParseInt(msg.Channel, 10, 64) if err != nil { - return err + return "", err } if b.Config.MessageFormat == "HTML" { @@ -72,7 +72,7 @@ func (b *Btelegram) Send(msg config.Message) error { m.ParseMode = tgbotapi.ModeHTML } _, err = b.c.Send(m) - return err + return "", err } func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { |