Free, open source project using smack to moderate group chat

This program needs Java. Go to http://www.java.com/en/download/index.jsp if you don’t have Java.

Marshall is a bot that joins your room as a mod and takes care of lots of dirty work. (See the features list.) It tracks all room events per user, and the room as a whole. Certain events are flagged as violations. For example, a user may send a very long message composed of many line breaks, something that users do in an attempt to blank out the message window. The bot recognizes a configurable number of line breaks and marks the activity as a violation for that user. The severity of this depends on the number of line breaks exceeding the limit in the configuration. The user will be warned privately by the bot, and repeat offenses will add to that user’s severity ranking. When the user has violated the terms enough times, they are kicked (with an explanation as to why, and that further violations may result in banning,) and are allowed to return to the room.The bot’s responses vary based on the severity.

If many users are violating the terms, the room severity as a whole can reach a critical level, at which point the bot may password protect the entire room so that users already in the room can continue talking without interruption. This is temporary and the bot un-protects the room after a time. I’m still working on the time limits being configurable. It’s only a few minutes at the moment.

The bot accepts commands in the room from moderators.

  • b^nickname - bans a user. (Meebo’s in room ban option only kicks,)
  • k^nickname - kicks a user
  • m^nickname - mutes a user
  • um^nickname - unmutes a user
  • k^guests - kicks all guest accounts (non-signed in users)
  • b^guests - bans guests… good for some emergencies.
  • m^guests - mutes all guests
  • pause^ - prevents the bot from taking any action
  • unpause^ - resumes bot activity
  • set^propertyName - sets a property to a new value while the bot is running
    This bot needs to be set up as an admin in the room. I recommend creating an account specifically for the bot. This helps keep things organized, avoid sign on collisions, and avoids any fear that somewhere the code is sending out your password. See the source, yourself… that’s another recommendation.

It will be super fast or super… “slow,” depending on your internet connection.

Running the bot and configuring the bot. http://code.google.com/p/mrbrooksmarshall/wiki/Example

Get the bot! http://code.google.com/p/mrbrooksmarshall/downloads/list

Features (configurable) via properties file.

  • Private messages users of its activity on their accounts
  • Auto-muting guest accounts or account with very long names
  • Allows moderator control of the bot via simple chat room messages
  • Prevents guest flooding
  • Prevents people repeating themselves, fast or slow, to spam or advertise in a room
  • Prevents people from sending messages very fast, to flood the room without repeats
  • Automatically detects and fixes backwards room hacks.
  • Detects too many line breaks in a message, usually meant to flood the room with white space.
  • Some of the room commands are very useful - muting all guests at once, kicking all guests, banning via nickname, etc.
  • More features will be added over time.

Running the bot

java -jar “Marshall.jar” /pathto/ai.properties

Sample ai.properties

# --- CONNECTION SETTINGS ---
hostName = meebo.org
serviceName = meebo.org
portNumber = 5222
#roomUrl=adultchatter@conference.gc7.meebo.org
#roomUrl = intelligentadults@conference.gc11.meebo.org
#roomUrl=test@conference.informat-723e16
#roomUrl = chikanjikan@conference.gc17.meebo.org
roomUrl = brookstest@conference.gc11.meebo.org
#roomUrl = 25andup@conference.gc2.meebo.org
userName = mr_br00ks
password = #####
botName = Mr.Brooks' Marshall

# -- DETECTIONS, TRUE OR FALSE TO RUN THESE SCANNERS
speedSpam = true
repeatSpam = true
guestJoin = true
lineBreak = true

# guestJoin: settings (action can be MUTE, KICK or NONE)
guestJoinAction = KICK

# not ready yet
# linkSpam=false
# guestFlood=false
# nameLength=false
illegalChar = true

# -- USE THE WARNINGS BELOW TO NOTIFY USERS WHAT THEY'RE VIOLATING?
speedSpamNotify = true
repeatSpamNotify = true
guestJoinNotify = true
lineBreakNotify = true
# linkSpamNotify=false
# guestFloodNotify=false
# nameLengthNotify=true
illegalCharNotify = true

speedSpamWarning = You sent too many messages too quickly.
repeatSpamWarning = You repeated yourself too many times.
guestJoinWarning = You are using a guest/temporary account. Please use a registered account.
lineBreakWarning = Too many line breaks! Your mother is a goat.
# linkSpamWarning=You spammed links.
# guestFloodWarning=Guests are flooding the room, guests blocked automatically for @blockMinutes@ minutes
# nameLengthWarning=Your nick name is too long. Please shorten it next time you join.
illegalCharWarning = You sent special characters regarded as illegal here.

# speedSpam: settings (3 messages delivered with an average of this millisecond time or less will be treated as speed spam)
speedSpamWindow = 210

# repeatSpam: settings (for every [totalMessagesToScanPerUser] messages, only [maxCopiesAllowed] are allowed.)
totalMessagesToScanPerUser = 5
maxCopiesAllowed = 3

# lineBreak: settings
lineBreaksToAllow = 4
lineBreakAllowed = 6
speedSpamLimit = 0