제스퍼
제스퍼
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
I'll do my best. 🙂
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
It's been a while since I've studied typescript, so the code can be terrible 😂
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
i think so
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
For now, I wrote the code as above.
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
const query = interaction.options.getString("쿼리", true);

if (!voiceChannel.joinable)
return interaction.reply({
content: `봇이 해당 음성채널에 입장할 수 있는 권한이 없습니다.`
});

const player = client.music.player.players.create({
guildId: interaction.guild.id,
voiceChannel: voiceChannel.id,
textChannel: interaction.channel.id,
autoPlay: selected_data ? Boolean(selected_data.autoPlay) : true,
autoLeave: selected_data ? Boolean(selected_data.autoLeave) : false
});

player.volume = selected_data ? selected_data.volume : 50;

if (!player.connected) {
player.connect({
setDeaf: true,
setMute: false
});
}

const res = await client.music.player.search({
query,
source: "youtube",
requester: interaction.user.id
});

if (res.loadType === "error") {
return interaction.reply({
content: `어라.. 현재 시스템이 원활하지 않은 모양이에요. 시간 지나고 다시 시도해 보면 될 거예요!`
});
} else if (res.loadType === "empty") {
return interaction.reply({
content: `\`${query}\`에 대해 검색해봤는데 찾을 수 없어요.`
});
}

if (res.loadType === "playlist") {
interaction.reply({
content: `\`${res.playlistInfo?.name}\` 해당 플레이리스트에 대해 대기열에 추가했어요.`
});

for (const track of res.tracks) {
player.queue.add(track);
}
} else {
const selectMenu = new StringSelectMenuBuilder()
.setCustomId("select_track")
.setPlaceholder("노래를 선택해주세요.")
.addOptions(
res.tracks.slice(0, 25).map((track) => ({
label:
track.title.length > 100
? track.title.slice(0, 97) + "..."
: track.title,
description:
track.author.length > 50
? track.author.slice(0, 47) + "..."
: track.author,
value: track.identifier
}))
);

const row =
new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(
selectMenu
);

const response = await interaction.reply({
content:
"입력하신 쿼리를 기반으로 아래의 검색 결과를 출력하였습니다.",
components: [row]
});

const collectorFilter = (i: { user: { id: string } }) =>
i.user.id === interaction.user.id;
try {
const confirmation = await response.awaitMessageComponent({
filter: collectorFilter,
time: 30_000,
componentType: ComponentType.StringSelect
});

if (confirmation.customId === "select_track") {
const selectedTrack = res.tracks.find(
(track) => track.identifier === confirmation.values[0]
);

if (selectedTrack) {
player.queue.add(selectedTrack);
await confirmation.update({
content: `\`${selectedTrack.title} - ${await client.date.millisecondsToDuration(selectedTrack.duration)}\` 해당 노래를 대기열에 추가했어요.`,
components: []
});
if (!player.playing) {
player.play();
// player.setVolume();
}
}
}
} catch (e) {
await interaction.editReply({
content: "제한 시간 내에 버튼을 누르지 않아 취소되었습니다.",
components: []
});
}
}
const query = interaction.options.getString("쿼리", true);

if (!voiceChannel.joinable)
return interaction.reply({
content: `봇이 해당 음성채널에 입장할 수 있는 권한이 없습니다.`
});

const player = client.music.player.players.create({
guildId: interaction.guild.id,
voiceChannel: voiceChannel.id,
textChannel: interaction.channel.id,
autoPlay: selected_data ? Boolean(selected_data.autoPlay) : true,
autoLeave: selected_data ? Boolean(selected_data.autoLeave) : false
});

player.volume = selected_data ? selected_data.volume : 50;

if (!player.connected) {
player.connect({
setDeaf: true,
setMute: false
});
}

const res = await client.music.player.search({
query,
source: "youtube",
requester: interaction.user.id
});

if (res.loadType === "error") {
return interaction.reply({
content: `어라.. 현재 시스템이 원활하지 않은 모양이에요. 시간 지나고 다시 시도해 보면 될 거예요!`
});
} else if (res.loadType === "empty") {
return interaction.reply({
content: `\`${query}\`에 대해 검색해봤는데 찾을 수 없어요.`
});
}

if (res.loadType === "playlist") {
interaction.reply({
content: `\`${res.playlistInfo?.name}\` 해당 플레이리스트에 대해 대기열에 추가했어요.`
});

for (const track of res.tracks) {
player.queue.add(track);
}
} else {
const selectMenu = new StringSelectMenuBuilder()
.setCustomId("select_track")
.setPlaceholder("노래를 선택해주세요.")
.addOptions(
res.tracks.slice(0, 25).map((track) => ({
label:
track.title.length > 100
? track.title.slice(0, 97) + "..."
: track.title,
description:
track.author.length > 50
? track.author.slice(0, 47) + "..."
: track.author,
value: track.identifier
}))
);

const row =
new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(
selectMenu
);

const response = await interaction.reply({
content:
"입력하신 쿼리를 기반으로 아래의 검색 결과를 출력하였습니다.",
components: [row]
});

const collectorFilter = (i: { user: { id: string } }) =>
i.user.id === interaction.user.id;
try {
const confirmation = await response.awaitMessageComponent({
filter: collectorFilter,
time: 30_000,
componentType: ComponentType.StringSelect
});

if (confirmation.customId === "select_track") {
const selectedTrack = res.tracks.find(
(track) => track.identifier === confirmation.values[0]
);

if (selectedTrack) {
player.queue.add(selectedTrack);
await confirmation.update({
content: `\`${selectedTrack.title} - ${await client.date.millisecondsToDuration(selectedTrack.duration)}\` 해당 노래를 대기열에 추가했어요.`,
components: []
});
if (!player.playing) {
player.play();
// player.setVolume();
}
}
}
} catch (e) {
await interaction.editReply({
content: "제한 시간 내에 버튼을 누르지 않아 취소되었습니다.",
components: []
});
}
}
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
When using the command, we implemented the track to be selected and played by the user based on the search. I was just trying to adjust the volume based on the selection.
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
what happened
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
I'm always grateful that you've helped me in something that's not a big deal ❤️
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
Yeah 🙂
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
3|NodeLink Server | [ALL]: Received a request from client.
3|NodeLink Server | Path: /v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: "{\"voice\":{\"sessionId\":\"39b51df23fb1ecb3f9e63dd76c35d676\",\"endpoint\":\"south-korea1115.discord.media:443\",\"token\":\"7b8b0d83d5e3590e\"}}"
3|NodeLink Server | [voice]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: {"voice":{"sessionId":"39b51df23fb1ecb3f9e63dd76c35d676","endpoint":"south-korea1115.discord.media:443","token":"7b8b0d83d5e3590e"}}
3|NodeLink Server | [search]: Found 19 tracks on YouTube for query 7 Years
3|NodeLink Server | [ALL]: Received a request from client.
3|NodeLink Server | Path: /v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: "{\"track\":{\"encoded\":\"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA\"},\"volume\":30}"
3|NodeLink Server | [play]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: {"track":{"encoded":"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA"},"volume":30}
3|NodeLink Server | [volume]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Body: {"track":{"encoded":"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA"},"volume":30}
3|NodeLink Server | [trackStart]: Lukas Graham - 7 Years [Official Music Video] by Lukas Graham.
3|NodeLink Server | [ALL]: Received a request from client.
3|NodeLink Server | Path: /v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: "{\"voice\":{\"sessionId\":\"39b51df23fb1ecb3f9e63dd76c35d676\",\"endpoint\":\"south-korea1115.discord.media:443\",\"token\":\"7b8b0d83d5e3590e\"}}"
3|NodeLink Server | [voice]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: {"voice":{"sessionId":"39b51df23fb1ecb3f9e63dd76c35d676","endpoint":"south-korea1115.discord.media:443","token":"7b8b0d83d5e3590e"}}
3|NodeLink Server | [search]: Found 19 tracks on YouTube for query 7 Years
3|NodeLink Server | [ALL]: Received a request from client.
3|NodeLink Server | Path: /v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: "{\"track\":{\"encoded\":\"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA\"},\"volume\":30}"
3|NodeLink Server | [play]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: {"track":{"encoded":"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA"},"volume":30}
3|NodeLink Server | [volume]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Body: {"track":{"encoded":"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA"},"volume":30}
3|NodeLink Server | [trackStart]: Lukas Graham - 7 Years [Official Music Video] by Lukas Graham.
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
Its work :happypepe:
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
Does it mean to set the <MoonlinkPlayer>.volume property?
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
umm
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
wrong code?
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
Async function included play and set volume method and exec
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
If I do this, the Player will be created late, and the same error will occur
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
If i do this, it'll be output at the default sound value for about a second
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
I think that would be good, too
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
umm
134 replies
MIA🎄 Moonlink.js - Imagine a Music Application
Created by 제스퍼 on 3/10/2024 in #issues
<MoonlinkPlayer>.skip() bug
yeah thats right XD
134 replies