errbot.core module

class errbot.core.ErrBot(bot_config)[source]

Bases: errbot.backends.base.Backend, errbot.storage.StoreMixin

ErrBot is the layer taking care of commands management and dispatching.

MSG_ERROR_OCCURRED = 'Computer says nooo. See logs for details'
MSG_UNKNOWN_COMMAND = 'Unknown command: "%(command)s". '
__init__(bot_config)[source]
all_commands

Return both commands and re_commands together.

attach_plugin_manager(plugin_manager)[source]
attach_repo_manager(repo_manager)[source]
attach_storage_plugin(storage_plugin)[source]
callback_mention(msg, people)[source]
callback_message(msg)[source]

Processes for commands and dispatches the message to all the plugins.

callback_presence(pres)[source]
callback_room_joined(room)[source]

Triggered when the bot has joined a MUC.

Parameters:room -- An instance of MUCRoom representing the room that was joined.
callback_room_left(room)[source]

Triggered when the bot has left a MUC.

Parameters:room -- An instance of MUCRoom representing the room that was left.
callback_room_topic(room)[source]

Triggered when the topic in a MUC changes.

Parameters:room -- An instance of MUCRoom representing the room for which the topic changed.
callback_stream(stream)[source]
connect_callback()[source]
disconnect_callback()[source]
get_command_classes()[source]
get_doc(command)[source]

Get command documentation

static get_plugin_class_from_method(meth)[source]
initialize_backend_storage()[source]

Initialize storage for the backend to use.

inject_command_filters_from(instance_to_inject)[source]
inject_commands_from(instance_to_inject)[source]
inject_flows_from(instance_to_inject)[source]
prefix_groupchat_reply(message: errbot.backends.base.Message, identifier: errbot.backends.base.Identifier)[source]
process_message(msg)[source]

Check if the given message is a command for the bot and act on it. It return True for triggering the callback_messages on the .callback_messages on the plugins.

Parameters:msg -- the incoming message.
static process_template(template_name, template_parameters)[source]
remove_command_filters_from(instance_to_inject)[source]
remove_commands_from(instance_to_inject)[source]
remove_flows_from(instance_to_inject)[source]
send(identifier, text, in_reply_to=None, groupchat_nick_reply=False)[source]

Sends a simple message to the specified user.

Parameters:
  • identifier -- an identifier from build_identifier or from an incoming message
  • in_reply_to -- the original message the bot is answering from
  • text -- the markdown text you want to send
  • groupchat_nick_reply (bool) -- authorized the prefixing with the nick form the user
send_card(card)[source]

Sends a card, this can be overriden by the backends without a super() call.

Parameters:card -- the card to send.
Returns:None
send_message(msg)[source]

This needs to be overridden by the backends with a super() call.

Parameters:msg -- the message to send.
Returns:None
send_simple_reply(msg, text, private=False, threaded=False)[source]

Send a simple response to a given incoming message

Parameters:
  • private (bool) -- if True will force a response in private.
  • threaded (bool) -- if True and if the backend supports it, sends the response in a threaded message.
  • text -- the markdown text of the message.
  • msg -- the message you are replying to.
send_templated(identifier, template_name, template_parameters, in_reply_to=None, groupchat_nick_reply=False)[source]

Sends a simple message to the specified user using a template.

Parameters:
  • template_parameters -- the parameters for the template.
  • template_name -- the template name you want to use.
  • identifier -- an identifier from build_identifier or from an incoming message, a room etc.
  • in_reply_to -- the original message the bot is answering from
  • groupchat_nick_reply (bool) -- authorized the prefixing with the nick form the user
shutdown()[source]
signal_connect_to_all_plugins()[source]
split_and_send_message(msg)[source]
startup_time = datetime.datetime(2017, 10, 26, 17, 47, 33, 884526)
unknown_command(_, cmd, args)[source]

Override the default unknown command behavior

warn_admins(warning: str) → None[source]

Send a warning to the administrators of the bot.

Parameters:warning (str) -- The markdown-formatted text of the message to send.