Fix for !alts add with non-existing character
This commit is contained in:
@@ -69,7 +69,7 @@ class AltsController:
|
||||
main = self.account_service.get_main(request.sender.char_id)
|
||||
for alt in alt_chars:
|
||||
if not alt.char_id:
|
||||
notfound.append(alt)
|
||||
notfound.append(alt.name if type(alt) == SenderObj else alt)
|
||||
continue
|
||||
if main.char_id == alt.char_id:
|
||||
failed.append(self.getresp("module/alts", "add_fail_self"))
|
||||
@@ -86,9 +86,9 @@ class AltsController:
|
||||
reply += self.getresp("module/alts", "add_success_self",
|
||||
{"char": ", ".join(done)})
|
||||
if len(notfound) > 0:
|
||||
reply += "\n" + self.getresp("global", "char_not_found", {"char": ", ".join(notfound)})
|
||||
reply += "\n" if reply != "" else '' + self.getresp("global", "char_not_found", {"char": ", ".join(notfound)})
|
||||
if len(gotalts) > 0:
|
||||
reply += "\n" + self.getresp("module/alts", "add_fail_already", {"char": ", ".join(gotalts)})
|
||||
reply += "\n" if reply != "" else '' + self.getresp("module/alts", "add_fail_already", {"char": ", ".join(gotalts)})
|
||||
reply += "\n".join(failed)
|
||||
return reply
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class OrgAliasController:
|
||||
return ChatBlob("Aliases currently in use", "\n".join(blob))
|
||||
|
||||
@command(command="orgs", params=[Const("alias"), Const("set"), Any("alias"), Any("org")], access_level="moderator",
|
||||
description="View the currently registered org aliases",
|
||||
description="Set the alias for an Org",
|
||||
sub_command="alias_moderate")
|
||||
def cmd_alias_add(self, sender, _, _1, alias, search):
|
||||
orgs = self.org_pork.find_org(search)
|
||||
@@ -81,7 +81,7 @@ class OrgAliasController:
|
||||
return ChatBlob("Pick an Org", blob)
|
||||
|
||||
@command(command="orgs", params=[Const("alias"), Const("rem"), Any("org")], access_level="moderator",
|
||||
description="View the currently registered org aliases",
|
||||
description="remove an Org alias",
|
||||
sub_command="alias_moderate")
|
||||
def cmd_alias_del(self, sender, _, _1, search):
|
||||
orgs = self.org_pork.find_org(search)
|
||||
|
||||
Reference in New Issue
Block a user