Global

Methods

format(string, message) → {string|RichEmbed|MessageEmbed}

This function formats a string by replacing some keywords with variables

Parameters:
Name Type Description
string string | RichEmbed | MessageEmbed

The non-formatted string or RichEmbed

message object

The Discord Message object

Returns:
Type:
string | RichEmbed | MessageEmbed

The formatted string

Type Definitions

AntiSpamData

Cache data for the Anti Spam instance.

Properties:
Name Type Description
messageCache Array.<object>

Array which contains the message cache

warnedUsers Array.<Snowflake>

Array of warned users

kickedUsers Array.<Snowflake>

Array of kicked users

bannedUsers Array.<Snowflake>

Array of banned users

Type:
  • object

AntiSpamOptions

Options for AntiSpam instance

Properties:
Name Type Attributes Default Description
warnThreshold number <optional>
3

Amount of messages sent in a row that will cause a warning.

kickThreshold number <optional>
5

Amount of messages sent in a row that will cause a kick.

warnThreshold number <optional>
7

Amount of messages sent in a row that will cause a ban.

maxInterval number <optional>
2000

Amount of time (ms) in which messages are considered spam.

maxDuplicatesInterval number <optional>
2000

Amount of time (ms) in which duplicate messages are considered spam.

warnMessage string | RichEmbed | MessageEmbed <optional>
'{@user}, Please stop spamming.'

Message that will be sent in chat upon warning a user.

kickMessage string | RichEmbed | MessageEmbed <optional>
'**{user_tag}** has been kicked for spamming.'

Message that will be sent in chat upon kicking a user.

banMessage string | RichEmbed | MessageEmbed <optional>
'**{user_tag}** has been banned for spamming.'

Message that will be sent in chat upon banning a user.

errorMessages boolean <optional>
true

Whether the error messages, when the bot doesn't have enough permissions, must be sent or not

kickErrorMessage string | RichEmbed | MessageEmbed <optional>
'Could not kick **{user_tag}** because of improper permissions.'

Message that will be sent in chat when the bot doesn't have enough permissions to kick the member.

banErrorMessage string | RichEmbed | MessageEmbed <optional>
'Could not ban **{user_tag}** because of improper permissions.'

Message that will be sent in chat when the bot doesn't have enough permissions to ban the member.

maxDuplicatesWarning number <optional>
7

Amount of duplicate messages that trigger a warning.

maxDuplicatesKick number <optional>
10

Amount of duplicate messages that trigger a kick.

maxDuplicatesBan number <optional>
10

Amount of duplicate messages that trigger a ban.

deleteMessagesAfterBanForPastDays number <optional>
1

Amount of days in which old messages will be deleted. (1-7)

exemptPermissions Array.<string> <optional>
[]

Bypass users with at least one of these permissions

ignoreBots boolean <optional>
true

Whether bot messages are ignored

verbose boolean <optional>
false

Extended Logs from module (recommended)

ignoredUsers Array.<string> | function <optional>
[]

Array of string user IDs that are ignored

ignoredRoles Array.<string> | function <optional>
[]

Array of string role IDs or role name that are ignored

ignoredGuilds Array.<string> | function <optional>
[]

Array of string Guild IDs that are ignored

ignoredChannels Array.<string> | function <optional>
[]

Array of string channels IDs that are ignored

warnEnabled boolean <optional>
true

If false, the bot won't warn users

kickEnabled boolean <optional>
true

If false, the bot won't kick users

banEnabled boolean <optional>
true

If false, the bot won't ban users

Type:
  • Object