Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct {
Name string `json:"name"`
Type ActivityType `json:"type"`
Url string `json:"url,omitempty"`
Timestamps *Timestamps `json:"timestamps,omitempty"`
ApplicationId uint64 `json:"application_id,string,omitempty"`
Details string `json:"details,omitempty"`
State string `json:"state,omitempty"`
// TODO: Figure out how to handle emoji w/o import cycle
Party *Party `json:"party,omitempty"`
Assets *Asset `json:"assets,omitempty"`
Secret *Secret `json:"secret,omitempty"`
Instance bool `json:"instance,omitempty"`
Flags int `json:"flags,omitempty"` // TODO: Wrap this
}
type ActivityType ¶
type ActivityType int
const ( ActivityTypePlaying ActivityType = iota ActivityTypeStreaming ActivityTypeListening ActivityTypeWatching ActivityTypeCustom ActivityTypeCompeting )
type Avatar ¶
type Avatar struct {
Animated bool
// contains filtered or unexported fields
}
func (Avatar) MarshalJSON ¶
func (*Avatar) UnmarshalJSON ¶
type CachedUser ¶
type CachedUser struct {
Username string `json:"username"`
GlobalName *string `json:"global_name"`
Avatar string `json:"avatar"`
Bot bool `json:"bot"`
}
func (*CachedUser) ToUser ¶
func (u *CachedUser) ToUser(userId uint64) User
type ClientStatus ¶
type ClientStatus struct {
Desktop ClientStatusType `json:"desktop"`
Mobile ClientStatusType `json:"mobile"`
Web ClientStatusType `json:"web"`
}
type ClientStatusType ¶
type ClientStatusType string
const ( ClientStatusTypeOnline ClientStatusType = "online" ClientStatusTypeIdle ClientStatusType = "idle" ClientStatusTypeDoNotDisturb ClientStatusType = "dnd" ClientStatusTypeInvisible ClientStatusType = "invisible" ClientStatusTypeOffline ClientStatusType = "offline" )
type Discriminator ¶
type Discriminator uint16
Jsoniter does not like leading zeroes on ints
func (Discriminator) MarshalJSON ¶
func (d Discriminator) MarshalJSON() ([]byte, error)
func (*Discriminator) UnmarshalJSON ¶
func (d *Discriminator) UnmarshalJSON(b []byte) error
type Presence ¶
type Presence struct {
User User `json:"user"`
Roles utils.Uint64StringSlice `json:"roles"`
Game Activity `json:"name"`
GuildId uint64 `json:"guild_id,string"`
Status string `json:"status"`
Activities []Activity `json:"activities"`
ClientStatus ClientStatus `json:"client_status"`
PremiumSince *time.Time `json:"premium_since"`
Nick string `json:"nick"`
}
type Timestamps ¶
uses millis since unix epoch
type UpdateStatus ¶
type UpdateStatus struct {
Since int `json:"since"` // time since client went idle (unix epoch millis)
Game Activity `json:"game,omitempty"`
Status ClientStatusType `json:"status"`
Afk bool `json:"afk"`
}
func BuildStatus ¶
func BuildStatus(activityType ActivityType, status string) UpdateStatus
type User ¶
type User struct {
Id uint64 `json:"id,string"`
Username string `json:"username"`
GlobalName *string `json:"global_name"`
Avatar Avatar `json:"avatar"`
Bot bool `json:"bot"`
}
func (*User) EffectiveName ¶
func (*User) ToCachedUser ¶
func (u *User) ToCachedUser() CachedUser
Click to show internal directories.
Click to hide internal directories.