mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-14 19:29:22 +00:00
Fixed breaking changes
This commit is contained in:
@@ -232,23 +232,23 @@ export async function joinVoiceChannelProcedure(
|
||||
|
||||
const row = new ActionRowBuilder<ButtonBuilder>();
|
||||
if(event.instance.queue.track[0] instanceof SpotifyTrack)
|
||||
row.addComponents(
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🟢')
|
||||
.setLabel(' Open in Spotify')
|
||||
.setURL(encodeURI(`https://open.spotify.com/track/${event.instance.queue.track[0].id}`))
|
||||
.setStyle(ButtonStyle.Link),
|
||||
)
|
||||
.setStyle(ButtonStyle.Link)
|
||||
]);
|
||||
if(event.instance.queue.track[0] instanceof YouTubeVideo || event.instance.queue.track[0] instanceof SpotifyTrack) {
|
||||
const actualPlaybackURL = event.instance.getActualPlaybackURL();
|
||||
if(event.instance.queue.track[0] instanceof SpotifyTrack && !actualPlaybackURL) return;
|
||||
row.addComponents(
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🔴')
|
||||
.setLabel(' Open in YouTube')
|
||||
.setURL(event.instance.queue.track[0] instanceof YouTubeVideo ? encodeURI(`https://www.youtube.com/watch?v=${event.instance.queue.track[0].id}`) : encodeURI(event.instance.getActualPlaybackURL()!))
|
||||
.setStyle(ButtonStyle.Link),
|
||||
)
|
||||
.setStyle(ButtonStyle.Link)
|
||||
]);
|
||||
}
|
||||
|
||||
if (event.instance.textChannel) {
|
||||
|
||||
@@ -61,23 +61,23 @@ export default class NowPlaying extends DiscordModule {
|
||||
const row = new ActionRowBuilder<ButtonBuilder>();
|
||||
|
||||
if(instance.queue.track[0] instanceof SpotifyTrack)
|
||||
row.addComponents(
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🟢')
|
||||
.setLabel(' Open in Spotify')
|
||||
.setURL(encodeURI(`https://open.spotify.com/track/${instance.queue.track[0].id}`))
|
||||
.setStyle(ButtonStyle.Link),
|
||||
)
|
||||
]);
|
||||
if(instance.queue.track[0] instanceof YouTubeVideo || instance.queue.track[0] instanceof SpotifyTrack) {
|
||||
const actualPlaybackURL = instance.getActualPlaybackURL();
|
||||
if(instance.queue.track[0] instanceof SpotifyTrack && !actualPlaybackURL) return;
|
||||
row.addComponents(
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🔴')
|
||||
.setLabel(' Open in YouTube')
|
||||
.setURL(instance.queue.track[0] instanceof YouTubeVideo ? encodeURI(`https://www.youtube.com/watch?v=${instance.queue.track[0].id}`) : encodeURI(instance.getActualPlaybackURL()!))
|
||||
.setStyle(ButtonStyle.Link),
|
||||
)
|
||||
]);
|
||||
}
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [await EMBEDS.NOW_PLAYING(data, locale, instance.queue.track[0])], components: [row] });
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ export default class Play extends DiscordModule {
|
||||
instance.addTrackToQueue(result);
|
||||
|
||||
if (linkData.list) {
|
||||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('✅')
|
||||
.setCustomId(
|
||||
@@ -372,6 +372,7 @@ export default class Play extends DiscordModule {
|
||||
)
|
||||
.setLabel(' Add the remaining songs in the playlist')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
]
|
||||
);
|
||||
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
@@ -445,7 +446,7 @@ export default class Play extends DiscordModule {
|
||||
// The query length is too long to fit in json
|
||||
if (query.length > 100 - 51) return;
|
||||
|
||||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🔎')
|
||||
.setCustomId(
|
||||
@@ -459,7 +460,7 @@ export default class Play extends DiscordModule {
|
||||
)
|
||||
.setLabel(' Not this? Search!')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
);
|
||||
]);
|
||||
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [await EMBEDS.ADDED_QUEUE(data, locale, result[0])],
|
||||
|
||||
@@ -124,7 +124,7 @@ export default class PlayMy extends DiscordModule {
|
||||
// The query length is too long to fit in json
|
||||
if (query.length > 100 - 51) return;
|
||||
|
||||
row = new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
row = new ActionRowBuilder<ButtonBuilder>().addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🔎')
|
||||
.setCustomId(
|
||||
@@ -138,7 +138,7 @@ export default class PlayMy extends DiscordModule {
|
||||
)
|
||||
.setLabel(' Not this? Search!')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
);
|
||||
]);
|
||||
}
|
||||
|
||||
if(!row)
|
||||
|
||||
@@ -158,7 +158,7 @@ export default class Search extends DiscordModule {
|
||||
messageSelectMenu.addOptions(menuOptions);
|
||||
|
||||
const row = new ActionRowBuilder<SelectMenuBuilder>();
|
||||
row.addComponents(messageSelectMenu);
|
||||
row.addComponents([messageSelectMenu]);
|
||||
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.SEARCH_RESULT(data, locale, result)], components: [row] });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user