Options - JustCarry/JC-Codes GitHub Wiki
What are options?
In my code, options means arguments. And you can use it more than one time, Maybe Around 10 times.
How can i use it ?
Required arguments mean that arguments you must put it And Optional means argument no need to put it!
Here example to how to use it:
jc.add( 'onMessage',
{
message: "Hi",
reply: "Hi, how are you doing?"
});
And here another example for one more time options:
jc.add( 'onMessage',
[
{
message: "Hi",
reply: "Hi, how are you doing?"
},
{
message: "Fine, and you?",
reply: "Fine, thanks!"
}
]
);
And here another example for optional arguments:
jc.add( 'onMessage',{
message: "I want role!",
reply: "You ask for it, you got it!",
role: 'role-id' // this is optional argument
}
);
And there way to use function instead of arguments:
jc.add( 'onMessage', {
func: function ( message ){
if( message.content == 'ping' ){
message.reply( 'Pong!' );
}
}
});