Annotation of botnow/Commands, Revision 1.1.1.1
1.1 bountyht 1: Output
2: ========
3:
4: putserv BOT TEXT
5:
6: Sends text to the IRC server. Returns nothing.
7:
8: Bind
9: ========
10:
11: bind TYPE FLAGS MASK PROC
12:
13: Binds perl procedures to events. Currently flags and mask are ignored. Returns the name of the command that was added.
14:
15: 1. MSG
16:
17: bind "MSG" FLAGS COMMAND PROC
18: procname BOT NICK USERHOST HANDLE TEXT
19:
20: Called on /msg commands. The first word of the msg is the command, and the rest
21: the text.
22:
23: bind("msg", "", "admin", $proc);
24: sub proc {
25: my ($bot, $nick, $userhost, $hand, $text) = @_;
26: ...
27: }
28:
29: 2. PUB
30:
31: bind "PUB" FLAGS COMMAND PROC
32: procname BOT NICK USERHOST HANDLE CHANNEL TEXT
33:
34: bind("pub", "", "help", $proc);
35: sub proc {
36: my ($bot, $nick, $userhost, $hand, $chan, $text) = @_;
37: ...
38: }
39:
40: Called on commands in a channel. The first word of the msg is the command, and the rest
41: the text.
42:
43: 3. MSGM (stackable)
44:
45: bind "MSGM" FLAGS MASK PROC
46: procname BOT NICK USERHOST HANDLE TEXT
47:
48: bind("msgm", "", "", $proc);
49: sub proc {
50: my ($bot, $nick, $userhost, $hand, $text) = @_;
51: ...
52: }
53:
54: Match all text from a /msg. MSGM binds are processed before MSG binds.
55:
56: 4. PUBM (stackable)
57:
58: bind "PUBM" FLAGS MASK PROC
59: procname BOT NICK USERHOST HANDLE CHAN TEXT
60:
61: bind("pubm", "", "", $proc);
62: sub proc {
63: my ($bot, $nick, $userhost, $hand, $chan, $text) = @_;
64: ...
65: }
66:
67: Match all text from a message on a channel. PUBM binds are processed before PUB binds.
68:
69: 5. NOTC (stackable)
70:
71: bind "NOTC" FLAGS MASK PROC
72: procname BOT NICK USERHOST HANDLE TEXT DEST
73:
74: bind("notc", "", "", $proc);
75: sub proc {
76: my ($bot, $nick, $userhost, $hand, $text, $dest) = @_;
77: ...
78: }
79:
80: Called when a notice is sent. $dest is either the bot's nickname or channel.
81: You should not respond to a /notice, so this is useful for logging and analytics.
82:
83: 6. JOIN (stackable)
84:
85: bind "JOIN" FLAGS MASK PROC
86: procname BOT NICK USERHOST HANDLE CHANNEL
87:
88: bind("join", "", "", $proc);
89: sub proc {
90: my ($bot, $nick, $userhost, $hand, $chan) = @_;
91: ...
92: }
93:
94: Called when someone joins a channel.
95:
96: 7. PART (stackable)
97:
98: bind "PART" FLAGS MASK PROC
99: procname BOT NICK USERHOST HANDLE CHANNEL TEXT
100:
101: bind("part", "", "", $proc);
102: sub proc {
103: my ($bot, $nick, $userhost, $hand, $chan, $text) = @_;
104: ...
105: }
106:
107: Called when someone parts a channel.
CVSweb