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,omitempty"`
Type ActivityType `json:"type"`
State string `json:"state"`
// Shown alongside `Party` size when `Type` is `ActivityPlaying` and `Party` is non-null
Details string `json:"details"`
// URL to navigate to when you click on `Details`
DetailsURL string `json:"details_url,omitempty"`
// Only shown when `Type` is `ActivityPlaying`
Party *Party `json:"party,omitempty"`
Assets *Assets `json:"assets,omitempty"`
// Cannot be used with `Buttons`
Secrets *Secrets `json:"secrets,omitempty"`
Timestamps *Timestamps `json:"timestamps,omitempty"`
// Maximum of two are allowed
Buttons []Button `json:"buttons,omitempty"`
}
type ActivityType ¶
type ActivityType int
const ( ActivityPlaying ActivityType = 0 ActivityListening ActivityType = 2 ActivityWatching ActivityType = 3 ActivityCompeting ActivityType = 5 )
type Assets ¶
type Assets struct {
LargeImage string `json:"large_image,omitempty"`
LargeText string `json:"large_text,omitempty"`
LargeURL string `json:"large_url,omitempty"`
SmallImage string `json:"small_image,omitempty"`
SmallText string `json:"small_text,omitempty"`
SmallURL string `json:"small_url,omitempty"`
InviteCoverImage string `json:"invite_cover_image,omitempty"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetIPC ¶
Just giving this to allow advanced usage If you have any issues, after login create a goroutine that calls ipc.Read in a loop and logs the opcode and response data
func (*Client) SetActivity ¶
func (c *Client) SetActivity(args SetActivityArgs) error
Ignores errors if the rpc server returns one
func (*Client) WriteFrame ¶
func (c *Client) WriteFrame(frame RequestFrame) error
Changes the nonce to a random uuid
type DiscordError ¶
func (DiscordError) Error ¶
func (d DiscordError) Error() string
type ReadyEvent ¶
type ReadyUser ¶
type ReadyUser struct {
ID string `json:"id"`
Bot bool `json:"bot"`
Username string `json:"username"`
Discriminator string `json:"discriminator"`
GlobalName string `json:"global_name"`
Avatar string `json:"avatar"`
Flags int `json:"flags"`
PremiumType int `json:"premium_type"`
AvatarDecorationData *struct {
Asset string `json:"asset"`
SkuID string `json:"skuId"`
} `json:"avatar_decoration_data,omitempty"`
}
type RequestFrame ¶
type ResponseFrame ¶
type ResponseFrame struct {
Command string `json:"cmd"`
Event string `json:"evt"`
Data json.RawMessage `json:"data"`
Nonce string `json:"nonce"`
}
func ParseFrame ¶
func ParseFrame(data []byte) (*ResponseFrame, error)
type SetActivityArgs ¶
type Timestamps ¶
type Timestamps struct {
Start UnixTimestampMs `json:"start,omitempty"`
End UnixTimestampMs `json:"end,omitempty"`
}
type UnixTimestampMs ¶
type UnixTimestampMs int64
Click to show internal directories.
Click to hide internal directories.
