Fix go build issues
This commit is contained in:
parent
d3ed404885
commit
42d9147b41
|
@ -270,13 +270,13 @@ func help(user *gumble.User) {
|
|||
// is applied and is immediately in effect.
|
||||
func volume(user *gumble.User, username, value string) {
|
||||
if value == "" {
|
||||
dj.client.Self().Channel().Send(fmt.Sprintf(CUR_VOLUME_HTML, dj.audioStream.Volume()), false)
|
||||
dj.client.Self().Channel().Send(fmt.Sprintf(CUR_VOLUME_HTML, dj.audioStream.Volume), false)
|
||||
} else {
|
||||
if parsedVolume, err := strconv.ParseFloat(value, 32); err == nil {
|
||||
newVolume := float32(parsedVolume)
|
||||
if newVolume >= dj.conf.Volume.LowestVolume && newVolume <= dj.conf.Volume.HighestVolume {
|
||||
dj.audioStream.SetVolume(newVolume)
|
||||
dj.client.Self().Channel().Send(fmt.Sprintf(VOLUME_SUCCESS_HTML, username, dj.audioStream.Volume()), false)
|
||||
dj.audioStream.Volume = newVolume
|
||||
dj.client.Self().Channel().Send(fmt.Sprintf(VOLUME_SUCCESS_HTML, username, dj.audioStream.Volume), false)
|
||||
} else {
|
||||
dj.SendPrivateMessage(user, fmt.Sprintf(NOT_IN_VOLUME_RANGE_MSG, dj.conf.Volume.LowestVolume, dj.conf.Volume.HighestVolume))
|
||||
}
|
||||
|
|
3
main.go
3
main.go
|
@ -51,8 +51,7 @@ func (dj *mumbledj) OnConnect(e *gumble.ConnectEvent) {
|
|||
|
||||
if audioStream, err := gumble_ffmpeg.New(dj.client); err == nil {
|
||||
dj.audioStream = audioStream
|
||||
dj.audioStream.Done = dj.queue.OnItemFinished
|
||||
dj.audioStream.SetVolume(dj.conf.Volume.DefaultVolume)
|
||||
dj.audioStream.Volume = dj.conf.Volume.DefaultVolume
|
||||
} else {
|
||||
panic(err)
|
||||
}
|
||||
|
|
2
song.go
2
song.go
|
@ -83,7 +83,7 @@ func (s *Song) Download() error {
|
|||
// Plays the song. Once the song is playing, a notification is displayed in a text message that features the video thumbnail, URL, title,
|
||||
// duration, and submitter.
|
||||
func (s *Song) Play() {
|
||||
if err := dj.audioStream.Play(fmt.Sprintf("%s/.mumbledj/songs/%s.m4a", dj.homeDir, s.youtubeId)); err != nil {
|
||||
if err := dj.audioStream.Play(fmt.Sprintf("%s/.mumbledj/songs/%s.m4a", dj.homeDir, s.youtubeId), dj.queue.OnItemFinished); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
dj.client.Self().Channel().Send(fmt.Sprintf(NOW_PLAYING_HTML, s.thumbnailUrl, s.youtubeId, s.title, s.duration, s.submitter), false)
|
||||
|
|
Reference in a new issue