Scripting
A useful and powerful feature.
Command Usage
Examples
Naughty Word Filter
if (message.getContents().contains("naughty word")) {
message.delete();
}message.getContents(); // returns a string containing the contents of the message
message.getTimestamp(); // returns a Java Instant object containing the message timestamp
message.getId(); // returns a Snowflake containing the ID
message.getAuthor(); // returns a SafeMember object which is the member that sent the message
message.getChannel(); // returns a SafeChannel object which is the channel the message was sent in
message.getGuild(); // returns a SafeGuild object which is the guild the message was sent in
message.mentionsEveryone(); // returns if the message mentions everyone
message.delete(); // deletes the message
message.edit('new content'); // edits the message ONLY if it is sent by the bot and returns the SafeMessage objectLast updated
Was this helpful?