# 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
`mutedUsers` | `Array.<Snowflake>` | Array of muted 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.
`muteThreshold` | `number` | <optional> | 3 | Amount of messages sent in a row that will cause a mute.
`kickThreshold` | `number` | <optional> | 5 | Amount of messages sent in a row that will cause a kick.
`banThreshold` | `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.
`muteMessage` | `string` | `RichEmbed` | `MessageEmbed` | <optional> | '**{user_tag}** has been muted for spamming.' | Message that will be sent in chat upon muting 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.
`muteErrorMessage` | `string` | `RichEmbed` | `MessageEmbed` | <optional> | 'Could not mute **{user_tag}** because of improper permissions or the mute role couldn\'t be found.' | Message that will be sent in chat when the bot doesn't have enough permissions to mute the member or if the mute role couldn' t be found!.
`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.
`maxDuplicatesWarn` | `number` | <optional> | 3 | Amount of duplicate messages that trigger a warn.
`maxDuplicatesMute` | `number` | <optional> | 7 | Amount of duplicate messages that trigger a mute.
`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)
`debug` | `boolean` | <optional> | false | Whether to run the module in debug mode
`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 mute users
\
`muteEnabled` | `boolean` | <optional> | true | If false, the bot won't mute 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
`muteRoleName` | `String` | <optional> | 'Muted' | Name of the role given to the users on mute
`modLogsChannelName` | `String` | <optional> | 'mod-logs' | Name of the modlogs channel
`modLogsEnabled` | `boolean` | <optional> | false | If should be turned on!
`removeMessages` | `boolean` | <optional> | true | If the bot should remove the messages on action!

##### Type:

- `Object`