make some logic changes to the default plugin

This commit is contained in:
randomuser 2021-08-11 21:06:40 -05:00
parent b2a8379c9b
commit 490301c76e
1 changed files with 14 additions and 8 deletions

View File

@ -23,12 +23,11 @@ def cmd(line, srv):
if utils.is_admin(params[0]): if utils.is_admin(params[0]):
try: try:
srv.load_mod(params[0]) srv.load_mod(params[0])
utils.message(srv, line.params[0],
"loaded: `" + params[0] + "'")
except ModuleNotFoundError: except ModuleNotFoundError:
utils.message(srv, line.params[0], utils.message(srv, line.params[0],
"failed to load `" + params[0] + "'") "failed to load `" + params[0] + "'")
else:
utils.message(srv, line.params[0],
"loaded: `" + params[0] + "'")
else: else:
utils.message(srv, line.params[0], utils.message(srv, line.params[0],
"invalid permissions!") "invalid permissions!")
@ -36,12 +35,19 @@ def cmd(line, srv):
if utils.is_admin(params[0]): if utils.is_admin(params[0]):
try: try:
srv.unload_mod(params[0]) srv.unload_mod(params[0])
utils.message(srv, line.params[0],
"unloaded: `" + params[0] + "'")
except: except:
utils.message(srv, line.params[0], utils.message(srv, line.params[0],
"failed to unload `" + params[0] + "'") "failed to unload `" + params[0] + "'")
else: else:
utils.message(srv, line.params[0], utils.message(srv, line.params[0],
"unloaded: `" + params[0] + "'" "invalid permissions!")
elif command == "op":
if utils.is_admin(params[0]):
srv.admins.append(Admin(params[0]))
utils.message(srv, line.params[0],
"operator added")
else: else:
utils.message(srv, line.params[0], utils.message(srv, line.params[0],
"invalid permissions!") "invalid permissions!")