-
Notifications
You must be signed in to change notification settings - Fork 4
Options
JustCarry edited this page Apr 29, 2018
·
3 revisions
In my code, options means arguments. And you can use it more than one time, Maybe Around 10 times.
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!' );
}
}
});
Please read here before use