Documentation ¶
Overview ¶
Package voice handles the Discord voice gateway and UDP connections, as well as managing and keeping track of multiple voice sessions.
This package abstracts the subpackage voice/voicesession and voice/udp.
Index ¶
- Constants
- Variables
- type CloseError
- type Session
- func (s *Session) Disconnect() error
- func (s *Session) JoinChannel(gID, cID discord.Snowflake, muted, deafened bool) error
- func (s *Session) Speaking(flag voicegateway.SpeakingFlag) error
- func (s *Session) StopSpeaking() error
- func (s *Session) UpdateServer(ev *gateway.VoiceServerUpdateEvent)
- func (s *Session) UpdateState(ev *gateway.VoiceStateUpdateEvent)
- func (s *Session) Write(b []byte) (int, error)
- type Voice
Constants ¶
View Source
const Protocol = "xsalsa20_poly1305"
Variables ¶
View Source
var ( // ErrCannotSend is an error when audio is sent to a closed channel. ErrCannotSend = errors.New("cannot send audio to closed channel") )
View Source
var OpusSilence = [...]byte{0xF8, 0xFF, 0xFE}
Functions ¶
This section is empty.
Types ¶
type CloseError ¶ added in v0.7.3
func (*CloseError) Error ¶ added in v0.7.3
func (e *CloseError) Error() string
func (*CloseError) HasError ¶ added in v0.7.3
func (e *CloseError) HasError() bool
type Session ¶
type Session struct { ErrorLog func(err error) // contains filtered or unexported fields }
func (*Session) Disconnect ¶
func (*Session) JoinChannel ¶
func (*Session) Speaking ¶
func (s *Session) Speaking(flag voicegateway.SpeakingFlag) error
Speaking tells Discord we're speaking. This calls (*voicegateway.Gateway).Speaking().
func (*Session) StopSpeaking ¶
func (*Session) UpdateServer ¶
func (s *Session) UpdateServer(ev *gateway.VoiceServerUpdateEvent)
func (*Session) UpdateState ¶
func (s *Session) UpdateState(ev *gateway.VoiceStateUpdateEvent)
type Voice ¶
type Voice struct { *state.State // ErrorLog will be called when an error occurs (defaults to log.Println) ErrorLog func(err error) // contains filtered or unexported fields }
Voice represents a Voice Repository used for managing voice sessions.
func (*Voice) GetSession ¶
GetSession gets a session for a guild with a read lock.
func (*Voice) JoinChannel ¶
JoinChannel joins the specified channel in the specified guild.
func (*Voice) RemoveSession ¶
RemoveSession removes a session.
Click to show internal directories.
Click to hide internal directories.