• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bin/H14-Dec-2012-12757

lib/POE/Component/IRC/Plugin/H03-May-2022-383210

t/H14-Dec-2012-6652

ChangesH A D14-Dec-20122.1 KiB6748

LICENSEH A D14-Dec-201217.9 KiB380292

MANIFESTH A D14-Dec-2012169 1413

MANIFEST.SKIPH A D14-Dec-201280 65

META.jsonH A D14-Dec-20121.8 KiB6866

META.ymlH A D14-Dec-2012971 3332

Makefile.PLH A D14-Dec-20121.2 KiB5944

READMEH A D14-Dec-20123.9 KiB10879

dist.iniH A D14-Dec-2012668 2420

README

1NAME
2    POE::Component::IRC::Plugin::Hailo - A PoCo-IRC plugin which provides
3    access to a Hailo conversation simulator.
4
5SYNOPSIS
6    To quickly get an IRC bot with this plugin up and running, you can use
7    App::Pocoirc:
8
9     $ pocoirc -s irc.perl.org -j '#bots' -a 'Hailo{ "brain_resource": "brain.sqlite" }'
10
11    Or use it in your code:
12
13     use POE::Component::IRC::Plugin::Hailo;
14
15     $irc->plugin_add('Hailo', POE::Component::IRC::Plugin::Hailo->new(
16         Own_channel    => '#bot_chan',
17         Ignore_regexes => [ qr{\w+://\w} ], # ignore lines containing URLs
18         Hailo_args     => {
19             brain_resource => 'brain.sqlite',
20         },
21     ));
22
23DESCRIPTION
24    POE::Component::IRC::Plugin::Hailo is a POE::Component::IRC plugin. It
25    provides "intelligence" through the use of POE::Component::Hailo. It
26    will talk back when addressed by channel members (and possibly in other
27    situations, see "new"). An example:
28
29     --> hailo_bot joins #channel
30     <Someone> oh hi there
31     <Other> hello there
32     <Someone> hailo_bot: hi
33     <hailo_bot> oh hi there
34
35    It will occasionally send CTCP ACTIONS (/me) too, if the reply in
36    question happens to be based on an earlier CTCP ACTION from someone.
37
38    All NOTICEs are ignored, so if your other bots only issue NOTICEs like
39    they should, they will be ignored automatically.
40
41    Before using, you should read the documentation for Hailo, so you have
42    an idea of what to pass as the 'Hailo_args' parameter to "new".
43
44    This plugin requires the IRC component to be POE::Component::IRC::State
45    or a subclass thereof.
46
47METHODS
48  "new"
49    Takes the following optional arguments:
50
51    'Hailo', a reference to an existing POE::Component::Hailo object you
52    have lying around. Useful if you want to use it with multiple IRC
53    components. If this argument is not provided, the plugin will construct
54    its own object.
55
56    'Hailo_args', a hash reference containing arguments to pass to the
57    constructor of a new Hailo object.
58
59    'Channels', an array reference of channel names. If this is provided,
60    the bot will only listen/respond in the specified channels, rather than
61    all channels.
62
63    'Own_channel', a channel where it will reply to all messages. The plugin
64    will take care of joining the channel. It will part from it when the
65    plugin is removed from the pipeline. Defaults to none.
66
67    'Abuse_interval', default is 60 (seconds), which means that user X in
68    channel Y has to wait that long before addressing the bot in the same
69    channel if he wants to get a reply. Setting this to 0 effectively turns
70    off abuse protection.
71
72    'Talkative', when set to a true value, the bot will respond whenever
73    someone mentions its name (in a PRIVMSG or CTCP ACTION (/me)). If false,
74    it will only respond when addressed directly with a PRIVMSG. Default is
75    false.
76
77    'Ignore_masks', an array reference of IRC masks (e.g. "purl!*@*") to
78    ignore.
79
80    'Ignore_regexes', an array reference of regex objects. If a message
81    matches any of them, it will be ignored. Handy for ignoring messages
82    with URLs in them.
83
84    'Method', how you want messages to be delivered. Valid options are
85    'notice' (the default) and 'privmsg'.
86
87    'Replyrate', when set to a number (a percentage, 0 to 100) controls how
88    often the bot will respond to any message. Uses a uniform RNG and fires
89    whenever the random roll is less than this number.
90
91    Returns a plugin object suitable for feeding to POE::Component::IRC's
92    "plugin_add" method.
93
94  "brain"
95    Takes no arguments. Returns the underlying POE::Component::Hailo object
96    being used by the plugin.
97
98  "transplant"
99    Replaces the brain with the supplied POE::Component::Hailo instance.
100    Shuts down the old brain if it was instantiated by the plugin itself.
101
102AUTHOR
103    Hinrik Örn Sigurðsson, hinrik.sig@gmail.com
104
105    This distribution is based on POE::Component::IRC::Plugin::MegaHAL by
106    the same author.
107
108