mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-28 01:32:42 +02:00
Merge branch 'master' into feature/select-dotenv-path
This commit is contained in:
commit
ce8edf4145
25 changed files with 529 additions and 350 deletions
|
@ -38,12 +38,14 @@ export default class AddQueryToQueue {
|
|||
addToFrontOfQueue,
|
||||
shuffleAdditions,
|
||||
shouldSplitChapters,
|
||||
skipCurrentTrack,
|
||||
interaction,
|
||||
}: {
|
||||
query: string;
|
||||
addToFrontOfQueue: boolean;
|
||||
shuffleAdditions: boolean;
|
||||
shouldSplitChapters: boolean;
|
||||
skipCurrentTrack: boolean;
|
||||
interaction: ChatInputCommandInteraction;
|
||||
}): Promise<void> {
|
||||
const guildId = interaction.guild!.id;
|
||||
|
@ -169,6 +171,14 @@ export default class AddQueryToQueue {
|
|||
await player.play();
|
||||
}
|
||||
|
||||
if (skipCurrentTrack) {
|
||||
try {
|
||||
await player.forward(1);
|
||||
} catch (_: unknown) {
|
||||
throw new Error('no song to skip to');
|
||||
}
|
||||
}
|
||||
|
||||
// Build response message
|
||||
if (statusMsg !== '') {
|
||||
if (extraMsg === '') {
|
||||
|
@ -183,9 +193,9 @@ export default class AddQueryToQueue {
|
|||
}
|
||||
|
||||
if (newSongs.length === 1) {
|
||||
await interaction.editReply(`u betcha, **${firstSong.title}** added to the${addToFrontOfQueue ? ' front of the' : ''} queue${extraMsg}`);
|
||||
await interaction.editReply(`u betcha, **${firstSong.title}** added to the${addToFrontOfQueue ? ' front of the' : ''} queue${skipCurrentTrack ? 'and current track skipped' : ''}${extraMsg}`);
|
||||
} else {
|
||||
await interaction.editReply(`u betcha, **${firstSong.title}** and ${newSongs.length - 1} other songs were added to the queue${extraMsg}`);
|
||||
await interaction.editReply(`u betcha, **${firstSong.title}** and ${newSongs.length - 1} other songs were added to the queue${skipCurrentTrack ? 'and current track skipped' : ''}${extraMsg}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {VoiceChannel, Snowflake} from 'discord.js';
|
||||
import {Readable} from 'stream';
|
||||
import hasha from 'hasha';
|
||||
import ytdl, {videoFormat} from 'ytdl-core';
|
||||
import ytdl, {videoFormat} from '@distube/ytdl-core';
|
||||
import {WriteStream} from 'fs-capacitor';
|
||||
import ffmpeg from 'fluent-ffmpeg';
|
||||
import shuffle from 'array-shuffle';
|
||||
|
@ -280,8 +280,8 @@ export default class {
|
|||
if (this.getCurrent() && this.status !== STATUS.PAUSED) {
|
||||
await this.play();
|
||||
} else {
|
||||
this.audioPlayer?.stop(true);
|
||||
this.status = STATUS.IDLE;
|
||||
this.audioPlayer?.stop(true);
|
||||
|
||||
const settings = await getGuildSettings(this.guildId);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {inject, injectable} from 'inversify';
|
||||
import {toSeconds, parse} from 'iso8601-duration';
|
||||
import got, {Got} from 'got';
|
||||
import ytsr, {Video} from 'ytsr';
|
||||
import ytsr, {Video} from '@distube/ytsr';
|
||||
import PQueue from 'p-queue';
|
||||
import {SongMetadata, QueuedPlaylist, MediaSource} from './player.js';
|
||||
import {TYPES} from '../types.js';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue