Codebase list golang-github-nlopes-slack / 74f694f websocket_misc.go
74f694f

Tree @74f694f (Download .tar.gz)

websocket_misc.go @74f694fraw · history · blame

package slack

import (
	"encoding/json"
	"time"
)

// TODO: Probably need an error event

type HelloEvent struct{}

type PresenceChangeEvent struct {
	Type     string `json:"type"`
	Presence string `json:"presence"`
	User     string `json:"user"`
}

type UserTypingEvent struct {
	Type    string `json:"type"`
	User    string `json:"user"`
	Channel string `json:"channel"`
}

type LatencyReport struct {
	Value time.Duration
}

type PrefChangeEvent struct {
	Type  string          `json:"type"`
	Name  string          `json:"name"`
	Value json.RawMessage `json:"value"`
}

type ManualPresenceChangeEvent struct {
	Type     string `json:"type"`
	Presence string `json:"presence"`
}
type UserChangeEvent struct {
	Type string `json:"type"`
	User User   `json:"user"`
}
type EmojiChangedEvent struct {
	Type           string         `json:"type"`
	EventTimestamp JSONTimeString `json:"event_ts"`
}
type CommandsChangedEvent struct {
	Type           string         `json:"type"`
	EventTimestamp JSONTimeString `json:"event_ts"`
}
type EmailDomainChangedEvent struct {
	Type           string         `json:"type"`
	EventTimestamp JSONTimeString `json:"event_ts"`
	EmailDomain    string         `json:"email_domain"`
}
type BotAddedEvent struct {
	Type string `json:"type"`
	Bot  Bot    `json:"bot"`
}
type BotChangedEvent struct {
	Type string `json:"type"`
	Bot  Bot    `json:"bot"`
}
type AccountsChangedEvent struct {
	Type string `json:"type"`
}