A
A
anubis4652020-02-14 12:07:28
JavaScript
anubis465, 2020-02-14 12:07:28

Do you need to fix errors in the js code for a discord bot (module)?

module.exports.run = async (client, message, args) => {
   
    let role = msg.guild.roles.find(c => c.name === msg.content.split(" ")[1])
    let user = msg.mentions.members.first();
    if(msg.member.permissions.has('MANAGE_ROLES')){
    user.addRole(665885947908587545);
    msg.reply(`Пользователю была выдана роль!` );
    console.log(`Пользователю была выдана роль `)
    }
    msg.reply(`Вы не имеете право выдавать роли!`);
    console.log(`Пользователь не имеет право выдавать роли!`);
    
    module.exports.help.name = {
        name: "give"
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Melnykov, 2020-03-01
@NickProgramm

Maybe if the user does not have rights to return and send a message that there are no rights and write the code as is + there are a lot of bot sources on Github, borrow from them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question