Skip to content

Commit

Permalink
Merge pull request #5 from lestrrat/topic/bots
Browse files Browse the repository at this point in the history
Implements bots.info
  • Loading branch information
lestrrat authored Apr 7, 2017
2 parents 834782a + 6b0efb8 commit b3c4cb2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func New(token string, options ...Option) *Client {
}
return &Client{
auth: &AuthService{client: wrappedcl, token: token},
bots: &BotsService{client: wrappedcl, token: token},
channels: &ChannelsService{client: wrappedcl, token: token},
chat: &ChatService{client: wrappedcl, token: token},
oauth: &OAuthService{client: wrappedcl},
Expand All @@ -117,6 +118,11 @@ func (c *Client) Auth() *AuthService {
return c.auth
}

// Bots returns the Service object for `bots.*` endpoints
func (c *Client) Bots() *BotsService {
return c.bots
}

// Channels returns the Service object for `channels.*` endpoints
func (c *Client) Channels() *ChannelsService {
return c.channels
Expand Down
7 changes: 7 additions & 0 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var OAuth2Endpoint = oauth2.Endpoint{

type Client struct {
auth *AuthService
bots *BotsService
channels *ChannelsService
chat *ChatService
oauth *OAuthService
Expand Down Expand Up @@ -80,6 +81,12 @@ type AuthService struct {
token string
}

// BotsService handles all `bots.*` API endpoints
type BotsService struct {
client *httpClient
token string
}

// AuthTestResponse is the data structure response from auth.test
type AuthTestResponse struct {
URL string `json:"url"`
Expand Down
14 changes: 13 additions & 1 deletion objects/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,19 @@ type Team struct {
}

type Group interface{}
type Bot interface{}
type Bot struct {
ID string `json:"id"`
AppID string `json:"app_id"`
Deleted bool `json:"deleted"`
Name string `json:"name"`
Icons Icons `json:"icons"`
}

type Icons struct {
Image36 string `json:"image_36"`
Image48 string `json:"image_48"`
Image72 string `json:"image_72"`
}

// File represents a file object (https://api.slack.com/types/file)
type File struct {
Expand Down

0 comments on commit b3c4cb2

Please sign in to comment.