mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-14 03:09:59 +00:00
🐛 fix: Temp patch broken music player
This commit is contained in:
@@ -15,7 +15,7 @@ import { I18n } from 'i18n';
|
||||
import { joinVoiceChannelProcedure } from './Join';
|
||||
|
||||
import DiscordProvider from '../../providers/Discord';
|
||||
import DiscordMusicPlayer, { TrackUtils, ValidTracks } from '../../providers/DiscordMusicPlayer';
|
||||
import DiscordMusicPlayer, { TrackUtils, ValidTracks } from '../../providers/DiscordMusicPlayerTempFix';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
@@ -92,6 +92,12 @@ const EMBEDS = {
|
||||
description: errorMessage,
|
||||
user: data.getUser()
|
||||
});
|
||||
},
|
||||
TOO_LONG: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
return makeErrorEmbed({
|
||||
title: locale.__('musicplayer_play.too_long'),
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
};
|
||||
export default class Play extends DiscordModule {
|
||||
@@ -455,6 +461,12 @@ export default class Play extends DiscordModule {
|
||||
}
|
||||
instance.addTrackToQueue(result[0]);
|
||||
|
||||
// Max 1 hour
|
||||
if (result[0].durationInSec > 3600)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.TOO_LONG(data, locale)]
|
||||
});
|
||||
|
||||
if (result.length > 1) {
|
||||
// TODO: Find a better logic than this
|
||||
// If the first result title is exact match with the query or first title contains half the space of the query, it's probably a sentence
|
||||
|
||||
Reference in New Issue
Block a user