寻找向用户的错误消息是Notinvoice
collector.on("collect", async (i) => {
i.deferReply({ ephemeral: true }).catch(() => {});
if (!interaction.member.voice.channel)
return i.followUp({
content:
emojis.error + ` | **You Must Join A Voice Channel**`,
ephemeral: true,
});
if (interaction.guild.me.voice.channel) {
if (
interaction.member.voice.channel?.id !==
interaction.guild.me.voice.channel?.id
)
return i.followUp({
content:
emojis.error +
` | **You Must Join <#${interaction.guild.me.voice.channel.id}> To Contolr The Panel**`,
ephemeral: true,
});
}
-----------------------------------------------------------------------------
else if (panelType == "reactions") {
if (!interaction.member.voice.channel)
return interaction.channel
.send(emojis.error + ` | **You Must Join A Voice Channel**`)
.then((m) => {
setTimeout(() => {
m.delete();
}, 1500);
});
if (interaction.guild.me.voice.channel) {
if (
interaction.member.voice.channel?.id !==
interaction.guild.me.voice.channel?.id
)
return interaction.channel
.send(
emojis.error +
` | **You Must Join <#${interaction.guild.me.voice.channel.id}> To Contolr The Panel**`
)
.then((m) => {
setTimeout(() => {
m.delete();
}, 1500);
});
}
任何人都可以帮忙..我想要用户在玩游戏时键入前缀时。我希望用户收到一条错误消息,如果他不在某个频道中,他将无法播放该歌曲。此代码确实如此不执行它可以将其修复给我
collector.on("collect", async (i) => {
i.deferReply({ ephemeral: true }).catch(() => {});
if (!interaction.member.voice.channel)
return i.followUp({
content:
emojis.error + ` | **You Must Join A Voice Channel**`,
ephemeral: true,
});
if (interaction.guild.me.voice.channel) {
if (
interaction.member.voice.channel?.id !==
interaction.guild.me.voice.channel?.id
)
return i.followUp({
content:
emojis.error +
` | **You Must Join <#${interaction.guild.me.voice.channel.id}> To Contolr The Panel**`,
ephemeral: true,
});
}
-----------------------------------------------------------------------------
else if (panelType == "reactions") {
if (!interaction.member.voice.channel)
return interaction.channel
.send(emojis.error + ` | **You Must Join A Voice Channel**`)
.then((m) => {
setTimeout(() => {
m.delete();
}, 1500);
});
if (interaction.guild.me.voice.channel) {
if (
interaction.member.voice.channel?.id !==
interaction.guild.me.voice.channel?.id
)
return interaction.channel
.send(
emojis.error +
` | **You Must Join <#${interaction.guild.me.voice.channel.id}> To Contolr The Panel**`
)
.then((m) => {
setTimeout(() => {
m.delete();
}, 1500);
});
}
anyone can help please .. I want the user when he types the prefix while he play.. I want the user to get a error message that he can't play that song if he is not in the some channel.. this code does not execute it can someone fix it to me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
if()
语句:或者可以使用
.some()
方法返回布尔值,例如:我建议使用第一选择
You can use an
if ()
statement:Or you can use
.some()
method to return a boolean, like:I recommend using the first choice though