-
Notifications
You must be signed in to change notification settings - Fork 4
onMessage
JustCarry edited this page Apr 30, 2018
·
4 revisions
- When it found message content contains your message content
onMessage
-
(String) message:
Content
The message to check -
(String) reply:
Content
The reply message.
Note: Use [user] to mention
-
(String) addRole:
Role ID
The role to add to member. -
(String) removeRole:
Role ID
The role to remove to member. -
(Number) spam:
Milliseconds
The anti-spam dealy -
(String) spamMessage:
Content
The anti-spam message, it comes when someone spamming
const Discord = require('discord.js');
const jc = require('jc-codes');
const client = new Discord.Client();
jc.setClient( client ) // Put client
jc.add('onMessage', { message: 'ping', reply: '[user], Pong!', spam: 5000, spamMessage: "[user], Don't spam please" }); // Using onMessage code, example for ping pong & anti-spam,
jc.exec( ); // Exec codes
client.login('token');
Please read here before use