Add A5->A4 repair fallback and harden Discord embed send

This commit is contained in:
alex
2026-05-25 17:03:16 +02:00
parent 25c5810778
commit 0bd8e7e7bc
2 changed files with 25 additions and 7 deletions
+3
View File
@@ -110,6 +110,9 @@ class DiscordEmbeds(GenericApi):
def _send_embed(self, e, webhook, file = None):
if webhook is None:
return
if e is None:
Logger.error("Error sending Discord embed: embed payload is None")
return
e.set_footer(text=f'Botty v.{__version__} by Aeon')
e.timestamp=datetime.datetime.now(datetime.timezone.utc)
try:
+22 -7
View File
@@ -227,13 +227,28 @@ class TownManager:
# check if we can rapair in current act
if self._acts[curr_act].can_trade_and_repair():
new_loc = self._acts[curr_act].open_trade_and_repair_menu(curr_loc)
if not new_loc: return False, False
if items:
items = personal.transfer_items(items, "sell")
vendor.repair()
wait(0.1, 0.2)
common.close()
return new_loc, items
if new_loc:
if items:
items = personal.transfer_items(items, "sell")
vendor.repair()
wait(0.1, 0.2)
common.close()
return new_loc, items
if curr_act == Location.A5_TOWN_START:
Logger.warning("A5 repair failed, attempting Act 4 Halbu fallback")
new_loc = self.go_to_act(4, curr_loc)
if not new_loc:
return False, False
new_loc = self._acts[Location.A4_TOWN_START].open_trade_and_repair_menu(new_loc)
if not new_loc:
return False, False
if items:
items = personal.transfer_items(items, "sell")
vendor.repair()
wait(0.1, 0.2)
common.close()
return new_loc, items
return False, False
new_loc = self.go_to_act(5, curr_loc)
if not new_loc: return False, False
new_loc = self._acts[Location.A5_TOWN_START].open_trade_and_repair_menu(new_loc)