dockerfile but the image is planet-sized
This commit is contained in:
@ -10,10 +10,10 @@ import (
|
||||
)
|
||||
|
||||
// playSound plays the current buffer to the provided channel.
|
||||
func playSound(s *discordgo.Session, guildID, channelID string, buffer []byte) (err error) {
|
||||
func playSound(s *discordgo.Session, guildID, channelID string, audioBuffer []byte) (err error) {
|
||||
|
||||
// Join the provided voice channel.
|
||||
vc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)
|
||||
vc, err := s.ChannelVoiceJoin(guildID, channelID, false, false)
|
||||
if err != nil {
|
||||
log.Println("Could not find channel.")
|
||||
return err
|
||||
@ -25,13 +25,14 @@ func playSound(s *discordgo.Session, guildID, channelID string, buffer []byte) (
|
||||
// Start speaking.
|
||||
vc.Speaking(true)
|
||||
|
||||
vc.OpusSend <- buffer
|
||||
log.Println(len(audioBuffer))
|
||||
vc.OpusSend <- audioBuffer
|
||||
|
||||
// Stop speaking
|
||||
vc.Speaking(false)
|
||||
|
||||
// Sleep for a specificed amount of time before ending.
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
time.Sleep(5000 * time.Millisecond)
|
||||
|
||||
// Disconnect from the provided voice channel.
|
||||
vc.Disconnect()
|
||||
|
||||
Reference in New Issue
Block a user