diff options
author | Wim <wim@42.be> | 2020-02-08 16:50:53 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2020-02-08 18:33:05 +0100 |
commit | c01c8edeb8b367b1b9dcfd5a1982a2ba2b708c11 (patch) | |
tree | dd4564c0a1255063bfe97d17fdcd265f36b56146 /bridge/keybase/handlers.go | |
parent | ff8cf067b8328f8a49f0a2dfd69a6ae5569cda15 (diff) | |
download | matterbridge-msglm-c01c8edeb8b367b1b9dcfd5a1982a2ba2b708c11.tar.gz matterbridge-msglm-c01c8edeb8b367b1b9dcfd5a1982a2ba2b708c11.tar.bz2 matterbridge-msglm-c01c8edeb8b367b1b9dcfd5a1982a2ba2b708c11.zip |
Fix go-keybase-chat-bot api changes
Diffstat (limited to 'bridge/keybase/handlers.go')
-rw-r--r-- | bridge/keybase/handlers.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bridge/keybase/handlers.go b/bridge/keybase/handlers.go index 165aeb16..a29208d4 100644 --- a/bridge/keybase/handlers.go +++ b/bridge/keybase/handlers.go @@ -4,7 +4,7 @@ import ( "strconv" "github.com/42wim/matterbridge/bridge/config" - "github.com/keybase/go-keybase-chat-bot/kbchat" + "github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1" ) func (b *Bkeybase) handleKeybase() { @@ -20,7 +20,7 @@ func (b *Bkeybase) handleKeybase() { b.Log.Errorf("failed to read message: %s", err.Error()) } - if msg.Message.Content.Type != "text" { + if msg.Message.Content.TypeName != "text" { continue } @@ -34,7 +34,7 @@ func (b *Bkeybase) handleKeybase() { }() } -func (b *Bkeybase) handleMessage(msg kbchat.Message) { +func (b *Bkeybase) handleMessage(msg chat1.MsgSummary) { b.Log.Debugf("== Receiving event: %#v", msg) if msg.Channel.TopicName != b.channel || msg.Channel.Name != b.team { return @@ -45,10 +45,10 @@ func (b *Bkeybase) handleMessage(msg kbchat.Message) { // TODO download avatar // Create our message - rmsg := config.Message{Username: msg.Sender.Username, Text: msg.Content.Text.Body, UserID: msg.Sender.Uid, Channel: msg.Channel.TopicName, ID: strconv.Itoa(msg.MsgID), Account: b.Account} + rmsg := config.Message{Username: msg.Sender.Username, Text: msg.Content.Text.Body, UserID: string(msg.Sender.Uid), Channel: msg.Channel.TopicName, ID: strconv.Itoa(int(msg.Id)), Account: b.Account} // Text must be a string - if msg.Content.Type != "text" { + if msg.Content.TypeName != "text" { b.Log.Errorf("message is not text") return } |