aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2020-03-14 22:09:24 -0500
committerMax Isom <[email protected]>2020-03-14 22:09:24 -0500
commit0cebca7917e66166a3b5d62127555e5ca45e3154 (patch)
tree3e915f590e33ed9da1494d0b74e2a0305cf1ea4c /src
parentd70bd167973b5171dbe82bac2daba04e73602bfa (diff)
downloadmuse-0cebca7917e66166a3b5d62127555e5ca45e3154.tar.xz
muse-0cebca7917e66166a3b5d62127555e5ca45e3154.zip
Improve seek command
Diffstat (limited to 'src')
-rw-r--r--src/commands/seek.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/commands/seek.ts b/src/commands/seek.ts
index 29c3972..2ad3dda 100644
--- a/src/commands/seek.ts
+++ b/src/commands/seek.ts
@@ -16,7 +16,15 @@ export default class implements Command {
}
public async execute(msg: Message, args: string []): Promise<void> {
- const seekTime = parseInt(args[0], 10);
+ const time = args[0];
+
+ let seekTime = 0;
+
+ if (time.includes(':')) {
+ seekTime = (parseInt(time.split(':')[0], 10) * 60) + parseInt(time.split(':')[1], 10);
+ } else {
+ seekTime = parseInt(time, 10);
+ }
const loading = new LoadingMessage(msg.channel as TextChannel, 'hold on a sec');