O
O
OreshekXD2020-06-27 19:23:16
JavaScript
OreshekXD, 2020-06-27 19:23:16

What code is needed for the bot to issue a role after writing the command?

Library - discord.js Command
example !giverole
It is necessary that the bot would issue a role by its "ID"
AND on a certain server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-06-27
@OreshekXD

args = message.content.split(' ');
args.shift();
args = args.join(' ');

  if (message.content === `${prefix}giverole`, args) {
    var role = message.guild.roles.cache.find(role => role.id === args);
    message.member.roles.add(role);
  }})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question