mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-12-11 16:05:00 +00:00
diamondburned
c8f72547f7
This commit refactors a lot of voice's internals to be more stable and handle more edge cases from Discord's voice servers. It should result in an overall more stable voice connection. A few helper functions have been added into voice.Session. Some fields will have been broken and changed to accomodate for the refactor, as well. Below are some commits that have been squashed in: voice: Fix Speaking() panic on closed voice: StopSpeaking should not error out The rationale is added as a comment into the Speaking() method. voice: Add TestKickedOut voice: Fix region change disconnecting
17 lines
614 B
Go
17 lines
614 B
Go
// Package voice handles the Discord voice gateway and UDP connections. It does
|
|
// not handle book-keeping of those sessions.
|
|
//
|
|
// This package abstracts the subpackage voice/voicesession and voice/udp.
|
|
package voice
|
|
|
|
import "github.com/diamondburned/arikawa/v3/gateway"
|
|
|
|
// Intents are the intents needed for voice to work properly.
|
|
const Intents = gateway.IntentGuilds | gateway.IntentGuildVoiceStates
|
|
|
|
// AddIntents adds the needed voice intents into gw. Bots should always call
|
|
// this before Open if voice is required.
|
|
func AddIntents(gw interface{ AddIntents(gateway.Intents) }) {
|
|
gw.AddIntents(Intents)
|
|
}
|