Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Dispatch indicates an event was dispatched. Dispatch = iota // Heartbeat is fired periodically by the client to keep the connection alive. Heartbeat // Identify starts a new session during the initial handshake. Identify // PresenceUpdate update the client's presence. PresenceUpdate // VoiceStateUpdate is used to join/leave or move between voice channels. VoiceStateUpdate // Resume a previous session that was disconnected. Resume // Reconnect indicates you should attempt to reconnect and resume immediately. Reconnect // RequestGuildMembers requests information about offline guild members in a large guild. RequestGuildMembers // InvalidSession indicates that the session has been invalidated. You should reconnect and identify/resume accordingly. InvalidSession // Hello is sent immediately after connecting, contains the heartbeat_interval to use. Hello // HeartbeatACK is sent in response to receiving a heartbeat to acknowledge that it has been received. HeartbeatACK )
Variables ¶
View Source
var (
ErrAgain = errors.New("operation not performed")
)
View Source
var (
ErrNonce = errors.New("nonce mismatch")
)
Functions ¶
Types ¶
type Activity ¶
type Activity struct { // State is the user's current party status, or text used for a custom status State string `json:"state,omitempty"` // Details is what the player is currently doing Details string `json:"details,omitempty"` // Timestamps are Unix timestamps for start and/or end of the game Timestamps *ActivityTimestamps `json:"timestamps,omitempty"` // Assets are images for the presence and their hover texts Assets *ActivityAssets `json:"assets,omitempty"` // Party is information for the current party of the player Party *ActivityParty `json:"party,omitempty"` // Secrets for Rich Presence joining and spectating Secrets *ActivitySecrets `json:"secrets,omitempty"` // Instance is whether or not the activity is an instanced game session Instance bool `json:"instance,omitempty"` }
type ActivityAssets ¶
type ActivityAssets struct { // LargeImage is the large image asset LargeImage string `json:"large_image,omitempty"` // LargeText is the text displayed when hovering over the large image of the activity LargeText string `json:"large_text,omitempty"` // SmallImage is the small image asset SmallImage string `json:"small_image,omitempty"` // SmallText is the text displayed when hovering over the small image of the activity SmallText string `json:"small_text,omitempty"` }
type ActivityParty ¶
type ActivitySecrets ¶
type ActivityTimestamps ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Command ¶
type Command[A any] struct { // Arguments are command arguments, present in commands sent to the server Arguments A `json:"args,omitempty"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.