discord

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateArgs

type AuthenticateArgs struct {
	AccessToken string `json:"access_token"`
}

type AuthorizeArgs

type AuthorizeArgs struct {
	ClientID string   `json:"client_id"`
	Scopes   []string `json:"scopes"`
	Prompt   string   `json:"prompt"`
}

type AuthorizeData

type AuthorizeData struct {
	Code string `json:"code"`
}

type Channel

type Channel struct {
	ID   string `json:"id"`
	Type uint8  `json:"type"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

func (*Client) Read

func (c *Client) Read(res *Response) error

func (*Client) Request

func (c *Client) Request(cmd, evt string, args any) error

type GetChannelData

type GetChannelData struct {
	Channel

	VoiceStates []VoiceStateData `json:"voice_states"`
}

type Request

type Request[T any] struct {
	Cmd   string `json:"cmd"`
	Nonce string `json:"nonce"`
	Evt   string `json:"evt"`
	Args  T      `json:"args"`
}

type Response

type Response struct {
	Cmd   string          `json:"cmd"`
	Nonce string          `json:"nonce"`
	Event string          `json:"evt"`
	Data  json.RawMessage `json:"data"`
}

func (*Response) UnmarshalData

func (r *Response) UnmarshalData(v any) error

type SpeakingArgs

type SpeakingArgs struct {
	ChannelID string `json:"channel_id"`
}

type SpeakingData

type SpeakingData struct {
	UserID string `json:"user_id"`
}

type User

type User struct {
	ID            string `json:"id"`
	Username      string `json:"username"`
	Avatar        string `json:"avatar"`
	Discriminator string `json:"discriminator"`
	Bot           bool   `json:"bot"`
}

type VoiceChannelSelectData

type VoiceChannelSelectData struct {
	ChannelID string `json:"channel_id"`
	GuildID   string `json:"guild_id"`
}

type VoiceState

type VoiceState struct {
	Deaf     bool `json:"deaf"`
	Mute     bool `json:"mute"`
	SelfDeaf bool `json:"self_deaf"`
	SelfMute bool `json:"self_mute"`
	Suppress bool `json:"suppress"`
}

type VoiceStateArgs

type VoiceStateArgs struct {
	ChannelID string `json:"channel_id"`
}

type VoiceStateData

type VoiceStateData struct {
	Nick       string     `json:"nick"`
	Mute       bool       `json:"mute"`
	Volume     float64    `json:"volume"`
	VoiceState VoiceState `json:"voice_state"`
	User       User       `json:"user"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL