serenity

Swear Jar

Counts how often members swear, and tells them how deep they are in it.

Replace [prefix] with your server's prefix.

The swear jar counts. It does not delete anything, mute anyone or hand out punishments — that is what the chat filter is for. Someone swears, the number goes up, and the jar says how deep they are in it.

Turning It On

// Syntax
[prefix]swearjar enable

// Example
;swearjar enable

Needs Manage Server. From that moment every message is checked against Serenity's built-in word lists, and the jar replies in the channel the swear happened in.

;swearjar disable    // stops counting, keeps every tally

Disabling only flips the switch. Nobody's count is lost, so turning the jar back on picks up where the server left off.

The Three States

A server is always in exactly one of these:

StateWhat members see
DisabledNothing. Nothing is counted either.
EnabledA reply in the channel, every time
Enabled with swearjar message noneNothing — but the counting continues

The third one is the quiet option: [prefix]swearjar and the leaderboard still have the real numbers, the jar just stops talking about them.

What Counts

Serenity ships word lists in eleven languages, covering both ordinary swearing and slurs. They are on by default.

;swearjar builtin off    // count only your own words
;swearjar builtin on

The jar matches the word as it was actually written, after seeing through the usual tricks: fuuuck, f*ck, f.u.c.k, f u c k and sh1t all land on the same entry. What it will not do is guess — a word that merely resembles one on the list is not counted, because a tally built on guesses is worse than one that misses the occasional creative spelling.

Repeating a word counts each time: "fuck fuck fuck" is three. A word that only shows up obfuscated counts once for that message, since "f u c k f u c k" has no honest occurrence count.

Your Own Words

// Syntax
[prefix]swearjar add [word]

// Example
;swearjar add frittenbude
;swearjar remove frittenbude
;swearjar list      // everything you added yourself
;swearjar clear     // remove all of them, keep the built-in lists

Your own words are counted on top of the built-in lists — or instead of them, with builtin off. Phrases work too, not just single words.

Switching the built-in lists off without adding any words of your own leaves the jar enabled and counting nothing at all.

Leaving People Alone

// Syntax
[prefix]swearjar ignore add [channel/role/member]

// Example
;swearjar ignore add #venting
;swearjar ignore remove #venting
;swearjar ignore list

Channels, roles and members can all be ignored. A thread follows its parent channel, so ignoring #venting covers the conversations underneath it.

The Message

// Syntax
[prefix]swearjar message [text]

// Example
;swearjar message {user.mention} owes the jar again — **{swear.total}** so far
;swearjar message view      // the script currently in use
;swearjar message reset     // back to the default
;swearjar variables         // what you can put in it

The message is full embed code, so the jar's reply can be a proper embed rather than a line of text. On top of the usual variables it has these of its own:

VariableOutput
{swear.word}The word that was triggered
{swear.count}How often that member has said that word
{swear.total}How often that member has sworn in total
{swear.count.plural}An s, unless that word count is exactly 1
{swear.total.plural}An s, unless the total is exactly 1

The two plural variables are there because your message is one string for every count, so 1 times is otherwise unavoidable. They render the s on its own, which means they work with whatever noun you put in front of them:

;swearjar message {user.mention} — {swear.count} time{swear.count.plural} for {swear.word}

{swear.count} and {swear.total} are different numbers and read badly alone. A message that only quotes the first one sounds like the member has never said anything else.

Writing Embed CodeHere, you can learn about how to script embeds for commands that support this feature.

Silence

;swearjar message none

Keeps counting, stops replying. To start replying again, write a new message or run ;swearjar message reset.

Slowing It Down

There are two cooldowns, and they do different jobs.

// Syntax
[prefix]swearjar cooldown reply [seconds]

// Example
;swearjar cooldown reply 30

One reply per member per 30 seconds, whatever they say in between. This one only gags the jar — the counting underneath stays exact, so somebody swearing twenty times in a row is still twenty deeper in it. 0 answers every single swear.

// Syntax
[prefix]swearjar cooldown count [seconds]

// Example
;swearjar cooldown count 3

This is the one that protects the leaderboard. Without it a member can hold down enter and watch their total climb, however quiet the reply cooldown keeps the bot. Three seconds by default: below anything a person types by hand, far above what spam needs. 0 counts every message.

The count cooldown works on messages, not words. Repeating a word inside one message is still counted in full — "fuck fuck fuck" is three either way.

Alongside the Chat Filter

If you run the chat filter as well, a message can trip both: the filter deletes it, and the jar counts it. That is the default, on the grounds that the member did say it — the filter decides what stays in the channel, the jar records what was said.

;swearjar filtered off    // deleted messages are not counted
;swearjar filtered on

Switch it off if you would rather one message had one consequence.

The Numbers

;swearjar              // your own tally
;swearjar @member
;swearjar leaderboard  // who swears the most here
;swearjar ranking      // which words this server says the most

A member's page shows their total, their rank, their share of everything the server has said, how many different words they use, and a bar chart of their favourites. The leaderboard puts each member's total next to the one word they say most.

Emptying It

;swearjar reset member @member    // one member
;swearjar reset all               // everyone, with a confirmation
;swearjar settings                // every setting at a glance

reset all cannot be undone. The confirmation says how many counted swears are about to go.