]>
jfr.im git - erebus.git/blob - modules/module.py
1 # Erebus IRC bot - Author: John Runyon
2 # simple module example
3 # This file is released into the public domain; see http://unlicense.org/
7 'author': 'John Runyon (DimeCadmium)',
8 'license': 'public domain',
9 'compatible': [1], # compatible module API versions
10 'depends': [], # other modules required to work properly?
15 lib
= modlib
.modlib(__name__
)
16 modstart
= lib
.modstart
22 @lib.hook('modload', needchan
=False, glevel
=lib
.MANAGER
)
24 def cmd_modload(bot
, user
, chan
, realtarget
, *args
):
25 okay
= ctlmod
.load(bot
.parent
, args
[0])
27 bot
.msg(user
, "Loaded %s" % (args
[0]))
29 bot
.msg(user
, "Error loading %s: %r" % (args
[0], okay
))
31 @lib.hook('modunload', needchan
=False, glevel
=lib
.MANAGER
)
33 def cmd_modunload(bot
, user
, chan
, realtarget
, *args
):
34 okay
= ctlmod
.unload(bot
.parent
, args
[0])
36 bot
.msg(user
, "Unloaded %s" % (args
[0]))
38 bot
.msg(user
, "Error unloading %s: %r" % (args
[0], okay
))
40 @lib.hook('modreload', needchan
=False, glevel
=lib
.MANAGER
)
42 def cmd_modreload(bot
, user
, chan
, realtarget
, *args
):
43 okay
= ctlmod
.reloadmod(bot
.parent
, args
[0])
44 bot
.msg(user
, "Reloaded %s" % (args
[0]))
46 @lib.hook('modlist', needchan
=False, glevel
=lib
.STAFF
)
48 def cmd_modlist(bot
, user
, chan
, realtarget
, *args
):