Bot

Bot operations require a provisioned MCP available with sufficient current entitlement.

The D7 bot project was a full irc client implementing the druplicon bot at freenode. It ran php NetSmart_IRC via drush and drupal crontab as a single system process. NetSmart 1.1.14 has been modified to run in the context of the bot_mcs module. Ordinary devops class operators can run up to three bots.

Specific modules in this project converted and enabled:

  • Aggregator: Enables the reporting of aggregated feed items to configured channels.
  • Bot MCS: Replaces the drush/crontab functionality. Each bot is a distinct drupal user, as whom the bot operator can masquerade. Each operator runs a single instance of an adapted NetSmartIRC for MCP/DCP providing a php endpoint for the Maiden cores. Where a Maiden agent and a php feature conflict (e.g. remind/notify) controls are provided to deselect the function, via admin/config/bot here or in lisp. By default, the core agent will be enabled and the core owns the stream/connection which it makes for the php endpoint.
  • Botrules: module interface to d7 rules and actions, the main reason for recovering the project.
  • Karma: Keeps track of "karma" altered by "foo++" or "bar--". Terms must be 3 to 15 characters in length. "BOTNAME: karma foo?" gives the current karma score. Highest and lowest karma scores can be seen at <https://devops1.sameboat.network/AKPERSON/BOTNAME/karma>.
  • Project URLS: Displays the title of project URLs (via bot_mcs project integration); multiple URLs in a single message are acceptable. Also supports numerical IDs such as "#12345" or "4321", but only if that is the entirety of the message and the number is within a configured range. Popular and recent URLs in the past two weeks are tracked at <https://devops1.sameboat.network/AKPERSON/BOTNAME/project_urls>.
  • Reminders: Reminders can be set with "BOTNAME: remind NICK (at|by|in|on) DURATION (about|how|that|to) MESSAGE". For example: "BOTNAME: remind Lycurgus in 1 hour and 6 minutes that his bot is awesome", "BOTNAME: remind me in 23 minutes to check my pot roast.", or even "BOTNAME: remind Monty on Wed, 12 May 2010 13:10:21 -0400 that this was when this code debuted."
  • Seen: If someone asks "seen Lycurgus", the bot will report the last time they've been seen, where, and what their last known message was. Directly addressing the bot will also allow the more complex syntax of "seen Lycurgus? seen d8uv?", "have you seen sbp?" and similar forms. * can be used as a wildcard, but only with a minimum of three other characters. A maximum of three results are displayed for any one request.
  • Tell: Queue messages with "BOTNAME: tell Lycurgus that his bot_module help messages are awesome." Queued messages will be delivered publicly when the recipient sends a message to the channel.
  • Timezones: Display timezones with "BOTNAME: timezone BST". Convert timezones with "tz 10AM MST to EST" or "tz 14:27 UTC in Europe/London". Timestamps are allowed if combined and with no spaces: "tz 2010-10-23T10:00 EST to UTC". All returned dates are DST-aware.