getRole - JustCarry/JC-Codes GitHub Wiki

What is that?

  • To get role by name.

Required arguments:

( String ) roleName: Code name The code name, to use it!

Notices:

  • You don't need to write all of role name you can write some of it.

  • It'll returns Role Object

  • You'll need wait until client begin then use the function.

Example:


const Discord = require('discord.js');
const jc = require('jc-codes');
const client = new Discord.Client();

jc.setClient( client ) // Put client
client.on( 'ready', ( ) =>{
jc.add('onJoin', { message: 'Welcome there, [user] have joined to our server', channel: 'channel-id', role: jc.getRole('roleNam').id } )
// when some one join we'll give him role called roleName
jc.exec( ); // Exec codes
});

client.login('token');