Constructor
new AntiSpamClient(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
AntiSpamClientOptions
|
The options for this AntiSpam client instance |
Members
Methods
(async) message(message) → {Promise.<boolean>}
Checks a message.
Parameters:
Name | Type | Description |
---|---|---|
message |
Discord.Message
|
The message to check. |
Returns:
- Type:
-
Promise.<boolean>
Whether the message has triggered a threshold.
Example
client.on('message', (msg) => {
antiSpam.message(msg);
});
reset()
Reset the cache of this AntiSpam client instance.
(async) userleave(member) → {Promise.<boolean>}
Checks if the user left the server to remove him from the cache!
Parameters:
Name | Type | Description |
---|---|---|
member |
Discord.GuildMember
|
The member to remove from the cache. |
Returns:
- Type:
-
Promise.<boolean>
Whether the member has been removed
Example
client.on('guildMemberRemove', (member) => {
antiSpam.userleave(member);
});
Events
banAdd
Emitted when a member gets banned.
Properties:
Name | Type | Description |
---|---|---|
member |
Discord.GuildMember
|
The member that was banned. |
channel |
Discord.TextChannel
|
The channel that the spam messages was sent in. |
message |
Discord.Message
|
The message that was sent as last. Could be used to find the guild object etc.. |
kickAdd
Emitted when a member gets kicked.
Properties:
Name | Type | Description |
---|---|---|
member |
Discord.GuildMember
|
The member that was kicked. |
channel |
Discord.TextChannel
|
The channel that the spam messages was sent in. |
message |
Discord.Message
|
The message that was sent as last. Could be used to find the guild object etc.. |
muteAdd
Emitted when a member gets muted.
Properties:
Name | Type | Description |
---|---|---|
member |
Discord.GuildMember
|
The member that was muted. |
channel |
Discord.TextChannel
|
The channel that the spam messages was sent in. |
message |
Discord.Message
|
The message that was sent as last. Could be used to find the guild object etc.. |
warnAdd
Emitted when a member gets warned.
Properties:
Name | Type | Description |
---|---|---|
member |
Discord.GuildMember
|
The member that was warned. |
channel |
Discord.TextChannel
|
The channel that the spam messages was sent in. |
message |
Discord.Message
|
The message that was sent as last. Could be used to find the guild object etc.. |