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
+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)