Documentation ¶
Index ¶
- Constants
- func ArchiveURL(teamDomain string, channelName string, msgID MessageID) string
- func IsDMChannel(channel ChannelID) bool
- func ReplaceEntities(msg string, f func(e Entity) string) string
- func UnescapeAngleBrackets(msg string) string
- func UnescapeText(msg string) string
- func UnescapeTextAll(msg string) string
- type APIResponse
- type Attachment
- type AttachmentField
- type Channel
- type ChannelID
- type ChannelIM
- type ChannelTopicPurpose
- type CodedError
- type EditMessage
- func (m EditMessage) AssertText() bool
- func (m EditMessage) EditHash() map[string]interface{}
- func (m EditMessage) EditingUserID() UserID
- func (m EditMessage) EventTS() MessageTS
- func (m EditMessage) MessageID() MessageID
- func (m EditMessage) MessageTS() MessageTS
- func (m EditMessage) MessageUserID() UserID
- func (m EditMessage) Subtype() string
- func (m EditMessage) Text() string
- func (m EditMessage) UserID() UserID
- type EnterpriseID
- type Entity
- type FileCommentID
- type FileID
- type IncomingReaction
- type LatestMsg
- type MessageID
- type MessageTS
- type OutgoingSlackMessage
- type ParseStyle
- type PinnedItem
- type Profile
- type RTMRawMessage
- func (m RTMRawMessage) AssertText() bool
- func (m RTMRawMessage) Attachments() []Attachment
- func (m RTMRawMessage) ChannelID() ChannelID
- func (m RTMRawMessage) EventTS() MessageTS
- func (m RTMRawMessage) IsHidden() bool
- func (m RTMRawMessage) MessageID() MessageID
- func (m RTMRawMessage) MessageTS() MessageTS
- func (m RTMRawMessage) Okay() bool
- func (m RTMRawMessage) Original() []byte
- func (m RTMRawMessage) ReMarshal(v interface{}) error
- func (m RTMRawMessage) ReplyTo() int
- func (m RTMRawMessage) String() string
- func (m RTMRawMessage) StringField(field string) string
- func (m RTMRawMessage) Subtype() string
- func (m RTMRawMessage) Text() string
- func (m RTMRawMessage) Type() string
- func (m RTMRawMessage) UserID() UserID
- type ResponseType
- type SelfPrefs
- type SlackTextMessage
- type SlashCommandRequest
- type SlashCommandResponse
- type TeamID
- type TeamInfo
- type User
- type UserID
Constants ¶
View Source
const ( ParseStyleFull = ParseStyle("full") ParseStyleNone = ParseStyle("none") )
View Source
const ( ResponseTypeEphermal ResponseType = "ephemeral" ResponseTypeInChannel = "in_channel" ResponseTypeDelayed = "__delayed" )
View Source
const MessageTSCharsAfterDot = 6
View Source
const MsgFieldRawBytes = "_rawBytes"
Variables ¶
This section is empty.
Functions ¶
func IsDMChannel ¶
func UnescapeAngleBrackets ¶
func UnescapeText ¶
UnescapeText unwraps URLs in a Slack message and otherwise canonicalizes certain entities for use by Marvin.
Notably, < and > are left alone to prevent someone from typing <!everyone> and having Marvin repeat it as a @everyone.
func UnescapeTextAll ¶
Types ¶
type APIResponse ¶
type APIResponse struct { OK bool `json:"ok"` SlackError string `json:"error"` Warning string `json:"warning"` }
func (APIResponse) Error ¶
func (r APIResponse) Error() string
type Attachment ¶
type Attachment struct { Fallback string `json:"fallback"` Pretext string `json:"pretext,omitempty"` Text string `json:"text,omitempty"` Color string `json:"color,omitempty"` Fields []AttachmentField `json:"fields,omitempty"` AuthorName string `json:"author_name,omitempty"` AuthorLink string `json:"author_link,omitempty"` AuthorIcon string `json:"author_icon,omitempty"` AuthorSubname string `json:"author_subname,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` TS int64 `json:"ts,omitempty"` ImageURL string `json:"image_url,omitempty"` FromURL string `json:"from_url,omitempty"` ServiceName string `json:"service_name,omitempty"` ServiceURL string `json:"service_url,omitempty"` }
type AttachmentField ¶
type Channel ¶
type Channel struct { CacheTS time.Time `json:"-"` NotExist bool `json:"-"` ID ChannelID Name string IsChannel bool `json:"is_channel"` IsGroup interface{} `json:"is_group"` IsMPIM interface{} `json:"is_mpim"` Created int // unix millis Creator UserID IsArchived bool `json:"is_archived"` IsGeneral bool `json:"is_general"` HasPins bool `json:"has_pins"` // The Members element may be out of date. The rtm.Client keeps an up-to-date list of // channel memberships for public and private channels. This can be used for MPIMs, however. Members []UserID `json:"members"` NumMembers int `json:"num_members"` // IM only IsUserDeleted bool `json:"is_user_deleted"` IsOpen bool `json:"is_open"` Topic ChannelTopicPurpose Purpose ChannelTopicPurpose }
func (*Channel) IsPrivateChannel ¶
func (*Channel) IsPublicChannel ¶
type ChannelTopicPurpose ¶
type CodedError ¶
func (CodedError) Error ¶
func (ce CodedError) Error() string
type EditMessage ¶
type EditMessage struct {
RTMRawMessage
}
func (EditMessage) AssertText ¶
func (m EditMessage) AssertText() bool
func (EditMessage) EditHash ¶
func (m EditMessage) EditHash() map[string]interface{}
func (EditMessage) EditingUserID ¶
func (m EditMessage) EditingUserID() UserID
func (EditMessage) EventTS ¶
func (m EditMessage) EventTS() MessageTS
func (EditMessage) MessageID ¶
func (m EditMessage) MessageID() MessageID
func (EditMessage) MessageTS ¶
func (m EditMessage) MessageTS() MessageTS
func (EditMessage) MessageUserID ¶
func (m EditMessage) MessageUserID() UserID
func (EditMessage) Subtype ¶
func (m EditMessage) Subtype() string
func (EditMessage) Text ¶
func (m EditMessage) Text() string
func (EditMessage) UserID ¶
func (m EditMessage) UserID() UserID
type EnterpriseID ¶
type EnterpriseID string
type FileCommentID ¶
type FileCommentID string
type IncomingReaction ¶
type OutgoingSlackMessage ¶
type OutgoingSlackMessage struct { Text string `json:"text,omitempty"` ThreadTS MessageTS `json:"thread_ts,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` UnfurlLinks util.TriValue `json:"unfurl_links,omitempty"` UnfurlMedia util.TriValue `json:"unfurl_media,omitempty"` Parse ParseStyle `json:"parse,omitempty"` LinkNames util.TriValue `json:"link_names,omitempty"` Markdown util.TriValue `json:"mrkdwn,omitempty"` }
type ParseStyle ¶
type ParseStyle string
type PinnedItem ¶
type PinnedItem struct { Type string `json:"type"` Channel ChannelID `json:"channel"` Created int64 `json:"created"` CreatedBy UserID `json:"created_id"` Message struct { TS MessageTS `json:"ts"` Permalink string `json:"permalink"` } `json:"message"` File struct { ID FileID `json:"id"` Permalink string `json:"permalink"` } `json:"file"` Comment struct { ID FileCommentID `json:"id"` Comment string } `json:"comment"` }
type Profile ¶
type Profile struct { DisplayName string `json:"display_name_normalized"` RealName string `json:"real_name"` RealNameNormalized string `json:"real_name_normalized"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string `json:"email"` Phone string `json:"phone"` Title string `json:"title"` Skype string `json:"skype"` Image24 string `json:"image_24"` Image32 string `json:"image_32"` Image48 string `json:"image_48"` Image72 string `json:"image_72"` Image128 string `json:"image_128"` Image192 string `json:"image_192"` Image512 string `json:"image_512"` Image1024 string `json:"image_1024"` ImageOriginal string `json:"image_original"` }
type RTMRawMessage ¶
type RTMRawMessage map[string]interface{}
func (RTMRawMessage) AssertText ¶
func (m RTMRawMessage) AssertText() bool
func (RTMRawMessage) Attachments ¶
func (m RTMRawMessage) Attachments() []Attachment
func (RTMRawMessage) ChannelID ¶
func (m RTMRawMessage) ChannelID() ChannelID
func (RTMRawMessage) EventTS ¶
func (m RTMRawMessage) EventTS() MessageTS
func (RTMRawMessage) IsHidden ¶
func (m RTMRawMessage) IsHidden() bool
func (RTMRawMessage) MessageID ¶
func (m RTMRawMessage) MessageID() MessageID
func (RTMRawMessage) MessageTS ¶
func (m RTMRawMessage) MessageTS() MessageTS
func (RTMRawMessage) Okay ¶
func (m RTMRawMessage) Okay() bool
func (RTMRawMessage) Original ¶
func (m RTMRawMessage) Original() []byte
func (RTMRawMessage) ReMarshal ¶
func (m RTMRawMessage) ReMarshal(v interface{}) error
func (RTMRawMessage) ReplyTo ¶
func (m RTMRawMessage) ReplyTo() int
func (RTMRawMessage) String ¶
func (m RTMRawMessage) String() string
func (RTMRawMessage) StringField ¶
func (m RTMRawMessage) StringField(field string) string
func (RTMRawMessage) Subtype ¶
func (m RTMRawMessage) Subtype() string
func (RTMRawMessage) Text ¶
func (m RTMRawMessage) Text() string
func (RTMRawMessage) Type ¶
func (m RTMRawMessage) Type() string
func (RTMRawMessage) UserID ¶
func (m RTMRawMessage) UserID() UserID
type ResponseType ¶
type ResponseType string
type SlackTextMessage ¶
type SlashCommandRequest ¶
type SlashCommandRequest struct { Token string TeamId TeamID `schema:"team_id"` TeamDomain string `schema:"team_domain"` // no .slack.com ChannelId ChannelID `schema:"channel_id"` ChannelName string `schema:"channel_name"` UserId UserID `schema:"user_id"` UserName string `schema:"user_name"` Command string Text string Msg RTMRawMessage `schema:"-"` ResponseURL string `schema:"response_url"` }
type SlashCommandResponse ¶
type SlashCommandResponse struct { OutgoingSlackMessage ResponseType ResponseType `json:"response_type,omitempty"` }
type TeamInfo ¶
type TeamInfo struct { ID TeamID `json:"id"` Name string Domain string EmailDomain string `json:"email_domain"` Icon interface{} MsgEditWindowMins float64 `json:"msg_edit_window_mins"` OverStorageLimit bool `json:"over_storage_limit"` Prefs interface{} Plan string AvatarBaseURL string `json:"avatar_base_url"` OverIntegrationsLimit bool `json:"over_integrations_limit"` }
type User ¶
type User struct { NotExist bool `json:"-"` CacheTS time.Time `json:"-"` ID UserID `json:"id"` TeamID TeamID `json:"team_id"` Name string `json:"-"` Deleted bool `json:"deleted"` Status interface{} `json:"status"` Color string `json:"color"` RealName string `json:"real_name"` Tz string `json:"tz"` TzLabel string `json:"tz_label"` TzOffset int `json:"tz_offset"` Updated int64 `json:"updated"` Profile Profile `json:"profile"` IsAdmin bool `json:"is_admin"` IsOwner bool `json:"is_owner"` IsPrimaryOwner bool `json:"is_primary_owner"` IsRestricted bool `json:"is_restricted"` IsUltraRestricted bool `json:"is_ultra_restricted"` IsBot bool `json:"is_bot"` Presence string `json:"presence"` Has2Fa bool `json:"has_2fa,omitempty"` }
Directories ¶
Path | Synopsis |
---|---|
The controller package implements the Team type.
|
The controller package implements the Team type. |
Click to show internal directories.
Click to hide internal directories.