vijate6856
vijate6856

Reputation: 33

How I can get guild.id

I'm making a team that should create a category with the appropriate rights, but I need some kind of guild id. how can I get the guild server id through the user who wrote this command

    if (message.channel.type === "text" && message.guild && message.guild.ownerID == message.author.id) {
        if (content.startsWith("*install")) {
            let server = message.guild.id[guild.id];
            guild1.createChannel('new-category', {
                type: 'category',
                permissionsOverwrites: [{
                  id: guild.id,
                  deny: ['MANAGE_MESSAGES'],
                  allow: ['SEND_MESSAGES']
                }]
              })
                .then(console.log)
                .catch(console.error);
        }
    }

Upvotes: 1

Views: 208

Answers (1)

Syntle
Syntle

Reputation: 5174

you can use message.guild.id

if (message.channel.type === "text" && message.guild && message.guild.ownerID == message.author.id) {
        if (content.startsWith("*install")) {
            
            guild1.createChannel('new-category', {
                type: 'category',
                permissionsOverwrites: [{
                  id: message.guild.id,
                  deny: ['MANAGE_MESSAGES'],
                  allow: ['SEND_MESSAGES']
                }]
              })
                .then(console.log)
                .catch(console.error);
        }
    }

Upvotes: 1

Related Questions