NAME

Bot::Backbone::Service::Role::Chat - Chat services must implement this role

VERSION

version 0.112320

DESCRIPTION

A chat service is one that sends and receives messages to other entities.

See Bot::Backbone::Service::ConsoleChat and Bot::Backbone::Service::JabberChat.

ATTRIBUTES

chat_consumers

This is a list of Bot::Backbone::Service::Role::ChatConsumers that hvae registered to receive messages from this chat service. A chat consumer is registered using the register_chat_cnosumer method. A list_chat_consumers method is provided to list the registered consumers.

REQUIRED METHODS

send_reply

$chat->send_reply($message, $text);

Given a message generated by this chat service, this should send a reply to the origin of the message, whether that be a group or individual or other entity.

send_message

# Send a direct message
$chat->send_message(
    to   => $to_username,
    text => 'blah blah blah',
);

# Send a group message
$chat->send_message(
    group => $to_group,
    text  => 'blah blah blah',
);

Sends a message to a group or individual using this chat service. This is used when the message is not being made as a direct reply to a message received from the chat service.

METHODS

resend_message

$chat->resend_message($message);

This should be called whenever a message is received from the chat service. This message willb e forwarded to all of the registered "chat_consumers".

AUTHOR

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Qubling Software LLC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.