Documentation
¶
Index ¶
- Variables
- func ChannelJoinHandler(msgChan chan tea.Msg, ev *ChannelJoinedEvent)
- func ChannelLeaveHandler(msgChan chan tea.Msg, ev *ChannelLeftEvent)
- func GetChannelHistory(api *slack.Client, channelID string) tea.Cmd
- func GetLatestMessage(api *slack.Client, channelID string) (*slack.Message, error)
- func GetThread(api *slack.Client, channelID string, ts string) tea.Cmd
- func GetUserInfo(api *slack.Client, userID string) (*slack.User, error)
- func LoadCache() *core.Cache
- func LoadConfig() (core.Config, error)
- func MessageHandler(msgChan chan tea.Msg, ev *MessageEvent)
- func Paginate[T any](fetch func(cursor string) (items []T, nextCursor string, err error)) ([]T, error)
- func ReactionAddHandler(msgChan chan tea.Msg, ev *ReactionAddedEvent)
- func ReactionRemoveHandler(msgChan chan tea.Msg, ev *ReactionRemovedEvent)
- func RunWebsocket(token, cookie string, msgChan chan tea.Msg)
- func SaveCache(cache core.Cache) error
- func SaveConfig(cfg core.Config) error
- func WithRetry(fn func() error)
- type ChannelJoinedEvent
- type ChannelLeftEvent
- type InitialEvent
- type MessageEvent
- type ReactionAddedEvent
- type ReactionEvent
- type ReactionRemovedEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var EventMapping = map[string]any{ "message": MessageEvent{}, "reaction_added": ReactionAddedEvent{}, "reaction_removed": ReactionRemovedEvent{}, "member_joined_channel": ChannelJoinedEvent{}, "channel_left": ChannelLeftEvent{}, }
Functions ¶
func ChannelJoinHandler ¶
func ChannelJoinHandler(msgChan chan tea.Msg, ev *ChannelJoinedEvent)
func ChannelLeaveHandler ¶
func ChannelLeaveHandler(msgChan chan tea.Msg, ev *ChannelLeftEvent)
func GetLatestMessage ¶
func LoadConfig ¶
func MessageHandler ¶
func MessageHandler(msgChan chan tea.Msg, ev *MessageEvent)
func ReactionAddHandler ¶
func ReactionAddHandler(msgChan chan tea.Msg, ev *ReactionAddedEvent)
func ReactionRemoveHandler ¶
func ReactionRemoveHandler(msgChan chan tea.Msg, ev *ReactionRemovedEvent)
func RunWebsocket ¶
func SaveConfig ¶
Types ¶
type ChannelJoinedEvent ¶
type ChannelLeftEvent ¶
type ChannelLeftEvent struct {
Channel string `json:"channel"`
}
type InitialEvent ¶
type InitialEvent struct {
Type string `json:"type"`
}
type MessageEvent ¶
type MessageEvent struct {
ClientMsgID string `json:"client_msg_id,omitempty"`
Type string `json:"type,omitempty"`
Channel string `json:"channel,omitempty"`
User string `json:"user,omitempty"`
Text string `json:"text,omitempty"`
Timestamp string `json:"ts,omitempty"`
ThreadTimestamp string `json:"thread_ts,omitempty"`
IsStarred bool `json:"is_starred,omitempty"`
PinnedTo []string `json:"pinned_to,omitempty"`
Attachments []core.Attachment `json:"attachments,omitempty"`
Files []core.File `json:"files,omitempty"`
LastRead string `json:"last_read,omitempty"`
Subscribed bool `json:"subscribed,omitempty"`
UnreadCount int `json:"unread_count,omitempty"`
ReplyCount int `json:"reply_count,omitempty"`
ReplyUsers []string `json:"reply_users,omitempty"`
SubType string `json:"subtype,omitempty"`
Hidden bool `json:"hidden,omitempty"`
DeletedTimestamp string `json:"deleted_ts,omitempty"`
EventTimestamp string `json:"event_ts,omitempty"`
Message struct {
Ts string `json:"ts"`
Text string `json:"text"`
} `json:"message,omitempty"`
}
type ReactionAddedEvent ¶
type ReactionAddedEvent ReactionEvent
type ReactionEvent ¶
type ReactionEvent struct {
Type string `json:"type"`
User string `json:"user"`
ItemUser string `json:"item_user"`
Item struct {
Type string `json:"type"`
Channel string `json:"channel,omitempty"`
File string `json:"file,omitempty"`
FileComment string `json:"file_comment,omitempty"`
Timestamp string `json:"ts,omitempty"`
} `json:"item"`
Reaction string `json:"reaction"`
EventTimestamp string `json:"event_ts"`
}
type ReactionRemovedEvent ¶
type ReactionRemovedEvent ReactionEvent
Click to show internal directories.
Click to hide internal directories.