User Tools

Site Tools


melanobot:modules:core

Core Module

The core module provides essential functionality and should never be disabled. (Enabled by default)

Log Type

  • sys – System information log

Groups

AbstractGroup

Inherits SimpleAction.

Abstract handler used as base for handlers providing group-like functionality.

Doesn't add any special configuration properties.

Group

Inherits AbstractGroup.

Groups handlers with shared settings.

  • trigger (default empty)
  • channels – A list of channels masks separated by commas or spaces, the wildcard * matches any sequence of characters and the string ! matches private messages. If empty it matches any channel.
  • name – (Optional) name to show in help.
  • help_group – Help identifier, only needded by the top level group you want to show help about. (See Help)
  • source – Name of a connection, if present it will only accept messages from that connection.
  • auth – The user creating the message needs to be in this group to trigger the handler.
  • pass_through false – Whether it should keep processing the message after a matching handler
  • prefix – Prefix prepended to all reply messages of handlers contained in the group.
  • help – Help message for the group

Any setting provided for the group (Except: trigger, auth, type, name and prefix) will be presented to the children. (Note: auth isn't copied because it's already filtered by the group)

PresetGroup

Inherits AbstractGroup.

Abstract handler, presents a very basic group with some kind of preset handlers.

The config can override the preset values, used for convenience when several handlers are often used together.

Note: Despite of indirectly inheriting SimpleAction, it ignores all of its properties.

Multi

Inherits AbstractGroup.

Allows to forward messages to multiple children.

Messages which don't match the trigger will be forwarded to all of the children with no modification, behaving like a Group with empty trigger and pass_through 1.

Messages matching the trigger will be forwarded to all of the children ensuring it matches their triggers. That is the children will see a message starting with their own trigger instead of the one used for the Multi.

To determine which triggers, Multi will examine all of its children depth-first and gather for each the first non-empty trigger.

AbstractList

Inherits SimpleAction.

Base class for list actions. Triggering a child of AbstractList without arguments will show the list of items, triggering with + or add will inserts items to the list, - or rm removes items and clear removes all items.

  • edit – Authorization level required to edit the list

Basic Handlers

License

Inherits SimpleAction.

Shows licensing information and a link to get the sources. To comply to the AGPL this must be present in some form. Also if you modify the bot sources you must update url to point to the sources of your instance.

Help

Inherits SimpleAction.

Shows the available handlers and how to use them to the users.

It is strongly recommended to add this handler to allow the users to know how to use the bot.

  • help_group Shows help only for handlers in groups with a matching help_group.

Echo

Inherits SimpleAction.

Repeats a string given by the user.

ServerHost

Inherits SimpleAction.

Shows the connection server host and port.

  • trigger server

Cointoss

Inherits SimpleAction.

Shows one of the given items, at random.

  • items Heads, Tails – List of items, separated by commas
  • customizable 1 – Whether the user can provide their own list of items

Reply

Inherits Handler.

Fixed reply to a given message. Note that unlike SimpleAction this allows regular expressions as trigger.

  • trigger (REQUIRED) – Message that will trigger the reply
  • reply (REQUIRED) – Reply to give
  • regex 0 – Whether trigger shall be treated as a regular expression. When this is enabled, %n (where n is a number) will be result in a sub-expression match from trigger and %sender is the name of the sender.
  • case_sensitive 1 – If false, matching isn't case sensitive.
  • direct 1 – Whether the message should be explicitly sent to the bot.
  • help – Help message for the handler

Command

Inherits Reply.

Like Reply, but it sends a fixed command instead of a chat message.

Action

Inherits SimpleAction.

Performs a roleplay action

  • trigger please
  • empty Please what? – Reply to give on an empty action
  • auth – The user creating the message needs to be in this group to trigger the action.
  • unauthorized Won't do! – Reply to give to unauthorized users

Time

Inherits SimpleAction.

Shows the time

Admin Handlers

AdminGroup

Inherits AbstractList.

Manages a user group.

  • trigger/group – Group to be managed
  • ignore – Permission level at which addition/removal of that user is not performed
  • connection – Name of the connection to which the changes are applied.

FilterGroup

Inherits Handler.

Discards all messages coming from a certain group.

  • ignore – (REQUIRED) Users with this authorization level will be ignored.

Quit

Inherits SimpleAction.

Instructs the bot to shut down.

  • message Bye! – Default quit message

Reconnect

Inherits SimpleAction.

Instructs the bot to reconnect to the connection associated with the message triggering this handler.

  • message Bye! – Default quit message

Disconnect

Inherits SimpleAction.

Instructs the bot to disconnect from the connection associated with the message triggering this handler.

  • message Bye! – Default quit message

Connect

Inherits SimpleAction.

Instructs the bot to connect to the connection associated with the message triggering this handler.

Chanhax

Inherits Handler.

Changes the channel of a message.

Bridge Handlers

These handlers are used to change the flow of the messages in order to make messages from a connection have effects on a different connection.

Bridge

Inherits SimpleGroup.

Acts as bridge across connections.

  • destination (REQUIRED) – Name of the destination connection. All child handlers will send replies to this connection.
  • dst_channel – Name of the destination channel. (Whether this is needed or not depends on the destination protocol)

BridgeChat

Inherits Handler.

Sends all chat messages over the destination, making sure that the user generating the message is reported.

  • timeout 0 – Message timeout in seconds, when a chat message is older than this it will be discarded. (0 means no timeout).
  • ignore_self true – Whether messages from an user with the same name as the connection should be discarded.
  • from – (Optional) Fixed string which overrides the message sender name.

BridgeAttach

Inherits SimpleAction. Can only be created as a child of Bridge.

Attach the parent to a different connection at run time.

  • trigger attach
  • protocol – Unused (?)
  • detach true – Whether it's allowed to detach from the current connection without providing a replacement.

BridgeAttachChannel

Inherits SimpleAction. Can only be created as a child of Bridge.

Attach the parent to a different channel at run time.

  • trigger channel

EventMessageBase

Inherits Handler. Abstract handler used to report common events across connections.

  • messageFormatted string to be sent. It allows the following expansions:
    • %channel – channel name
    • %message – event message
    • %name – name of the user triggering the event
    • %host – host name of the user triggering the event
    • %global_id – logged-in name of the user triggering the event
  • discard_self false – If true, the handler discards actions triggered by the bot (ie: a user with the same id as the bot)
  • discard_others false – If true, the handler discards actions triggered by other users (ie: not the bot)
  • prefix – message prefix

Note at least one of discard_self and discard_others must be false and message cannot be empty.

JoinMessage

Inherits EventMessageBase.

Triggered when a user joins the connection or a channel.

PartMessage

Inherits EventMessageBase.

Triggered when a user leaves a channels or quits from the connection.

RenameMessage

Inherits EventMessageBase.

Triggered when a user changes its name.

Note: %name is the old name and %message the new one

KickMessage

Inherits EventMessageBase.

Triggered when a user is kicked.

message has different expansions:

  • %channel – channel name
  • %message – event message
  • %kicker – name of the user triggering the event
  • %kicker.host – host name of the user triggering the event
  • %kicker.global_id – logged-in name of the user triggering the event
  • %kicked – name of the victim
  • %kicked.host – host name of the victim
  • %kicked.global_id – logged-in name of the victim

ConnectionMonitor

Inherits SimpleAction.

Base for handlers which send replies to the same connections as the message came from but need to query a different connection to get the information to send in the reply.

  • monitored – Name of the monitored connection

MonitorServerStatus

Inherits ConnectionMonitor.

Shows whether the connection is active.

  • connected #dark_green#Server is connected Formatted String shown when the monitored connection is active
  • disconnected #red#Server is not connected Formatted String shown when the monitored connection is not active

MonitorReply

Inherits ConnectionMonitor.

Shows a fixed reply.

melanobot/modules/core.txt · Last modified: 2015/06/07 10:40 by melanosuchus