2011-09-15 02:30:22 -04:00
|
|
|
# NickServ basic functions
|
|
|
|
_nickservfuncs = (
|
2022-10-07 16:51:40 -04:00
|
|
|
"register",
|
|
|
|
"group",
|
|
|
|
"glist",
|
|
|
|
"identify",
|
|
|
|
"access",
|
|
|
|
"drop",
|
|
|
|
"recover",
|
|
|
|
"release",
|
|
|
|
"sendpass",
|
|
|
|
"ghost",
|
|
|
|
"alist",
|
|
|
|
"info",
|
|
|
|
"list",
|
|
|
|
"logout",
|
|
|
|
"status",
|
|
|
|
"update",
|
2011-09-15 02:30:22 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
# NickServ SET functions
|
|
|
|
_nickservsetfuncs = (
|
2022-10-07 16:51:40 -04:00
|
|
|
"display",
|
|
|
|
"password",
|
|
|
|
"language",
|
|
|
|
"url",
|
|
|
|
"email",
|
|
|
|
"icq",
|
|
|
|
"greet",
|
|
|
|
"kill",
|
|
|
|
"secure",
|
|
|
|
"private",
|
|
|
|
"hide",
|
|
|
|
"msg",
|
|
|
|
"autoop",
|
2011-09-15 02:30:22 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
# ChanServ basic functions
|
|
|
|
_chanservfuncs = (
|
2022-10-07 16:51:40 -04:00
|
|
|
"register",
|
|
|
|
"identify",
|
|
|
|
"sop",
|
|
|
|
"aop",
|
|
|
|
"hop",
|
|
|
|
"vop",
|
|
|
|
"access",
|
|
|
|
"levels",
|
|
|
|
"akick",
|
|
|
|
"drop",
|
|
|
|
"sendpass",
|
|
|
|
"ban",
|
|
|
|
"unban",
|
|
|
|
"clear",
|
|
|
|
"owner",
|
|
|
|
"deowner",
|
|
|
|
"protect",
|
|
|
|
"deprotect",
|
|
|
|
"op",
|
|
|
|
"deop",
|
|
|
|
"halfop",
|
|
|
|
"dehalfop",
|
|
|
|
"voice",
|
|
|
|
"devoice",
|
|
|
|
"getkey",
|
|
|
|
"invite",
|
|
|
|
"kick",
|
|
|
|
"list",
|
|
|
|
"logout",
|
|
|
|
"topic",
|
|
|
|
"info",
|
|
|
|
"appendtopic",
|
|
|
|
"enforce",
|
2011-09-15 02:30:22 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
_chanservsetfuncs = (
|
2022-10-07 16:51:40 -04:00
|
|
|
"founder",
|
|
|
|
"successor",
|
|
|
|
"password",
|
|
|
|
"desc",
|
|
|
|
"url",
|
|
|
|
"email",
|
|
|
|
"entrymsg",
|
|
|
|
"bantype",
|
|
|
|
"mlock",
|
|
|
|
"keeptopic",
|
|
|
|
"opnotice",
|
|
|
|
"peace",
|
|
|
|
"private",
|
|
|
|
"restricted",
|
|
|
|
"secure",
|
|
|
|
"secureops",
|
|
|
|
"securefounder",
|
|
|
|
"signkick",
|
|
|
|
"topiclock",
|
|
|
|
"xop",
|
2011-09-15 02:30:22 -04:00
|
|
|
)
|
|
|
|
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2011-09-15 02:30:22 -04:00
|
|
|
def _addServ(serv, funcs, prefix=""):
|
|
|
|
def simplecmd(cmd_name):
|
|
|
|
if prefix:
|
|
|
|
cmd_name = prefix.upper() + " " + cmd_name
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2011-09-15 02:30:22 -04:00
|
|
|
def f(cli, *args):
|
2021-03-23 17:36:43 -04:00
|
|
|
print(cmd_name, " ".join(args))
|
2022-10-07 16:51:40 -04:00
|
|
|
# cli.send(cmd_name, serv.name, *args)
|
|
|
|
|
2011-09-15 02:30:22 -04:00
|
|
|
return f
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2011-09-15 02:30:22 -04:00
|
|
|
for t in funcs:
|
|
|
|
setattr(serv, t, simplecmd(t.upper()))
|
|
|
|
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2023-01-14 16:59:59 -05:00
|
|
|
class NickServ:
|
2011-09-28 19:16:01 -04:00
|
|
|
def __init__(self, nick="NickServ"):
|
2011-09-15 02:30:22 -04:00
|
|
|
self.name = nick
|
|
|
|
_addServ(self, _nickservfuncs)
|
|
|
|
_addServ(self, _nickservsetfuncs, "set")
|
|
|
|
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2023-01-14 16:59:59 -05:00
|
|
|
class ChanServ:
|
2011-09-28 19:16:01 -04:00
|
|
|
def __init__(self, nick="ChanServ"):
|
2011-09-15 02:30:22 -04:00
|
|
|
self.name = nick
|
|
|
|
_addServ(self, _chanservfuncs)
|
|
|
|
_addServ(self, _chanservsetfuncs, "set")
|