Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
Looking for a error message to the user is 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);
                  });
            }

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

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You can use an if () statement:

if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.reply({content: 'you must be in the same voice channel as me'})

Or you can use .some() method to return a boolean, like:

const sameChan = client.voice.connections.some((c) => c.channel.id === msg.member.voice.channelID)
if (!sameChan) return message.reply({content: 'you must be in the same voice channel as me'})

I recommend using the first choice though

about 4 years ago · Juan Pablo Isaza Relatório

0

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 (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) 
return message.reply({content: 'you must be in the same voice channel as me'})
             }});
----------------------------------------------------------------------------
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 (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.reply({content: 'you must be in the same voice channel as me'})
             };
                 .then((m) => {
                   setTimeout(() => {
                     m.delete();
                   }, 1500);
                 });
           }
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda