aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/skip.ts7
-rw-r--r--src/services/queue.ts4
-rw-r--r--src/utils/loading-message.ts2
3 files changed, 11 insertions, 2 deletions
diff --git a/src/commands/skip.ts b/src/commands/skip.ts
index 87fb94d..ec0e83e 100644
--- a/src/commands/skip.ts
+++ b/src/commands/skip.ts
@@ -23,10 +23,15 @@ export default class implements Command {
try {
queue.forward();
- await this.playerManager.get(msg.guild!.id).play();
+ if (queue.isEmpty()) {
+ this.playerManager.get(msg.guild!.id).disconnect();
+ } else {
+ await this.playerManager.get(msg.guild!.id).play();
+ }
await msg.channel.send('keepin\' \'er movin\'');
} catch (_) {
+ console.log(_);
await msg.channel.send('no song to skip to');
}
}
diff --git a/src/services/queue.ts b/src/services/queue.ts
index ffc16ae..c929eea 100644
--- a/src/services/queue.ts
+++ b/src/services/queue.ts
@@ -78,4 +78,8 @@ export default class {
size(): number {
return this.queue.length;
}
+
+ isEmpty(): boolean {
+ return this.get().length === 0;
+ }
}
diff --git a/src/utils/loading-message.ts b/src/utils/loading-message.ts
index 9773c03..3d24905 100644
--- a/src/utils/loading-message.ts
+++ b/src/utils/loading-message.ts
@@ -17,7 +17,7 @@ export default class {
const period = 500;
- const icons = ['⚪', '🔵', '⚫'];
+ const icons = ['🐮', '🐴', '🐄'];
const reactions = [];