|
@@ -91,27 +91,6 @@ func (v *VoiceConnection) Speaking(b bool) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-func (v *VoiceConnection) waitUntilConnected() error {
|
|
|
-
|
|
|
- i := 0
|
|
|
- for {
|
|
|
- if v.Ready {
|
|
|
- return nil
|
|
|
- }
|
|
|
-
|
|
|
- if i > 10 {
|
|
|
- return fmt.Errorf("Timeout waiting for voice.")
|
|
|
- }
|
|
|
-
|
|
|
- time.Sleep(1 * time.Second)
|
|
|
- i++
|
|
|
- }
|
|
|
-
|
|
|
- return nil
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
func (v *VoiceConnection) ChangeChannel(channelID string, mute, deaf bool) (err error) {
|
|
@@ -192,6 +171,27 @@ type voiceOP2 struct {
|
|
|
HeartbeatInterval time.Duration `json:"heartbeat_interval"`
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+func (v *VoiceConnection) waitUntilConnected() error {
|
|
|
+
|
|
|
+ i := 0
|
|
|
+ for {
|
|
|
+ if v.Ready {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+
|
|
|
+ if i > 10 {
|
|
|
+ return fmt.Errorf("Timeout waiting for voice.")
|
|
|
+ }
|
|
|
+
|
|
|
+ time.Sleep(1 * time.Second)
|
|
|
+ i++
|
|
|
+ }
|
|
|
+
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|