Fix for !alts add with non-existing character

This commit is contained in:
2022-02-16 14:56:22 +01:00
parent d3461ef462
commit fd84d82af2
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ class IgnCore:
self.last_timer_event = 0
self.start_time = int(time.time())
self.major_version = "IGNCore v2.8"
self.minor_version = "3"
self.minor_version = "4"
self.incoming_queue = FifoQueue()
self.mass_message_queue = None
self.conns = DictObject()
+3 -3
View File
@@ -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)