Skip to content

Config File

Shaun edited this page Sep 25, 2020 · 5 revisions

A sample configuration file with default values is provided and can be used by removing .sample from the extension of the file. The various fields in this YAML file will determine how various aspects of the bot will work.

The Prefix and Token fields

The Prefix and Token fields are relatively straightforward.
For example, if Prefix is set to ., then the commands are in the form of .[commandName].
Meanwhile, the Token is a valid Discord bot token. To get one, see https://discordapp.com/developers/applications or https://www.writebots.com/discord-bot-token/.

Reminder: Never share your Discord Bot Token with anyone.

The Activity fields

The Activity fields are for the bot's custom status. For example, the status could be "Playing 🦉 Simulator".

For the available Types, see https://github.com/discord-net/Discord.Net/blob/dev/src/Discord.Net.Core/Entities/Activities/ActivityType.cs.
For the available Flags, see https://github.com/discord-net/Discord.Net/blob/dev/src/Discord.Net.Core/Entities/Activities/ActivityProperties.cs.
For more information on the Activity fields in general, see https://github.com/discord-net/Discord.Net/blob/dev/src/Discord.Net.Core/Entities/Activities/IActivity.cs.

Modmail Fields

This field specifies the server ID that the modmail module will be used on. The ModMailServer field determines which server contains the channel that notifications are being sent to. By default it is set to zero.

Database Fields

The DbPath field specifies the path to the database file. This field must have the file extension provided. Alternatively, this path can be specified as a command line argument.

Backup Configuration Fields

These fields are used if the automatic database backup service is desired.

  • The BackupOutputPath field specifies where the folder where database backups will be stored.
  • The BackupScript field determines the location of the external script which handles the backups. This backup system supports either Linux shell or Windows powershell. The extension does not need to be provided.
  • The NumberOfBackups field determines the number of backups that the system will store at any time.

Random Responses

The bot is configured to randomly respond to messages containing specific text. These fields handle the random responses.

The random responses are stored as a list with three parameters that are used.

  • The Input parameter specifies the regex that is used. This regex will return matches if it is successful. It should be noted that the escape character (\) must be used to escape special characters.
  • The Response field specifies what the bot will respond with if there is a regex match
  • The Probability field specifies the probability from 0 to 1 that the bot will respond with the response if there is a regex match.

Raid Protection Fields

These fields are used to configure the values that are used within the raid protection service.

  • MaxMentionCount specified the maximum number of mentions that a user can put in one message before the bot takes action on the user
  • ForgivenDuration specifies the duration, in milliseconds, of when a user is forgiven after they have triggered the raid protection
  • DurationForMaxMessages specifies the rate at which users can send messages. This will trigger if there are more than 5 messages sent from the same user within this time frame.
  • MaxNumberOfPunishments specifies the number of times a user is warned by the raid protection system before they are muted/banned
  • BotMessageDeletionDelay specifies the duration between the bot sending a warning message, and the message being deleted
  • RemovedPunishedUserDelay specifies the delay before a user is removed from the list of punished users. If too many users are in the punished users list, the system warns the mods of a potential raid.
  • MaxNumberPunishedUsers specified the maximum number of users that can exist in the list of punished users before the bot informs the moderators of a potential raid.
  • MaxNumberOfJoins specifies the maximum number of joins that can occur within a specified time frame before the moderators are alerted about a possible raid
  • UserJoinsDelay specifies the duration in which a user is removed from the user join list after they join the server
  • MaxNumberEmojis specified the maximum number of custom and unicode emotes that can exist in a message before the bot warns the user
  • MaxNumberSequentialCharacters specifies the maximum number of times a letter can be repeated in a row before the bot warns the user