Skip to content

getInviter

JustCarry edited this page May 1, 2018 · 2 revisions

What is that?

  • Returns Inviter. ( Discord API + Discord.js aren't have it )

Required arguments:

( GuildMember ) member: Member The member

Notices:

  • 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.

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('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');
Clone this wiki locally