Global

Methods

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

This function formats a string by replacing some keywords with variables

Parameters:
Name Type Description
string string | RichEmbed

The non-formatted string or RichEmbed

message object

The Discord Message object

Returns:
Type:
string | RichEmbed

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

users Array.<object>

Array which contains the dates on which each user's message was sent

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.

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

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

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

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

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

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

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