aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.rs
diff options
context:
space:
mode:
authorFelix Kaaman <tmtu@tmtu.ee>2020-02-21 23:24:55 +0200
committerFelix Kaaman <tmtu@tmtu.ee>2020-02-21 23:29:22 +0200
commitd9bfc97b599af4e4e96ae403df8287a533223e32 (patch)
treefc2102295e2b3f0fd5db6f4d2ed811a6a0e87ffd /src/command.rs
parent8e708b65365aeb0591aee39d2ffb7c59239ffc3f (diff)
downloadpokebot-d9bfc97b599af4e4e96ae403df8287a533223e32.tar.gz
pokebot-d9bfc97b599af4e4e96ae403df8287a533223e32.zip
Add seeking to audio player
Adds a new "!seek" command which takes in a string that will be parsed by humantime in addition to a '+' or '-' character that can be prefixed to determine if it is a relative seek. Without any prefix characters the seek will be absolute.
Diffstat (limited to 'src/command.rs')
-rw-r--r--src/command.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/command.rs b/src/command.rs
index 3a39290..db22028 100644
--- a/src/command.rs
+++ b/src/command.rs
@@ -9,7 +9,8 @@ use structopt::StructOpt;
DisableHelpFlags,
DisableVersion,
ColorNever,
- NoBinaryName]",)
+ NoBinaryName,
+ AllowLeadingHyphen]",)
)]
pub enum Command {
/// Adds url to playlist
@@ -18,6 +19,8 @@ pub enum Command {
Play,
/// Pauses audio playback
Pause,
+ /// Seeks by a specified amount
+ Seek { amount: String },
/// Stops audio playback
Stop,
/// Switches to the next queue entry