From 61463267c8b25524819ceeceba9741873d410430 Mon Sep 17 00:00:00 2001 From: megaproxy Date: Tue, 15 Jul 2025 16:57:27 +0100 Subject: [PATCH] Redirect inventory commands to web interface with jump points MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated \!inventory, \!inv, and \!items commands to redirect to player profile - Added #inventory jump point for direct section navigation - Improved user experience with web-based inventory management - Enhanced UX with helpful explanatory messages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- modules/inventory.py | 45 ++++---------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/modules/inventory.py b/modules/inventory.py index 3013912..9994ad6 100644 --- a/modules/inventory.py +++ b/modules/inventory.py @@ -16,51 +16,14 @@ class Inventory(BaseModule): await self.cmd_use_item(channel, nickname, args) async def cmd_inventory(self, channel, nickname): - """Display player's inventory""" + """Redirect player to their web profile for inventory management""" player = await self.require_player(channel, nickname) if not player: return - inventory = await self.database.get_player_inventory(player["id"]) - - if not inventory: - self.send_message(channel, f"🎒 {nickname}: Your inventory is empty! Try exploring to find items.") - return - - # Group items by category - categories = {} - for item in inventory: - category = item["category"] - if category not in categories: - categories[category] = [] - categories[category].append(item) - - # Send inventory summary first - total_items = sum(item["quantity"] for item in inventory) - self.send_message(channel, f"🎒 {nickname}'s Inventory ({total_items} items):") - - # Display items by category - rarity_symbols = { - "common": "○", - "uncommon": "◇", - "rare": "◆", - "epic": "★", - "legendary": "✦" - } - - for category, items in categories.items(): - category_display = category.replace("_", " ").title() - self.send_message(channel, f"📦 {category_display}:") - - for item in items[:5]: # Limit to 5 items per category to avoid spam - symbol = rarity_symbols.get(item["rarity"], "○") - quantity_str = f" x{item['quantity']}" if item["quantity"] > 1 else "" - self.send_message(channel, f" {symbol} {item['name']}{quantity_str} - {item['description']}") - - if len(items) > 5: - self.send_message(channel, f" ... and {len(items) - 5} more items") - - self.send_message(channel, f"💡 Use '!use ' to use consumable items!") + # Redirect to web interface for better inventory management + self.send_message(channel, f"🎒 {nickname}: View your complete inventory at: http://petz.rdx4.com/player/{nickname}#inventory") + self.send_message(channel, f"💡 The web interface shows detailed item information, categories, and usage options!") async def cmd_use_item(self, channel, nickname, args): """Use an item from inventory"""