AntiSpamClient

AntiSpamClient

Main AntiSpam class

Constructor

new AntiSpamClient(options)

Parameters:
Name Type Description
options AntiSpamClientOptions

The options for this AntiSpam client instance

Members

cache :AntiSpamCache

The cache for this AntiSpam client instance

Type:

options :AntiSpamClientOptions

The options for this AntiSpam client instance

Type:

Methods

addGuildOptions(guild, options) → {boolean}

Add GuildOptions for a guild to use instead of the default options.

Parameters:
Name Type Description
guild Discord.Guild

The guild to add the options for.

options AntiSpamClientOptions

The options to use for the guild.

Returns:
Type:
boolean

Whether the options have been added.

(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.

kickAdd

Emitted when a member gets kicked.

Properties:
Name Type Description
member Discord.GuildMember

The member that was kicked.

muteAdd

Emitted when a member gets muted.

Properties:
Name Type Description
member Discord.GuildMember

The member that was muted.

warnAdd

Emitted when a member gets warned.

Properties:
Name Type Description
member Discord.GuildMember

The member that was warned.