Moved the coloring from <color>[text]<end> to <color>[test]</color>, which allows the discord module to reparse the messages more accurately

This commit is contained in:
2022-04-29 20:12:15 +02:00
parent fcea02e1c9
commit 3cade228fe
22 changed files with 177 additions and 421 deletions
@@ -1,137 +0,0 @@
# import asyncio
# import datetime
# import html
#
# # noinspection PyPackageRequirements
# from discord import Embed
#
# from core.command_service import CommandService
# from core.db import DB
# from core.decorators import instance
# from core.logger import Logger
# from core.lookup.character_service import CharacterService
# from core.lookup.pork_service import PorkService
# from core.message_hub_service import MessageHubService
# from core.registry import Registry
# from core.setting_service import SettingService
# from core.setting_types import NumberSettingType
# from core.text import Text
# from core.igncore import IgnCore
# from modules.core.accounting.services.access_service import AccessService
# from modules.core.discord.discord_controller import DiscordController
#
#
# # noinspection DuplicatedCode,PyAttributeOutsideInit
# @instance()
# class MessageDistributor:
# MESSAGE_SOURCE = "discord"
#
# def __init__(self):
# self.logger = Logger(__name__)
#
# def inject(self, registry):
# self.bot: IgnCore = registry.get_instance("bot")
# self.db: DB = registry.get_instance("db")
# self.character_service: CharacterService = registry.get_instance("character_service")
# self.access_service: AccessService = registry.get_instance("access_service")
# self.pork: PorkService = registry.get_instance("pork_service")
# self.relay_hub_service: MessageHubService = registry.get_instance("message_hub_service")
# self.discord: DiscordController = registry.get_instance("discord_controller")
# self.cmd_service: CommandService = registry.get_instance("command_service")
# self.setting_service: SettingService = registry.get_instance("setting_service")
# self.text: Text = registry.get_instance("text")
#
# def pre_start(self):
# self.relay_hub_service.register_message_source("public_relay")
# self.relay_hub_service.register_message_source("tell_logger")
# self.relay_hub_service.register_message_source("system_logger")
# self.relay_hub_service.register_message_source("access_denied_logger")
# self.relay_hub_service.register_message_source("member_logger")
#
# def start(self):
# self.relay_hub_service.register_message_destination("tell_log", self.handle_logging_tell, ["tell_logger"],
# ["tell_log"])
# self.setting_service.register(self.module_name, "dc_tell_log", 0, NumberSettingType(allow_empty=True),
# "ChannelID for the Tell Log")
#
# self.relay_hub_service.register_message_destination("access_denied_log", self.handle_logging_denied,
# ["access_denied_logger"], ["access_denied_log"])
# self.setting_service.register(self.module_name, "dc_denied_log", 0, NumberSettingType(allow_empty=True),
# "ChannelID for the Access Denied Log")
#
# self.relay_hub_service.register_message_destination("relay_log", self.handle_logging_relay,
# ["alliance", "public_relay"], ["relay_log"])
# self.setting_service.register(self.module_name, "dc_relay_log", 0, NumberSettingType(allow_empty=True),
# "ChannelID for the Relay Log")
#
# self.relay_hub_service.register_message_destination("public_relay", self.handle_public_relay, ["alliance"],
# ["public_relay"])
# self.setting_service.register(self.module_name, "dc_relay_public", 0, NumberSettingType(allow_empty=True),
# "ChannelID for the Public Relay Channel")
#
# self.relay_hub_service.register_message_destination("system", self.handle_logging_system, ["system_logger"],
# ["system"])
# self.setting_service.register(self.module_name, "dc_system_log", 0, NumberSettingType(allow_empty=True),
# "ChannelID for the System Channel")
#
# self.relay_hub_service.register_message_destination("dc_member_log", self.handle_logging_members,
# ["member_logger"], ["dc_member_log"])
# self.setting_service.register(self.module_name, "dc_member_log", 0, NumberSettingType(allow_empty=True),
# "ChannelID for the Member Log")
#
# if Registry.get_instance("darknet", is_optional=True):
# self.relay_hub_service.register_message_destination("dc_darknet_log", self.handle_darknet_log, ["darknet"],
# [""])
# self.setting_service.register(self.module_name, "dc_darknet_log", 0, NumberSettingType(allow_empty=True),
# "ChannelID for the Darknet Log")
#
# def handle_public_relay(self, ctx):
# if self.setting_service.get_value("dc_relay_public") != "0":
# message = self.format(ctx.formatted_message)
# self.discord.send_message(self.setting_service.get_value("dc_relay_public"), html.unescape(message),
# delete=3600) # delete after 1h
#
# def handle_logging_tell(self, ctx):
# if self.setting_service.get_value("dc_tell_log") != "0":
# message = self.format(ctx.message)
# self.discord.send_message(self.setting_service.get_value("dc_tell_log"),
# f"[FROM] {self.character_service.get_char_name(ctx.sender)}: {message}")
#
# def handle_logging_denied(self, ctx):
# if self.setting_service.get_value("dc_denied_log") != "0":
# message = self.format(ctx.message)
# self.discord.send_message(self.setting_service.get_value("dc_denied_log"), message)
#
# def handle_darknet_log(self, ctx):
# if self.setting_service.get_value("dc_darknet_log") != "0":
# message = self.format(ctx.message)
# self.discord.send_message(self.setting_service.get_value("dc_darknet_log"), message)
#
# def handle_logging_relay(self, ctx):
# if self.setting_service.get_value("dc_relay_log") != "0":
# message = self.format(ctx.formatted_message)
# self.discord.send_message(self.setting_service.get_value("dc_relay_log"), f"{html.unescape(message)}")
#
# def handle_logging_system(self, ctx):
# if self.setting_service.get_value("dc_system_log") != "0":
# message = self.format(ctx.message)
# self.discord.send_message(self.setting_service.get_value("dc_system_log"), f"{html.unescape(message)}")
#
# def handle_logging_members(self, ctx):
# if self.setting_service.get_value("dc_member_log") != "0":
# channel = self.discord.client.get_channel(int(self.setting_service.get_value("dc_member_log")))
# spam = []
# current = 0
# for message in ctx.message:
# current += 1
# spam.append(Embed(title=f"Recent changes - {datetime.date.today()} - ({current}/{len(ctx.message)})",
# description=message, color=3066993))
# asyncio.run_coroutine_threadsafe(self.send_spam(channel, spam), self.discord.loop)
#
# async def send_spam(self, channel, message):
# if self.discord.client.is_ready():
# for i in message:
# await channel.send(embed=i)
#
# def format(self, message):
# return self.text.strip_html_tags(message)
@@ -76,7 +76,7 @@ class AuctionStrategy:
bid_link = self.get_auction_list()
bid_link = self.text.paginate_single(ChatBlob("Click to bid", bid_link.msg))
msg = self.format_auction(f"1. {item}\n"
f"Average winning bid: <highlight>{avg_win_bid}<end>\n"
f"Average winning bid: <highlight>{avg_win_bid}</highlight>\n"
f"» {bid_link}")
self.spam_raid_message(msg)
@@ -140,19 +140,19 @@ class AuctionStrategy:
if winning_bid.sender.char_id == sender.char_id:
return "You're already holding the highest bid."
if bid_amount <= winning_bid.current_amount:
return f"Your bid of <highlight>{bid_amount:d}<end> points was not enough. " \
f"<highlight>{winning_bid.sender.name}<end> is currently winning with a " \
f"bid of <highlight>{winning_bid.current_amount:d}<end>."
return f"Your bid of <highlight>{bid_amount:d}</highlight> points was not enough. " \
f"<highlight>{winning_bid.sender.name}</highlight> is currently winning with a " \
f"bid of <highlight>{winning_bid.current_amount:d}</highlight>."
elif bid_amount <= winning_bid.max_amount:
winning_bid.current_amount = bid_amount
return f"Your bid of <highlight>{bid_amount}<end> points was not enough. " \
f"<highlight>{winning_bid.sender.name}<end> is currently " \
f"winning with a bid of <highlight>{winning_bid.current_amount}<end>."
return f"Your bid of <highlight>{bid_amount}</highlight> points was not enough. " \
f"<highlight>{winning_bid.sender.name}</highlight> is currently " \
f"winning with a bid of <highlight>{winning_bid.current_amount}</highlight>."
else:
current_amount = winning_bid.max_amount
self.bot.send_private_message(winning_bid.sender.char_id,
f"Your bid on {item} has been "
f"overtaken by <highlight>{sender.name}<end>.")
f"overtaken by <highlight>{sender.name}</highlight>.")
# increment 1 past current max bid
current_amount += 1
@@ -160,16 +160,16 @@ class AuctionStrategy:
if self.auction_end_time - time.time() < 10:
self.auction_end_time += 10
self.spam_raid_message(
f"<highlight>{sender.name}<end> now holds the leading "
f"bid for {item} with a bid of <highlight>{current_amount:d}<end>. [AS: +10 seconds]")
f"<highlight>{sender.name}</highlight> now holds the leading "
f"bid for {item} with a bid of <highlight>{current_amount:d}</highlight>. [AS: +10 seconds]")
else:
self.spam_raid_message(
f"<highlight>{sender.name}<end> now holds the leading bid for {item} "
f"with a bid of <highlight>{current_amount:d}<end>.")
f"<highlight>{sender.name}</highlight> now holds the leading bid for {item} "
f"with a bid of <highlight>{current_amount:d}</highlight>.")
return f"Your max bid of <highlight>{bid_amount:d}<end> points for {item} has put you in the lead. " \
f"You have <highlight>{points_available - bid_amount:d}<end> points left for bidding."
return f"Your max bid of <highlight>{bid_amount:d}</highlight> points for {item} has put you in the lead. " \
f"You have <highlight>{points_available - bid_amount:d}</highlight> points left for bidding."
def end(self):
self.cancel_job()
@@ -190,7 +190,7 @@ class AuctionStrategy:
winning_bid.current_amount, 0])
items += f"{i}. <highlight>{item}</highlight> (<highlight>{winning_bid.sender.name} » " \
f"{winning_bid.current_amount}P</highlight>)\n"
blob += "%d. %s, won by <highlight>%s<end> with <green>%d<end> points\n" % (
blob += "%d. %s, won by <highlight>%s</highlight> with <green>%d</green> points\n" % (
i, item, winning_bid.sender.name, winning_bid.current_amount)
main_id = self.account_service.get_main(winning_bid.sender.char_id).char_id
self.account_service.rem_pts(main_id,
@@ -231,8 +231,8 @@ class AuctionStrategy:
blob += f"{i:d}. {img}{item}"
winning_bid = self.winning_bids.get(i, None)
if winning_bid:
blob += f"<br><tab><highlight>{winning_bid.sender.name}<end> has the " \
f"winning bid of <highlight>{winning_bid.current_amount:d}<end>\n["
blob += f"<br><tab><highlight>{winning_bid.sender.name}</highlight> has the " \
f"winning bid of <highlight>{winning_bid.current_amount:d}</highlight>\n["
blob += self.text.make_chatcmd("bid +1", f"/tell <myname> bid {winning_bid.current_amount + 1} {i}")
blob += "]<tab>["
blob += self.text.make_chatcmd("bid +10", f"/tell <myname> bid {winning_bid.current_amount + 10} {i}")
@@ -246,7 +246,7 @@ class AuctionStrategy:
blob += self.text.make_chatcmd("bid Max", f"/tell <myname> bid all {i}")
blob += "]\n────────────────────────────────\n"
else:
blob += "<br><tab><green>No bidders<end>\n["
blob += "<br><tab><green>No bidders</green>\n["
blob += self.text.make_chatcmd("bid 1", f"/tell <myname> bid 1 {i:d}")
blob += "]<tab>["
blob += self.text.make_chatcmd("bid 10", f"/tell <myname> bid 10 {i:d}")
@@ -296,8 +296,8 @@ class AuctionStrategy:
winning_bid = self.winning_bids.get(item_index, None)
if winning_bid:
winner = f"<highlight>{winning_bid.sender.name}<end> now holds the " \
f"leading bid with a bid of <highlight>{winning_bid.current_amount:d}<end>."
winner = f"<highlight>{winning_bid.sender.name}</highlight> now holds the " \
f"leading bid with a bid of <highlight>{winning_bid.current_amount:d}</highlight>."
else:
winner = "No bids made."
msg = self.format_auction(f"1. {item}\n"
+5 -5
View File
@@ -231,7 +231,7 @@ class LootController:
f"{loot_item.get_item_str()}",
request.sender.char_id)
blob += f"{i:d}. {loot_item.get_item_str()}\n"
blob += f" | Winners: <red>{'<end>, <red>'.join(winners)}<end>\n\n"
blob += f" | Winners: <red>{'</red>, <red>'.join(winners)}</red>\n\n"
if loot_item.count == 0:
remove.append(i)
for i in remove:
@@ -310,7 +310,7 @@ class LootController:
item = self.items_controller.get_by_item_id(item_id)
if not item:
return f"Could not find item with ID <highlight>{item_id}<end>."
return f"Could not find item with ID <highlight>{item_id}</highlight>."
self.add_item_to_loot(item, item_count=item_count)
@@ -346,7 +346,7 @@ class LootController:
else:
loot += item
self.add_item_to_loot(item, item_count=item_count)
self.bot.send_private_channel_message(f"<highlight>{loot}<end> was added to loot list.")
self.bot.send_private_channel_message(f"<highlight>{loot}</highlight> was added to loot list.")
@timerevent(budatime="1h",
description="Periodically check when loot list was last modified, and clear it "
@@ -405,8 +405,8 @@ class LootController:
f"[ {self.text.make_tellcmd('REM', f'loot remitem {i}')} ]</yellow>\n\n"
else:
if len(bidders) > 0:
blob += f"<yellow>{', '.join(bidders)}<end>\n\n"
blob += f"<yellow>{', '.join(bidders)}</yellow>\n\n"
else:
blob += "<yellow>None added<end>\n\n"
blob += "<yellow>None added</yellow>\n\n"
return ChatBlob(f"Loot ({len(self.loot_list):d})", blob)
+12 -11
View File
@@ -42,7 +42,8 @@ class LootListsController:
"r&pu": "Rings and Preservation Units",
"symbs": "Symbiants",
"spirits": "Spirits",
"pgems": "Profession Gems",
"gem": "Profession Gems",
"gems": "Profession Gems",
"gen": "General",
"db1": "DB1",
"db2": "DB2",
@@ -143,7 +144,7 @@ class LootListsController:
if items:
return ChatBlob(f"{category} loot table", self.build_list(items, "APF", category, add_all))
else:
return f"No loot registered for <highlight>{category}<end>."
return f"No loot registered for <highlight>{category}</highlight>."
@command(command="apf", params=[], description="Get list of items from APF", access_level="member")
def apf_tables_cmd(self, _):
@@ -167,7 +168,7 @@ class LootListsController:
if items:
return ChatBlob(f"{category} loot table", self.build_list(items, "Albtraum", category))
else:
return f"No loot registered for <highlight>{category}<end>."
return f"No loot registered for <highlight>{category}</highlight>."
# #
# Pandemonium #
@@ -185,7 +186,7 @@ class LootListsController:
if items:
return ChatBlob(f"{category} loot table", self.build_list(items, "Pande", category))
else:
return f"No loot registered for <highlight>{category_name}<end>."
return f"No loot registered for <highlight>{category_name}</highlight>."
@command(command="pande", params=[], description="Get list of items from Pandemonium", access_level="member")
def pande_tables_cmd(self, _):
@@ -202,7 +203,7 @@ class LootListsController:
if items:
return ChatBlob(f"{category} loot table", self.build_list(items, "DustBrigade", category))
else:
return f"No loot registered for <highlight>{category}<end>."
return f"No loot registered for <highlight>{category}</highlight>."
@command(command="db", params=[], description="Get list of items from DustBrigade", access_level="member")
def db_tables_cmd(self, _):
@@ -255,7 +256,7 @@ class LootListsController:
if items:
return ChatBlob(f"{category} loot table", self.build_list(items, "poh", category))
else:
return f"No loot registered for <highlight>{category_name}<end>."
return f"No loot registered for <highlight>{category_name}</highlight>."
@command(command="poh", params=[], description="Get list of items from Pyramid of Home", access_level="member")
def poh_tables_cmd(self, _):
@@ -275,7 +276,7 @@ class LootListsController:
if items:
return ChatBlob(f"{category} loot table", self.build_list(items, "totwh", category))
else:
return f"No loot registered for <highlight>{category_name}<end>."
return f"No loot registered for <highlight>{category_name}</highlight>."
@command(command="totwh", params=[], description="Get list of items from Temple of Three Winds", access_level="member")
def totwh_tables_cmd(self, _):
@@ -294,7 +295,7 @@ class LootListsController:
if items:
return ChatBlob(f"{category} loot table", self.build_list(items, "subh", category))
else:
return f"No loot registered for <highlight>{category_name}<end>."
return f"No loot registered for <highlight>{category_name}</highlight>."
@command(command="subh", params=[], description="Get list of items from Condemned Subway (HL)",
access_level="member")
@@ -313,7 +314,7 @@ class LootListsController:
sql = "SELECT COUNT(*) AS count FROM raid_loot WHERE category = ? and raid=?"
count = self.db.query_single(sql, [raid.category, name]).count
blob += f"<highlight>{raid.category}<end> - {count} items\n"
blob += f"<highlight>{raid.category}</highlight> - {count} items\n"
blob += f" └ [{show_loot}]\n\n"
blob += "<pagebreak>"
if not name and not cmd:
@@ -336,7 +337,7 @@ class LootListsController:
title = raid[0][1] if isinstance(raid[0], tuple) else raid[0]
cmd = raid[1]
show_loot = self.text.make_chatcmd("Loot table", f"/tell <myname> {cmd}")
blob += f"<highlight>{title}<end>\n"
blob += f"<highlight>{title}</highlight>\n"
blob += f" └ [{show_loot}]\n\n"
blob += "<pagebreak>"
return blob
@@ -352,7 +353,7 @@ class LootListsController:
if add_all:
blob += f"{self.text.make_chatcmd('Add all', f'/tell <myname> loot addraid {raid} {category}')} items to loot list\n\n"
blob += f"<header2>{category}<end>\n" if category is not None else ""
blob += f"<header2>{category}</header2>\n" if category is not None else ""
for item in items:
comment = f" ({item.comment})" if item.comment != "" else ""
+1 -1
View File
@@ -26,7 +26,7 @@ class ChatController:
@command(command="lft", params=[Any("message", is_optional=True)], access_level="member",
description="Show a highly visible message")
def lft_command(self, _, message):
lft = f"<a href='chatcmd:///lft <font color=#FFFF00>» {message or '<myname>'}<end>'>/lft {message or '<myname>'}</a>"
lft = f"<a href='chatcmd:///lft <font color=#FFFF00>» {message or '<myname>'}</font>'>/lft {message or '<myname>'}</a>"
return self.text.format_page("Use this command for going LFT", "<yellow>────────────────</yellow>\n"
f"<highlight>{lft}</highlight>\n"
f"<yellow>────────────────</yellow>")
+20 -20
View File
@@ -44,9 +44,9 @@ class LeaderController:
description="Show the current raid leader")
def leader_show_command(self, _):
if self.leader:
return "The current raid leader is <highlight>{leader}<end>.".format(leader=self.leader.name)
return "The current raid leader is <highlight>{leader}</highlight>.".format(leader=self.leader.name)
else:
return "There is no current raid leader. Use <highlight><symbol>leader set<end> to become the raid leader."
return "There is no current raid leader. Use <highlight><symbol>leader set</highlight> to become the raid leader."
@command(command="leader", params=[Const("echo"), Options(["on", "off"])], access_level="leader",
description="Echo whatever the current leader types in channel, in a distinctive color", sub_command="mgn")
@@ -54,8 +54,8 @@ class LeaderController:
if self.leader:
if self.can_use_command(request.sender.char_id):
self.echo = switch_to == "on"
return f"Raidleader echo for <highlight>{self.leader.name}<end> has been turned " \
f"<highlight>{switch_to}<end>."
return f"Raidleader echo for <highlight>{self.leader.name}</highlight> has been turned " \
f"<highlight>{switch_to}</highlight>."
else:
return "Insufficient access level."
elif self.leader is None and switch_to == "on":
@@ -66,7 +66,7 @@ class LeaderController:
def leader_echo_status_command(self, _1, _2):
if self.leader:
on_off = "on" if self.echo else "off"
return f"<highlight>{self.leader.name}<end> is set as leader, leader echo is <highlight>{on_off}<end>"
return f"<highlight>{self.leader.name}</highlight> is set as leader, leader echo is <highlight>{on_off}</highlight>"
else:
return "No current leader set, echo is off."
@@ -87,7 +87,7 @@ class LeaderController:
description="Set another character as raid leader")
def leader_set_other_command(self, request, _, char):
if not char.char_id:
return "Could not find <highlight>{player}<end>.".format(player=char)
return "Could not find <highlight>{player}</highlight>.".format(player=char)
return self.set_raid_leader(request.sender, char)
@@ -154,18 +154,18 @@ class LeaderController:
self.echo = False
self.bot.send_private_message(old_leader.char_id,
f"You have been removed as raid leader "
f"by <highlight>{sender.name}<end>.")
return f"You have removed <highlight>{old_leader.name}<end> as raid leader."
f"by <highlight>{sender.name}</highlight>.")
return f"You have removed <highlight>{old_leader.name}</highlight> as raid leader."
else:
return f"You do not have a high enough access level to remove raid leader " \
f"from <highlight>{self.leader.name}<end>."
f"from <highlight>{self.leader.name}</highlight>."
elif sender.char_id == set_to.char_id:
if not self.leader:
self.leader = sender
self.echo = self.setting_service.get("leader_auto_echo").get_value()
reply = "You have been set as raid leader."
if self.echo:
reply += " Leader echo is <green>enabled<end>."
reply += " Leader echo is <green>enabled</green>."
return reply
elif self.leader.char_id == sender.char_id:
self.leader = None
@@ -175,29 +175,29 @@ class LeaderController:
old_leader = self.leader
self.leader = sender
self.echo = self.setting_service.get("leader_auto_echo").get_value()
reply = f"<highlight>{sender.name}<end> has taken raid leader from you."
reply = f"<highlight>{sender.name}</highlight> has taken raid leader from you."
if self.echo:
reply += " Leader echo is <green>enabled<end>."
reply += " Leader echo is <green>enabled</green>."
self.bot.send_private_message(old_leader.char_id, reply)
reply = f"You have taken raid leader from <highlight>{old_leader.name}<end>."
reply = f"You have taken raid leader from <highlight>{old_leader.name}</highlight>."
if self.echo:
reply += " Leader echo is <green>enabled<end>."
reply += " Leader echo is <green>enabled</green>."
return reply
else:
return f"You do not have a high enough access level to " \
f"take raid leader from <highlight>{self.leader.name}<end>."
f"take raid leader from <highlight>{self.leader.name}</green>."
else:
if self.can_use_command(sender.char_id):
self.leader = set_to
self.echo = self.setting_service.get("leader_auto_echo").get_value()
reply = f"<highlight>{sender.name}<end> has set you as raid leader."
reply = f"<highlight>{sender.name}</highlight> has set you as raid leader."
if self.echo:
reply += " Leader echo is <green>enabled<end>."
reply += " Leader echo is <green>enabled</green>."
self.bot.send_private_message(set_to.char_id, reply)
reply = f"<highlight>{set_to.name}<end> has been set as raid leader by {sender.name}."
reply = f"<highlight>{set_to.name}</highlight> has been set as raid leader by {sender.name}."
if self.echo:
reply += " Leader echo is <green>enabled<end>."
reply += " Leader echo is <green>enabled</green>."
return reply
else:
return f"You do not have a high enough access level to " \
f"take raid leader from <highlight>{self.leader.name}<end>."
f"take raid leader from <highlight>{self.leader.name}</highlight>."
@@ -93,7 +93,7 @@ class OrgListController:
blob += "History: <{side}>{HISTORY}</{side}><br><br>"
blob += "[{ADD}] - [{REM}]<br>"
if info[0]["GOVERNINGNAME"] == "Department":
blob += "<br><notice>Generals<end><br>"
blob += "<br><notice>Generals</notice><br>"
blob += "<generals>"
blob = blob.format(**info[0], side=info[0]["SIDE_NAME"].lower(),
ADD=self.text.make_chatcmd("Add to our orgs",
@@ -106,20 +106,20 @@ class OrgListController:
blob = blob.replace("<president>", member["NAME"])
if info[0]["GOVERNINGNAME"] == "Department":
if member["RANK"] == 1:
generals += "- {NAME} ({LEVELX}/<green>{ALIENLEVEL}<end>) {PROF}<br>".format(**member)
generals += "- {NAME} ({LEVELX}/<green>{ALIENLEVEL}</green>) {PROF}<br>".format(**member)
blob = blob.replace("<generals>", generals)
return ChatBlob(orgs[0].org_name, blob)
elif len(orgs) == 0:
return f"No org with the name <highlight>{org}<end> was found on PoRK."
return f"No org with the name <highlight>{org}</highlight> was found on PoRK."
else:
blob = "Your search had multiple results; please pick an org:<br>"
for org in orgs:
if Registry.get_instance('org_alias_controller', is_optional=True):
blob += f'[{self.text.make_chatcmd("Add", f"/tell <myname> orgs add {org.org_id}")}]'
blob += f'[{self.text.make_chatcmd("More", f"/tell <myname> orgs info {org.org_id}")}]'
blob += f' <highlight>{org.org_name}<end> ' \
f'(<highlight>{org.org_id}<end>) <{org.faction.lower()}>{org.faction}<end> ' \
f'[<highlight>{org.member_count}<end> members]<br><pagebreak>'
blob += f' <highlight>{org.org_name}</highlight> ' \
f'(<highlight>{org.org_id}</highlight>) <{org.faction.lower()}>{org.faction}</{org.faction.lower()}> ' \
f'[<highlight>{org.member_count}</highlight> members]<br><pagebreak>'
return ChatBlob("Pick an Org", blob)
def start_orglist_lookup(self, reply, org_id):