-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
51 lines (38 loc) · 2.22 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
jarvis:
uses POE::Builder to create 3 sessions:
Jarvis::Persona::System (alias: system)
Jarvis::IRC (alias: ${hostname}_irc) & passed 'system alias'
Jarvis::Jabber (alias: ${hostname}_xmpp) & passed 'system alias'
POE::Builder:
new => checks must, may for POE::Builder
must => [ loads list of mandatory args to module ]
may => { hash of optional_args => defaults }
indented_yaml => un-indents yaml
yaml_sess => takes (indented) yaml, passes it to indented_yaml,
instantiates the class, passes to object_session
object_session => creates a POE::Session around the object
adding the object_states from the method of the
same name from the object, sets aliases
Jarvis::Persona::System:
connects to [email protected] as $(hosntame -s) joins #asgard
connects to xmpp:$(hostname -f):5222 joins asgard\@conference.$(domainname)
has 3 "known_personas" [ "crunchy", "berry", "jarvis" ] it can spawn
when "spawn crunchy" is typed (in either irc:#asgard or xmpp:asgard)
crunchy: Jarvis::Persona::Crunchy (our general purpose bot)
connects to irc @127.0.0.1 joins #soggies
berry: Jarvis::Persona::Crunchy (we use berry to test crunchy)
connects to irc @127.0.0.1 joins #soggies
jarvis: Jarvis::Persona::Jarvis (our Systems Administrator)
connects to irc @127.0.0.1 joins #heathsmom
From that point on, events recieved by the personality's irc/xmmpp modules are
sent to the personality module, and responses are routed back to the requesting
module.
The interfaces between the protocol sessions and the personality sessions are
far from normalized, as there are some things that irc can do that xmpp doesn't
and vice-versa. I'm still working on a permanent API for connector-persona
communication.
Most of the communication is done in Jarvis::Persona::Base which is the parent
class for the bots themselves. The bots need only have a POE method named
"input" as that is what the connectors send input to, and resulting output
should be sent back to the @_[SENDER]'s alias.
See: lib/Jarvis/Persona/Minimal.pm for a skeleton.