Documentation
¶
Index ¶
Constants ¶
const ( // DispatchCommand event dispatch DispatchCommand command = "DISPATCH" // AuthorizeCommand used to authorize a new client with your app AuthorizeCommand command = "AUTHORIZE" // AuthenticateCommand used to authenticate an existing client with your app AuthenticateCommand command = "AUTHENTICATE" // GetGuildCommand used to retrieve guild information from the client GetGuildCommand command = "GET_GUILD" // GetGuildsCommand used to retrieve a list of guilds from the client GetGuildsCommand command = "GET_GUILDS" // GetChannelCommand used to retrieve channel information from the client GetChannelCommand command = "GET_CHANNEL" // GetChannelsCommand used to retrieve a list of channels for a guild from the client GetChannelsCommand command = "GET_CHANNELS" // SubscribeCommand used to subscribe to an RPC event SubscribeCommand command = "SUBSCRIBE" // UnSubscribeCommand used to unsubscribe from an RPC event UnSubscribeCommand command = "UNSUBSCRIBE" // SetUserVoiceSettingsCommand used to change voice settings of users in voice channels SetUserVoiceSettingsCommand command = "SET_USER_VOICE_SETTINGS" // SelectVoiceChannelCommand used to join or leave a voice channel, group dm, or dm SelectVoiceChannelCommand command = "SELECT_VOICE_CHANNEL" // GetSelectedVoiceChannelCommand used to get the current voice channel the client is in GetSelectedVoiceChannelCommand command = "GET_SELECTED_VOICE_CHANNEL" // SelectTextChannelCommand used to join or leave a text channel, group dm, or dm SelectTextChannelCommand command = "SELECT_TEXT_CHANNEL" // GetVoiceSettingsCommand used to retrieve the client's voice settings GetVoiceSettingsCommand command = "GET_VOICE_SETTINGS" // SetVoiceSettingsCommand used to set the client's voice settings SetVoiceSettingsCommand command = "SET_VOICE_SETTINGS" // CaptureShortcutCommand used to capture a keyboard shortcut entered by the user CaptureShortcutCommand command = "CAPTURE_SHORTCUT" // SetCertifiedDevicesCommand used to send info about certified hardware devices SetCertifiedDevicesCommand command = "SET_CERTIFIED_DEVICES" // SetActivityCommand used to update a user's Rich Presence SetActivityCommand command = "SET_ACTIVITY" // SendActivityJoinInviteCommand used to consent to a Rich Presence Ask to Join request SendActivityJoinInviteCommand command = "SEND_ACTIVITY_JOIN_INVITE" // CloseActivityRequestCommand used to reject a Rich Presence Ask to Join request CloseActivityRequestCommand command = "CLOSE_ACTIVITY_REQUEST" )
Variables ¶
This section is empty.
Functions ¶
func FindCaseInsensitive ¶
Types ¶
type Activity ¶
type Activity struct {
Type int `json:"type,omitempty"`
Name string `json:"name,omitempty"`
StatusType int `json:"status_display_type,omitempty"`
Details string `json:"details,omitempty"`
State string `json:"state,omitempty"`
Timestamps *Timestamps `json:"timestamps,omitempty"`
Assets *Assets `json:"assets,omitempty"`
Party *Party `json:"party,omitempty"`
Secrets *Secrets `json:"screts,omitempty"`
Instance bool `json:"instance"`
}
Activity holds the data for discord rich presence https://discord.com/developers/docs/events/gateway-events#activity-object-activity-types
type Assets ¶
type Assets struct {
LargeImage string `json:"large_image,omitempty"`
LargeText string `json:"large_text,omitempty"`
SmallImage string `json:"small_image,omitempty"`
SmallText string `json:"small_text,omitempty"`
}
Assets passes image references for inclusion in rich presence
type Client ¶
Client wrapper for the Discord RPC client
func New ¶
New sends a handshake in the socket and returns an error or nil and an instance of Client
func (*Client) SetActivity ¶
SetActivity sets the Rich Presence activity for the running application
type Epoch ¶
Epoch wrapper around time.Time to ensure times are sent as a unix epoch int
func (Epoch) MarshalJSON ¶
MarshalJSON converts time.Time to unix time int
type Party ¶
type Party struct {
ID string `json:"id"`
Size []int `json:"size"` // seems to be element [0] is count and [1] is max
}
Party holds information for the current party of the player
type Secrets ¶
type Secrets struct {
Join string `json:"join,omitempty"`
Spectate string `json:"spectate,emitempty"`
Match string `json:"match,omitempty"`
}
Secrets holds secrets for Rich Presence joining and spectating
type Timestamps ¶
Timestamps holds unix timestamps for start and/or end of the game