Skip to content

An advanced moderation bot for discord, allowing for extreme flexibility through TOML based guild configuration

License

Notifications You must be signed in to change notification settings

IAmTomahawkx/bob

Repository files navigation

code style: black made-with-python license dev status discord


Bob

An extremely flexible discord moderation bot

Want to create a spam filter? No problem. Want to mute people who say slurs? Easy. Want to create a system completely customized to your discord server? Go right on ahead.
Bob puts the controls in your hands, and lets you define what happens when, through powerful TOML configuration. For example: a simple spam filter

error-channel = "#errors"
mute-role = "Muted"

[[counter]]
name = "spam"
per-user = true
initial-count = 0
decay = "5/5s"

[[automod]]
event = "message"
actions = [
    { counter = "spam", modify = 1, target = "$userid" },
    { do = "$mute($userid, 'Spamming messages', '10 minutes')", if = "%spam($userid) > 5" }
]

Upload this to Bob, and you're now muting people who send more than 5 messages in a 5-second period.

Bob allows you to preform actions on every event (... that discord provides. Before you ask, no, discord doesn't provide boost events) in your server. This includes making your own commands, through the command configuration:

[[command]]
name = "wave"
arguments = [
    { name = "target", type = "user" },
    { name = "_", type = "text" } # last argument will always get the full remaining text, so we'll just ignore it
]
actions = [
    { reply = ":wave: <@$userid>, $authorname says hello!" }
]

Contributing

If you wish to help develop this bot, please join me in the discord linked above!

Self-Hosting

This bot is freely available for self-hosting, you'll need the following:

  • Python 3.8+
  • Rust 1.53+ (and Cargo of course)
  • Postgresql 11+

Create a new database in postgresql, and ensure the account the bot is connecting with has permission to create tables. Copy the config.example.json file into config.json, and fill out the fields. owners can be left blank unless you want to specify someone else as the owner, otherwise the owner of the bot account will be the owner.
Before running the bot for the first time (and after you update), make sure to run the build-dependancies.py to build the rust dependancies.
The bot itself can be started by running the bot.py file.

About

An advanced moderation bot for discord, allowing for extreme flexibility through TOML based guild configuration

Resources

License

Stars

Watchers

Forks

Releases

No releases published