Go HTML PLpgSQL CSS SQLPL Dockerfile
Switch branches/tags
Nothing to show
Clone or download
Latest commit 1ee32cb Jul 20, 2018
Permalink
Failed to load latest commit information.
boredmodule v0.9.0 initial commit Jan 22, 2018
bucketmodule v0.9.0 initial commit Jan 22, 2018
countersmodule fix perms Jun 30, 2018
filtermodule Fix updater Jun 23, 2018
markovmodule Fix installer for linux Apr 11, 2018
miscmodule Fix crashes, make wipe easier to use Jul 21, 2018
quotemodule Add !createrole, fix getconfig and setconfig Jan 26, 2018
rolesmodule Fix rolesmodule crash Jun 19, 2018
schedulermodule Fix #80 Apr 6, 2018
spammodule Fix crashes, make wipe easier to use Jul 21, 2018
statusmodule Add !createrole, fix getconfig and setconfig Jan 26, 2018
sweetie Implement counter module and rename autosilence Jun 30, 2018
sweetiebot Fix crashes, make wipe easier to use Jul 21, 2018
tagmodule Add !createrole, fix getconfig and setconfig Jan 26, 2018
updater v0.9.0 initial commit Jan 22, 2018
usersmodule Implement counter module and rename autosilence Jun 30, 2018
wittymodule v0.9.0 initial commit Jan 22, 2018
.gitignore Fix installer for linux Apr 11, 2018
500.html update readme Feb 8, 2018
CONTRIBUTING.md v0.9.0 initial commit Jan 22, 2018
Dockerfile Fix updater Jun 23, 2018
Dockerfile.mariadb Add docker support May 12, 2018
LICENSE Initial commit Jan 25, 2016
README.md Fix updater Jun 23, 2018
docker-compose.yaml Add docker support May 12, 2018
docker_run.sh Add docker support May 12, 2018
favicon.ico v0.9.0 initial commit Jan 22, 2018
legacy_migrate.sql Fix installer for linux Apr 11, 2018
makefile Version 0.1.0 commit Jan 25, 2016
selfhost.json Add docker support May 12, 2018
sql_591887.sql v0.9.0 initial commit Jan 22, 2018
sql_592129.sql v0.9.9.1 database upgrades Jan 23, 2018
sql_592133.sql Fix search fuzziness, defer hot database insertions Jan 24, 2018
sql_592134.sql improve database error handling, fix race condition Jan 24, 2018
sql_592141.sql Fix #72 Mar 8, 2018
sql_592142.sql fix daylight savings and user searching Mar 14, 2018
sql_592143.sql Fix #79 Apr 6, 2018
sql_592144.sql Fix installer for linux Apr 11, 2018
sql_592146.sql Fix database cleanup Apr 25, 2018
sql_592147.sql Replace polls with emoji polls, fix installer May 5, 2018
sweetiebot.sql Preliminary fixes, to be tested Jul 20, 2018
sweetiebot.svg v0.9.0 initial commit Jan 22, 2018
sweetiebot_tz.sql v0.9.0 initial commit Jan 22, 2018
web.css Add !createrole, fix getconfig and setconfig Jan 26, 2018
web.html Fix updater Jun 23, 2018

README.md

Sweetie Bot

GoDoc Go report Sweetie Bot Discord

Sweetie Bot is an administration bot for Discord servers whose primary function is anti-spam, by detecting potential spammers, silencing them, and deleting their messages. Many users joining at the same time will trigger a lockdown to help immunize the chat against raids. Patreon supporters also have access to a chat log that allows moderators to track deleted messages.

To add Sweetie Bot to your server, use this link.

If you have questions about Sweetie Bot, please join its support channel

If you use Sweetie Bot, consider contributing to its Patreon to help pay for maintenance costs and get additional features.

Installing Sweetie Bot

A limited version of Sweetie Bot can be added to any server via this link. For $5 a month, you can install your own instance of sweetie bot anywhere you want, with all features unlocked, which will automatically keep itself up-to-date. Download the selfhost executable for your operating system and run it from the directory you want the bot to be in. Follow the installation instructions provided and the bot will be up and running in no time.

Windows (64-bit)

Windows (32-bit)

Linux (64-bit)

Linux (32-bit)

Sweetiebot Silver

Donating at least $1 a month to the Patreon will automatically enable chat logging for your server, which is only accessible by moderators via the !search command. It will also enable much higher limits for the total number of unique items you can store in tagged item collections. In order to recieve these benefits, you must link your Patreon and Discord accounts, and you must join the Sweetie Bot Support Channel. The bot cannot detect your donation level unless you are on the server and your account has been linked.

Documentation

Please visit the official website for help with commands and configuration.

Setup

Upon being added to a server, Sweetie Bot will begin with all commands and modules disabled. Only users with admin rights can setup a server. Sweetie Bot will send the owner of the server a PM when she is first added with instructions on how to run the !setup command. In case you missed it, !setup takes the following parameters, in order:

  • Mod Role should be set to a role shared by all moderators. It is used to alert moderators and also allows the moderators to bypass command restrictions imposed by certain modules.
  • Mod Channel should be set to whatever channel the moderators would like to recieve notifications on, such as potential raids, spammers being silenced, etc.
  • Log Channel [OPTIONAL] should be set to a channel that recieves log messages about errors and initialization. Usually this channel is only visible to the bot and the moderators.

For example: !setup @Mods #staff-lounge #bot-log

!setup will automatically restrict all sensitive commands to modrole and enable a default set of modules. Running the setup twice will delete everything and reset all configuration values. Specify an additional OVERRIDE parameter if this is your intent.

DO NOT GIVE SWEETIE BOT ADMINISTRATIVE PERMISSIONS OR THE ABILITY TO PING EVERYONE! Sweetie bot does not and will never attempt to filter @everyone pings. Sweetie bot only requires the following permissions: Manage Server, Manage Roles, Ban Members, Manage Messages, Mute Members, plus all the default read/write permissions given to everyone.

Additional configuration is optional via !setconfig but usually isn't necessary. DO NOT SET PRESSURE VALUES UNLESS YOU NEED TO CHANGE THEM. The pressure values are already set up for you and setting them incorrectly will result in Sweetie Bot silencing everyone instantly.

Configuration

Basic configuration parameters can be set with !setconfig <parameter name> <value>. To get a list of configuration parameters, use !getconfig. To output the current value of a parameter, use !getconfig <paramater name>. Do not use quotes on these values if they have spaces.

Certain configuration parameters are more complex. They can either be maps, lists, or maps of lists. This type information is listed when using !getconfig. Parameters that are lists simply take multiple values instead of one. Setting a list parameter to a set of values will replace the current list of values. In list parameters, all values must use quotes if they have spaces in them.

!setconfig <list parameter> <value 1> <value 2> <value 3> <etc...>
!setconfig bored.commands !drop "!pick cute"

You may pass no values to a list, which will simply set the list to nothing:

!setconfig bored.commands

Maps are a set of key-value pairs. Unlike lists, each invocation of !setconfig will set just a single key-value pair and won't affect any others. If a key already exists, the value of that key will be overwritten.

!setconfig <map parameter> <key> <value>
!setconfig basic.aliases listbucket list

If no value is given, the key will be deleted:

!setconfig basic.aliases listbucket

Maps of lists match keys to entire lists of values instead of just one value. The syntax is similar to setting a single map value:

!setconfig <maplist parameter> <key> <value 1> <value 2> <value 3> <etc...>
!setconfig modules.commandchannels roll #channel1 #channel2

To delete a value, simply provide only the key and no values:

!setconfig modules.commandchannels roll

Some maplists are whitelists of channels or roles. To change them into a blacklist, add ! anywhere in the maplist:

!setconfig modules.commandchannels roll ! #excludedchannel1 #excludedchannel2

Error Recovery

Sweetie Bot can function with no database, but most commands will no longer function, and it will be impossible to respond to PMs. While in this state, there will be no errors in the log about failed database operations, because Sweetie Bot simply won't attempt the operations in the first place until she can re-establish a connection. After a database failure is detected, she will attempt to reconnect to the database every 30 seconds. She also has a deadlock detector which sends fake !about commands through the pipeline every 20 seconds - if Sweetie Bot fails to respond for 1 minute and 40 seconds, she will automatically terminate and restart.

Docker Instance

Sweetiebot can be run in a docker instance. Clone the repo, then edit the example selfhost.json file provided in the root directory. Provide a token from https://discordapp.com/developers/applications/me, provide the mysql root password, and put in the ID of your server. Remember to first add the bot to your server before attempting to start it from your application page. Once you've filled out selfhost.json, simply run docker build . to build a working image of sweetiebot.

If you are using docker compose, follow all the previous steps, but also edit docker-compose.yaml. Replace <YOUR PASSWORD> with the same mysql root password you used in selfhost.json. Then simply run docker-compose up and it will build the images. When first booting up, sweetiebot will fail to connect to the database while it's being built - simply wait a minute or two, and the bot will automatically re-establish a connection once it exists. When sweetie exits, the updater will run, and then the container will terminate. Docker-compose has been set to automatically restart it for you, but you can change this and any other options to suit your needs.


©2018 Erik McClure