From 0cebca7917e66166a3b5d62127555e5ca45e3154 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 14 Mar 2020 22:09:24 -0500 Subject: [PATCH] Improve seek command --- src/commands/seek.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 { - 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');