aboutsummaryrefslogtreecommitdiff
path: root/commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands.go')
-rw-r--r--commands.go39
1 files changed, 17 insertions, 22 deletions
diff --git a/commands.go b/commands.go
index 0157adb..428e87a 100644
--- a/commands.go
+++ b/commands.go
@@ -4,40 +4,35 @@ import "github.com/mammothbane/thulani-go/downloader"
var cmdMap = map[string]func(*messageCtx){
"help": printHelp,
- "skip": commandNotImplemented,
- "pause": commandNotImplemented,
- "resume": commandNotImplemented,
- "sudoku": commandNotImplemented,
- "die": commandNotImplemented,
- "list": commandNotImplemented,
- "queue": commandNotImplemented,
+ "skip": skip,
+ "pause": pause,
+ "resume": resume,
+ "sudoku": stop,
+ "die": stop,
+ "list": list,
+ "queue": list,
}
func printHelp(c *messageCtx) {
c.sendMessage(help, c.Tts)
}
-func commandNotImplemented(c *messageCtx) {
- log.Errorf("%q not implemented", c.Command)
- c.sendMessage("not implemented", c.Tts)
+func skip(_ *messageCtx) {
+ manager.PlayState <- downloader.Play
}
-func skip(c *messageCtx) {
- log.Error("skip not implemented")
+func resume(_ *messageCtx) {
+ manager.PlayState <- downloader.Play
}
-func resume(c *messageCtx) {
- log.Error("skip not implemented")
+func pause(_ *messageCtx) {
+ manager.PlayState <- downloader.Pause
}
-func pause(c *messageCtx) {
- log.Error("skip not implemented")
+func stop(_ *messageCtx) {
+ manager.PlayState <- downloader.Clear
}
-func stop(c *messageCtx) {
- log.Error("skip not implemented")
-}
-
-func list(c *messageCtx) {
- log.Error("skip not implemented")
+func list(_ *messageCtx) {
+ log.Error("list not implemented")
}