diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands/move.ts | 4 | ||||
| -rw-r--r-- | src/services/player.ts | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/commands/move.ts b/src/commands/move.ts index 731e0da..9855c59 100644 --- a/src/commands/move.ts +++ b/src/commands/move.ts @@ -40,8 +40,8 @@ export default class implements Command { throw new Error('position must be at least 1'); } - player.move(from, to); + const {title} = player.move(from, to); - await interaction.reply('moved'); + await interaction.reply('moved **' + title + '** to position **' + String(to) + '**'); } } diff --git a/src/services/player.ts b/src/services/player.ts index bb8180d..abcc8ca 100644 --- a/src/services/player.ts +++ b/src/services/player.ts @@ -379,12 +379,14 @@ export default class { this.queue = []; } - move(from: number, to: number): void { + move(from: number, to: number): QueuedSong { if (from > this.queueSize() || to > this.queueSize()) { throw new Error('Move index is outside the range of the queue.'); } this.queue.splice(this.queuePosition + to, 0, this.queue.splice(this.queuePosition + from, 1)[0]); + + return this.queue[this.queuePosition + to]; } private getHashForCache(url: string): string { |
