-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
68 lines (51 loc) · 2.04 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
This bot is originally created to run Mafia games on freenode. I seperated each
section into modules because some other people wanted a lightweight bot they
could do whatever they wanted to do with. I've spent more time on the framework
building it up for these people instead of the mafia part of the bot itself.
---
Run genconfig.py to set your configuration options.
Run BugBot.py to load up your bot.
---
Use genplugin.py to get a blank plugin file. I don't have command name
conflict resolving yet, so try not to use a command already in use.
The cmds class should contain all your commands as defines
There is regular expression support for snarfing strings directly out of the
chat, these are contained in the regexp class. The format of this is simple:
def commandName(self,match):
r'Regular Expression'
doStuff()
match will contain the result from an re.group(0) function. Usually the matching
string.
The only infrastructure I provide for you to use is outlined below. You will
need to import any modules for anything else you need.
self._parent.
term -> Prints to the console
-> term(LEVEL,'TEXT')
-> Use FUNC, SUB, DBG and ERROR for the LEVEL, 'TEXT' should be obvious.
send - Sends a message to IRC
-> send('TEXT',nick=False,channel=False)
-> 'TEXT' is what you want to send
-> nick will be prepended to TEXT if given. You can use True to provide the
callers nick
-> Channel will default to the current channel unless you specify otherwise
quote - Sends a raw irc command
-> quote('TEXT')
-> 'TEXT' is your command
notice - sends an irc notice
-> notice('TEXT','TARGET')
-> 'TEXT' is the notice content
-> 'TARGET' can be a person or a channel
getNick
getHost
getUser
getFullHost
getChannel
-> All return what you'd expect
getMessage
-> Returns everything after the command
getArg(argNum)
->getArg(num)
-> num is any integer, it'll return the word at the position after the
message, starting at one
command arg1 arg2 arg3
0 1 2 3