!editserver only need an alias to exist, not to be currently connected

This commit is contained in:
jesopo 2019-10-09 20:56:38 +01:00
parent 87a7d74fc3
commit 97c439a9d7

View file

@ -168,8 +168,8 @@ class Module(ModuleManager.BaseModule):
@utils.kwarg("permission", "editserver") @utils.kwarg("permission", "editserver")
def edit_server(self, event): def edit_server(self, event):
alias = event["args_split"][0] alias = event["args_split"][0]
server = self.bot.get_server_by_alias(alias) server_id = self._id_from_alias(alias)
if server == None: if server_id == None:
raise utils.EventError("Unknown server '%s'" % alias) raise utils.EventError("Unknown server '%s'" % alias)
option = event["args_split"][1].lower() option = event["args_split"][1].lower()
@ -196,5 +196,5 @@ class Module(ModuleManager.BaseModule):
else: else:
raise utils.EventError("Unknown option '%s'" % option) raise utils.EventError("Unknown option '%s'" % option)
self.bot.database.servers.edit(server.id, option, value_parsed) self.bot.database.servers.edit(server_id, option, value_parsed)
event["stdout"].write("Set %s for %s" % (option, alias)) event["stdout"].write("Set %s for %s" % (option, alias))