NAME

Bot::Backbone::Service::ConsoleChat - Chat with an interactive command line

VERSION

version 0.161950

SYNOPSIS

service console => (
    service  => 'ConsoleChat',
);

DESCRIPTION

This is a handy service for interacting with a bot from the command line. This can be useful for interfering with the state of the bot or working with the bot without going through some other chat server.

ATTRIBUTES

term

This is the internal readline terminal object.

No user serviceable parts.

prompt

This is the prompt displayed to the user. It is "> " by default. You may set this during initialization or the bot may modify it as desired.

username

This is the name of the user at the console. This is set to $ENV{USER} by default.

nickname

This is the nickname to give the user at the console. As of now, this is also se to $ENV{USER} be default.

It may be set to gecos or something by default in the future.`

EVENT HANDLERS

_start

Starts the chat and shows the first prompt.

got_console_input

Whenever the user hits enter, this dispatches, notifies the chat consumers, and puts up the next prompt.

Anything not matching a built-in command will be passed to the bot as a direct message. The built-in commands include:

/quit

This causes the bot to shutdown and exit.

cli_message

Handles most messages typed on the command line.

METHODS

initialize

This sets up the POE::Session that is used to manage the terminal wheel.

send_message

Whenever the bot sends a message, it will be displayed if it is a direct message back to the console or if the group name matches the "current_group". All other messages will be muted.

shutdown

Says good-bye and destroys the terminal object, which will shutdown the session and allow the bot to exit.

AUTHOR

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 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.