sahnee-bot

Der Bot um Verwarnungen auf deinem Discord Server zu verwalten.

Mit dem sahnee-bot können einzelne Benutzer, oder alle Benutzer auf dem Discord Server verwarnt werden.

Auch kannst du dir gut aussehende Ranglisten anzeigen lassen, wer die meisten Verwarnungen hat.
Nicht zu vergessen, die Historie. Jederzeit herausfinden wann warum welche Verwarnung ausgestellt wurde.

Lade den sahne-bot noch heute auf deinen Discord Server ein!

Index:

  1. Get the bot on your server
  2. Commands
  3. Permissions
  4. Jobs
  5. How to install on your own hardware
    1. Download and run
    2. The configuration file

1. Get the bot on your server

Click, click, done – Bot hosting provided by sahnee.dev

You’re done, enjoy!

2. Commands

  • /warn @UserName "Your reason here!" – Issues a warning to the given user. The user will also be notified personally about their most evil transgression.
  • /unwarn @UserName "Your reason here!" – Revokes a warning from the given user. The user will also be notified personally.
  • /unwarn @UserName – Revokes a warning from the given user. This allows for not giving a reason why the user has been unwarned. The user will also be notified personally.
  • /warnall "Your reason here!" – Issues a warning to all users and bots on your server.
  • /warnhistory @UserName – Shows the warning history for the given user. The default amount is 10. It can be changes via the configuration file
  • /warnhistory @UserName <Amount> – Does the same as the default command but shows a custom amount of historical entries.
  • /warnleaderboard – Prints a leaderboard of the top warned people on your guild. The default amount can be set in your configuration.
  • /warnleaderboard <Amount> – Does the same as above but prints out a custom amount of people.Information: Bots can be warned but will never receive any message of their warning like users would.

3. Permissions

Permissions are handled by role names on your discord server.

If hosted by sahnee.dev:

You need to make sure that the default roles exist on your server. Otherwise you cannot control the bot.

These are the default roles:

Module Role-name
WarningBot Owner, Administrator, Admin, Server Admin, Moderator, Mod, Mods, Staff, Community Manager

If self-hosted:

The config.json provides a section called Admins for each „Module“ of the bot to be accessed with separate roles.

If you host this bot yourself, you can configure the roles by your needs. You can add any name into the configuration file config.json into the Admins array. This array can contain 1+n roles.

Example:

    "WarningBot": {
        "WarningPrefix": "warning: ",
        "WarningRoleCleanup": "0.00:30:00",
        "DatabaseCollection": "warningbot",
        "WarningHistoryCount": 10,
        "WarningLeaderboardCount": 3,
        "Admins": [
            "Owner",
            "Administrator",
            "Admin",
            "Server Admin",
            "Moderator",
            "Mod",
            "Mods",
            "Staff",
            "Community Manager"
        ]
    },

This means, everyone that is in one of the roles mentioned above will be able to access the Warn Module.

4. Jobs

Because we’ve encountered that having so many warning-roles on your server, will make creating and modifying your own roles a bit laggy. Furthermore because there is a limit on how many roles your server can have, we’ve create the job-system.

Currently these jobs are available:

Job-Name Description Default execution time
CleanupWarningRoles This job will go through all of the roles on your server and delete unassigned warning-roles Every day

5. How to install on your own hardware

5.1 Download an run

Linux:

  1. Get the bot working: Start your bot ./sahnee-botYou are done! Enjoy your bot.

Windows:

Not supported yet.

5.2. The configuration file

In case you get lost, this is the default config:

{
    "Logging": {
        "LogLevel": {
            "Default": "Debug",
            "System": "Information",
            "Microsoft": "Information"
        }
    },
    "General": {
        "Id": "<Your ID here>",
        "Permissions": 8,
        "Token": "<Your token here>",
        "CommandPrefix": "/",
        "DatabasePath": "./sahnee-bot.db",
        "CommandChannel": "bot-commands"
    },
    "WarningBot": {
        "WarningPrefix": "warning: ",
        "WarningRoleCleanup": "0.05:00:00",
        "DatabaseCollection": "warningbot",
        "WarningHistoryCount": 10,
        "WarningLeaderboardCount": 3,
        "Admins": [
            "Owner",
            "Administrator",
            "Admin",
            "Server Admin",
            "Moderator",
            "Mod",
            "Mods",
            "Staff",
            "Community Manager"
        ]
    }
}

Let’s go through the settings

Setting Description
General:Id The client ID of the bot. The client we are hosting publicly is 603990770667487243, if you want to run your own bot insert your ID here.
General:Permission The permissions of this bot. By default the bot has permission 8 which makes it an administrator. (This is subject to change in a later version)
General:Token Your super secret bot token. See how to generate one [1]
General:CommandPrefix Defines the prefix for using any command. Can be any single character. By default it’s set to /.
General:DatabasePath Defines the path/location of your database file. We’re using LiteDB [2] This will also be the location of the database log file.
General:CommandChannel Defines the channel where the bot will listen for commands.
WarningBot:WarningPrefix Users will be given a role based on their warning count. If this value is e.g. set to "warnings:“ the role of 4 warnings will be named „warnings: 4“.
WarningBot:WarningRoleCleanup This is the cleanup job for your warning-roles. The format is a TimeSpan. 0(days).00(hours):00(minutes):00(seconds). Please notice the . between the days and hours.
WarningBot:DatabaseCollection Name for the Collection(Table) in the database. Only change if you really need to.
WarningBot:WarningHistoryCount The default amount of warnings to show if the /warnhistory @UserName command is issued.
WarningBot:WarningLeaderboardCount The default amount of people to show if the /warnleaderboard command is issued.
WarningBot:Admins In order to issue warnings a user must have at least one of these permissions.

[1] Source: https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token

[2] Source: http://www.litedb.org/