Skip to content

Commit

Permalink
fix getting text from bot's messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielegiammatteo committed Jun 19, 2023
1 parent de60a0e commit 64e5b62
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/backend/channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ func (mm *MattermostBackend) GetChannelPosts(channelID string, fromt int64, tot
// this is an hack to get the text of the message. The type conversions could be avoided using Mattermost's types like
// PostTypeSlackAttachment
if post.Type == "slack_attachment" {
//x := postProps["attachments"].([]interface{})[0].(map[string]interface{})
//msg = x["fallback"].(string)
msg = fmt.Sprintf("%+v", post)
x := postProps["attachments"].([]interface{})[0].(map[string]interface{})
msg = x["fallback"].(string)
}

newpost := &model.Post{
Expand Down

0 comments on commit 64e5b62

Please sign in to comment.