Documentation ¶
Index ¶
- type Client
- func (client *Client) APIToken() (apiToken string, err error)
- func (client *Client) CustomizeEmojiURI() (uri string)
- func (client *Client) DeleteEmoji(emojiName string) (err error)
- func (client *Client) DeleteEmojis() (err error)
- func (client *Client) EmojiAddURI() (uri string)
- func (client *Client) EmojiAdminListURI() (uri string)
- func (client *Client) EmojiRemoveURI() (uri string)
- func (client *Client) GetEmojis() (emojis map[string]Emoji, err error)
- func (client *Client) Host() (host string)
- func (client *Client) PostEmoji(emojiName, emojiPath string) (err error)
- func (client *Client) PostEmojis(...) (err error)
- type Emoji
- type EmojiListResponse
- type Paging
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { CustomizeEmojiPath string EmojiAddPath string EmojiAdminListPath string EmojiRemovePath string Emojis map[string]Emoji TeamName string // contains filtered or unexported fields }
Client provides a simple interface for interacting with the Slack API.
func NewSlackClient ¶
NewSlackClient instantiates a Slack client to a single team for emoji upload.
func (*Client) APIToken ¶
APIToken retrieves and returns the API token from an emoji customization call.
func (*Client) CustomizeEmojiURI ¶
CustomizeEmojiURI returns the URI of the customize/emoji endpoint.
func (*Client) DeleteEmoji ¶
DeleteEmoji deletes a single emoji identified by its name from the connected Slack team's custom emojis.
func (*Client) DeleteEmojis ¶
DeleteEmojis deletes all custom emojis from the connected Slack team.
func (*Client) EmojiAddURI ¶
EmojiAddURI returns the URI of the api/emoji.add endpoint.
func (*Client) EmojiAdminListURI ¶
EmojiAdminListURI returns the URI of the api/emoji.adminList endpoint.
func (*Client) EmojiRemoveURI ¶
EmojiRemoveURI returns the URI of the api/emoji.remove endpoint.
func (*Client) PostEmoji ¶
PostEmoji uploads an emoji file specified with its path under the given name.
func (*Client) PostEmojis ¶
func (client *Client) PostEmojis(emojiDirectoryPath, emojiAliasPrefix, emojiAliasSuffix, emojiAliasTakenPrefix, emojiAliasTakenSuffix string) (err error)
PostEmojis uploads all emojis in the specified directory using the file's name without extension as the emoji name prefixed and suffixed with the specified qualifiers.
type Emoji ¶
type Emoji struct { AliasFor string `json:"alias_for"` AvatarHash string `json:"avatar_hash"` CanDelete bool `json:"can_delete"` Created int64 `json:"created"` IsAlias int `json:"is_alias"` IsBad bool `json:"is_bad"` Name string `json:"name"` Synonyms []string `json:"synonyms"` TeamID string `json:"team_id"` URL string `json:"url"` UserDisplayName string `json:"user_display_name"` UserID string `json:"user_id"` }
Emoji encapsulates the available information on a single Slack emoji.
type EmojiListResponse ¶
type EmojiListResponse struct { CustomEmojiTotalCount int64 `json:"custom_emoji_total_count"` DisabledEmojis []Emoji `json:"disabled_emoji"` Emojis []Emoji `json:"emoji"` IsOk bool `json:"ok"` Paging Paging `json:"paging"` }
EmojiListResponse describes the Slack response for the emoji listing request.