Quantcast
Channel: Mattermost Discussion Forums - Latest posts
Viewing all articles
Browse latest Browse all 25517

GetChannels API fails in golang bot example

$
0
0

Hi @prateeksriv,

The bot sample needs to be updated for the upcoming 3.5 release since a few of the data structures changed when we were working on improving client performance. We'll work on an update for the sample on GitHub to smooth out the transition, but in the meantime, here's the lines of bot_sample.go that need to be changed.

Line 159 needs to changed because model.ChannelList is now just []model.Channel instead of a struct

// Line 159
- for _, channel := range channelList.Channels {
+ for _, channel := range *channelList {

And then lines 203 and 219 need to be changed because model.WebSocketEvent has changed slightly

// Line 203
- if event.ChannelId != debuggingChannel.Id {
+ if event.Broadcast.ChannelId != debuggingChannel.Id {

// Line 219
- if event.UserId == botUser.Id {
+ if event.Broadcast.UserId == botUser.Id {

Viewing all articles
Browse latest Browse all 25517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>