Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Patch] Completed RTM Info #819

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions attachments.go
Expand Up @@ -77,8 +77,11 @@ type Attachment struct {
Pretext string `json:"pretext,omitempty"`
Text string `json:"text,omitempty"`

ImageURL string `json:"image_url,omitempty"`
ThumbURL string `json:"thumb_url,omitempty"`
ImageURL string `json:"image_url,omitempty"`
ImageSize int `json:"image_bytes,omitempty"`
ImageHeight int `json:"image_height,omitempty"`
ImageWidth int `json:"image_width,omitempty"`
ThumbURL string `json:"thumb_url,omitempty"`

Fields []AttachmentField `json:"fields,omitempty"`
Actions []AttachmentAction `json:"actions,omitempty"`
Expand Down
21 changes: 18 additions & 3 deletions info.go
Expand Up @@ -431,10 +431,25 @@ type Icons struct {

// Info contains various details about the authenticated user and team.
// It is returned by StartRTM or included in the "ConnectedEvent" RTM event.
// It should be noted that in order to optimise the sync speed, RTMConnect
// (which uses "rtm.connect") does not get all the account information. Namely,
// channels, groups, mpims, ims, users and bots are left empty.
// If you want to have access these fields populated, you should use "rtm.start"
// instead. Sample code bellow:
// ```
// rtm := slack.NewRTM(slack.RTMOptionUseStart(true))
// go rtm.ManageConnection()
// ```
type Info struct {
URL string `json:"url,omitempty"`
User *UserDetails `json:"self,omitempty"`
Team *Team `json:"team,omitempty"`
URL string `json:"url,omitempty"`
User *UserDetails `json:"self,omitempty"`
Team *Team `json:"team,omitempty"`
Channels []*Channel `json:"channels,omitempty"`
Groups []*Channel `json:"groups,omitempty"`
MPIMs []*Channel `json:"mpims,omitempty"`
IMs []*Channel `json:"ims,omitempty"`
Users []*User `json:"users,omitempty"`
Bots []*Bot `json:"bots,omitempty"`
}

type infoResponseFull struct {
Expand Down