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

228
Visualizações
How can I check for a specific role in a different guild and make it a boolean?
const Command = require("../../Ana/Command")
const config = require("../../config.json")
const prefix = config.prefix;

module.exports = new Command({
    name: "team",
    aliases: ["tm"],
    description: "Gives you your desired team.",
    category: "Gamemaster",

    run: async (bot, message, args, client, Discord) => {
        await message.reply("Please wait!").then(async msg => {
            var command = message.content.slice(prefix.length).split(" ")[0],
                topic = message.content.split(" ")[1];
            const isTRO = message.member.roles.cache.some(role => role.id === '948567643194003476') //Checks if you have a role in a different server, the bot is invited in that specific server
            switch (command) {
                case "team":
                    if (!topic) return message.channel.send('no team selected.... are you kid??');
                    if (topic === "TRO") {
                        return message.channel.send("Checking if you have access to TRO.")
                        if (isTRO = 'true') {
                            message.reply('You have access to TRO.')
                        }
                    }
            }
        })
    }
})

I have tried multiple solutions

I am trying to check for a specific role in a guild and give a role on the "Current" guild.

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

0

You can use the message.member.roles.cache.has() method to check if they have a role.

message.member.roles.cache.has('948567643194003476');
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