Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct { // What the player is currently doing Details string // The user's current party status State string // The id for a large asset of the activity, usually a snowflake LargeImage string // Text displayed when hovering over the large image of the activity LargeText string // The id for a small asset of the activity, usually a snowflake SmallImage string // Text displayed when hovering over the small image of the activity SmallText string // Information for the current party of the player Party *Party // Unix timestamps for start and/or end of the game Timestamps *Timestamps // Secrets for Rich Presence joining and spectating Secrets *Secrets // Clickable buttons that open a URL in the browser Buttons []*Button }
Activity holds the data for discord rich presence
type Args ¶
type Args struct { Pid int `json:"pid"` Type string `json:"type,omitempty"` Activity *PayloadActivity `json:"activity,omitempty"` }
Args is a arguments of Frame
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Discord client.
func (*Client) SetActivity ¶
SetActivity send request to Discord for change user status.
type Error ¶
type Error struct { Code ErrorCode `json:"code"` Message string `json:"message"` Data struct { Code ErrorCode `json:"code"` Message string `json:"message"` } `json:"data"` }
Error is a Discord error struct. Sometimes (for example in handshake) discord can send error non in data struct
type ErrorCode ¶
type ErrorCode int
ErrorCode is a type of error.
const ( // No errors :) NoErr ErrorCode = 0 )
Discord error codes.
type Party ¶
type Party struct { // The ID of the party ID string // Used to show the party's current size Players int // Used to show the party's maximum size MaxPlayers int }
Party holds information for the current party of the player
type PayloadActivity ¶
type PayloadActivity struct { Details string `json:"details"` State string `json:"state"` Assets PayloadAssets `json:"assets"` Party *PayloadParty `json:"party,omitempty"` Timestamps *PayloadTimestamps `json:"timestamps,omitempty"` Secrets *PayloadSecrets `json:"secrets,omitempty"` Buttons []*PayloadButton `json:"buttons,omitempty"` }
PayloadActivity is a change user activity request
type PayloadAssets ¶
type PayloadAssets struct { LargeImage string `json:"large_image"` LargeText string `json:"large_text"` SmallImage string `json:"small_image"` SmallText string `json:"small_text"` }
PayloadAssets is a images in PayloadActivity
type PayloadButton ¶
type PayloadButton struct { Label string `json:"label,omitempty"` URL string `json:"url,omitempty"` }
PayloadButton is a button config in PayloadActivity
type PayloadParty ¶
PayloadParty is a discord party config in PayloadActivity
type PayloadSecrets ¶
type PayloadSecrets struct { Match string `json:"match,omitempty"` Join string `json:"join,omitempty"` Spectate string `json:"spectate,omitempty"` }
PayloadSecrets is a secrets in PayloadActivity
type PayloadTimestamps ¶
type PayloadTimestamps struct { Start *uint64 `json:"start,omitempty"` End *uint64 `json:"end,omitempty"` }
PayloadTimestamps is a timestamps field in PayloadActivity