Fixed bidding, while not being in raid (Nolonger throws an error)

Added default alias !list for !loot (bebot like)
Changed the layout of !notes, its more compact now.
fixed !count in the rare case of an empty private channel
This commit is contained in:
2021-08-15 15:47:06 +02:00
parent 46d0ba3634
commit d0c8c1744c
6 changed files with 32 additions and 33 deletions
@@ -110,13 +110,9 @@ class AuctionStrategy:
raider: Raider = self.raid_controller.is_in_raid(main)
if type(raider) == Raider:
if not raider.is_active:
self.bot.send_mass_message(request.sender.char_id,
"You are not participating in the raid, and cannot add to the loot.")
return
return "You are not participating in the raid, and cannot add to the loot."
elif raider is None:
self.bot.send_mass_message(request.sender.char_id,
"You are not participating in the raid, and cannot add to the loot.")
return
return "You are not participating in the raid, and cannot add to the loot."
if not account:
return "You do not have an active account with this bot."
elif account.disabled:
+7 -6
View File
@@ -49,6 +49,7 @@ class LootController:
self.alias.add_alias("flatroll", "loot roll")
self.alias.add_alias("result", "loot roll")
self.alias.add_alias("results", "loot roll")
self.alias.add_alias("list", "loot")
self.alias.add_alias("win", "loot roll")
@command(command="loot", params=[], description="Show the list of added items", access_level="member")
@@ -292,9 +293,9 @@ class LootController:
for item in items:
self.add_item_to_loot(item, item.comment, item.multiloot)
self.bot.send_private_channel_message("%s table was added to loot." % category)
self.bot.send_private_channel_message(f"{category} table was added to loot.")
else:
return "%s does not have any items registered in loot table." % category
return f"{category} does not have any items registered in loot table."
@command(command="loot",
params=[Const("additem", is_optional=True), Int("item"), Int("item_count", is_optional=True)],
@@ -308,7 +309,7 @@ class LootController:
item = self.items_controller.get_by_item_id(item_id)
if not item:
return "Could not find item with ID <highlight>%d<end>." % item_id
return f"Could not find item with ID <highlight>{item_id}<end>."
self.add_item_to_loot(item, item_count=item_count)
@@ -337,7 +338,7 @@ class LootController:
loot += item
self.add_item_to_loot(item, item_count=item_count)
self.bot.send_private_channel_message("<highlight>%s<end> was added to loot list." % loot)
self.bot.send_private_channel_message(f"<highlight>{loot}<end> was added to loot list.")
@timerevent(budatime="1h",
description="Periodically check when loot list was last modified, and clear it "
@@ -384,10 +385,10 @@ class LootController:
[item[0][2], item[0][3]])
if imgid is not None:
img = self.text.make_image(imgid.get("icon")) + " - "
blob += "%d. %s%s " % (i, img, item[0][0])
blob += f"{i:d}. {img}{item[0][0]} "
else:
blob += "%d. %s " % (i, loot_item.get_item_str())
blob += f"{i:d}. {loot_item.get_item_str()} "
blob += f"x{loot_item.count} [{self.text.make_chatcmd('Add', f'/tell <myname> loot add {i}')}]\n"
blob += ""
if edit: