onMessage - JustCarry/JC-Codes GitHub Wiki
When it works ?
- When it found message content contains your message content
Code Name:
onMessage
Required arguments:
-
(String) message:
Content
The message to check -
(String) reply:
Content
The reply message.
Note: Use [user] to mention
Optional arguments:
-
(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
Example:
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');