diff options
| author | Nathan Perry <avaglir@gmail.com> | 2017-07-29 17:20:43 -0400 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2017-07-29 17:20:43 -0400 |
| commit | deac22dffb03829216138d90e74423384b4c2c80 (patch) | |
| tree | 98c762bd0c6a80ca6a4771f1ce63764a8e7cf96a /thulani.go | |
| parent | b892dd48234dcbed539ddb982af4a76e81d2e8a1 (diff) | |
video enqueue works
Diffstat (limited to 'thulani.go')
| -rw-r--r-- | thulani.go | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,14 +1,12 @@ package thulani import ( - "math/rand" "net/url" "os" "os/signal" "regexp" "strings" "syscall" - "time" "github.com/bwmarrin/discordgo" "github.com/mammothbane/thulani-go/downloader" @@ -106,11 +104,6 @@ func onMessage(s *discordgo.Session, m *discordgo.MessageCreate) { return } - if err := manager.Enqueue("https://www.youtube.com/watch?v=_K13GJkGvDw", time.Duration(rand.Intn(10*60))*time.Second, 5*time.Second); err != nil { - log.Errorf("unable to enqueue video: %q", err) - return - } - for _, v := range extraMemes { v(ctx) } @@ -179,4 +172,11 @@ func onMessage(s *discordgo.Session, m *discordgo.MessageCreate) { ctx.sendMessage("NO IMGUR", m.Tts) } } + + if err := manager.Enqueue(target.String(), 0, 0); err != nil { + log.Errorf("unable to enqueue video: %q", err) + ctx.sendMessage("you fucked up the video.", ctx.Tts) + return + } + log.Infof("started playing from: %q", target.String()) } |
