-
Notifications
You must be signed in to change notification settings - Fork 4
getInviter
JustCarry edited this page May 1, 2018
·
2 revisions
- Returns Inviter. ( Discord API + Discord.js aren't have it )
( GuildMember ) member: Member
The member
-
Sometimes It won't returns inviter. because it just collect the inviters since code started!
-
It'll returns
User Object
-
You'll need wait until client begin then use the function.
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('onMessage', {
func: function ( message ) {
if( message.content == 'myInviter' ) {
message.channel.send( 'Your inviter is: ' + jc.getInviter ( message.member ).username );
}
}
});
jc.exec( ); // Exec codes
});
client.login('token');
Please read here before use