discord

package
v0.0.0-...-b6b6a87 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	ID   string
	Name string
	Type ChannelType
}

type ChannelType

type ChannelType int
const (
	ChannelTypeGuildText  ChannelType = 0
	ChannelTypeGuildVoice ChannelType = 2
)

type Client

type Client interface {
	GetGuilds() ([]Guild, error)
	GetGuildUsers(guildID string) ([]User, error)
	GetUser(userID string) (User, error)
	GetBotUsername() string
	GetGuildChannels(guildID string) ([]Channel, error)
	GetChannel(channelID string) (Channel, error)
	CreateChannel(guildID string, name string, channelType ChannelType, maxUsers int) (Channel, error)
	SendTextMessage(channelID string, message string) error
	SendFileMessage(channelID string, name, contentType string, readable io.Reader) (Message, error)
	SetEmbed(channelID string, messageID string, embed MessageEmbed) error
	EstablishVoiceConnection(guildID, channelID string, mute, deaf bool, done chan bool) (voice *VoiceConnection, err error)
	EditInteraction(token string, message string) error
	EditInteractionComplex(token string, edit ComplexInteractionEdit) error
}

type ComplexInteractionEdit

type ComplexInteractionEdit struct {
	Content string
	Embeds  []*MessageEmbed
}

type Guild

type Guild struct {
	ID   string
	Name string
}

type Message

type Message struct {
	ID           string
	ChannelID    string
	AttachmentID string
}

type MessageEmbed

type MessageEmbed struct {
	URL         string
	Title       string
	Description string
	Timestamp   string
	Color       int
	Thumbnail   string
	Fields      []*MessageEmbedField
	Author      *MessageEmbedAuthor
}

type MessageEmbedAuthor

type MessageEmbedAuthor struct {
	Name    string
	IconURL string
}

type MessageEmbedField

type MessageEmbedField struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

type Packet

type Packet struct {
	SSRC      uint32
	Sequence  uint16
	Timestamp uint32
	Type      []byte
	Opus      []byte
	PCM       []int16
}

type User

type User struct {
	ID          string
	Username    string
	AvatarURL   string
	AccentColor int
}

type VoiceConnection

type VoiceConnection struct {
	Internals     any
	VoiceReceiver chan *Packet
}

func NewVoiceConnection

func NewVoiceConnection(internals any, voice chan *Packet) *VoiceConnection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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