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

415
Visualizações
create a text channel on message react(limit to specific message or specific channel)

(node:19040) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'guild' of undefined at Client. (C:\Users\admin\Desktop\Commendbot\app.js:90:30)

bot.on("messageReactionAdd", async (reaction, user, message) => { //Add an event listener
if (reaction.message.partial) await reaction.message.fetch();
const channels = message.guild.channels.cache
channels.find(channel => channel.name === 'createchannel')

if (user.id === client.user.id) return; //If the reaction was from the bot, return
if (!reaction.message.guild) return; //If the reaction was not in a guild

if (reaction.emoji.name === "👍") {
  let guild = reaction.message.guild
  guild.channels.create(`channel-${user.id}`, { //Creating the channel
      type: 'text', //Make sure the channel is type is text
      permissionOverwrites: [ //Set overwrites
          {
              id: guild.id,
              allow: ['VIEW_CHANNEL'],
          }]
      })
}

});

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

0

messageReactionAdd only gives 2 objects: the MessageReaction and User. You can get the message from the reaction

const channels = reaction.message.guild.channels.cache
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