Fix shop command errors

 Fixed indentation issue in handle_shop function
 Added missing 'magenta' color code for IRC
 Shop command now works without errors

Fixes:
- Removed extra indentation causing syntax error
- Added magenta color (\x0313) to colors dictionary
- Shop display now shows all categories properly
This commit is contained in:
2025-09-13 14:47:50 +01:00
parent 009a851696
commit 408a840e94
4 changed files with 67 additions and 2 deletions

View File

@@ -954,7 +954,67 @@
"bread": 0,
"duck_detector": 0,
"mechanical": 0
},
"testuser!test@test.com": {
"xp": 100,
"caught": 0,
"befriended": 0
},
"testuser": {
"xp": 0,
"caught": 0,
"befriended": 0,
"missed": 0,
"ammo": 6,
"max_ammo": 6,
"chargers": 2,
"max_chargers": 2,
"accuracy": 65,
"reliability": 70,
"weapon": "pistol",
"gun_confiscated": false,
"explosive_ammo": false,
"settings": {
"output_mode": "PUBLIC",
"notices": true,
"private_messages": false
},
"inventory": {},
"golden_ducks": 0,
"karma": 0,
"deflection": 0,
"defense": 0,
"jammed": false,
"jammed_count": 0,
"deaths": 0,
"neutralized": 0,
"deflected": 0,
"best_time": 999.9,
"total_reflex_time": 0.0,
"reflex_shots": 0,
"wild_shots": 0,
"accidents": 0,
"total_ammo_used": 0,
"shot_at": 0,
"lucky_shots": 0,
"luck": 0,
"detector": 0,
"silencer": 0,
"sunglasses": 0,
"clothes": 0,
"grease": 0,
"brush": 0,
"mirror": 0,
"sand": 0,
"water": 0,
"sabotage": 0,
"life_insurance": 0,
"liability": 0,
"decoy": 0,
"bread": 0,
"duck_detector": 0,
"mechanical": 0
}
},
"last_save": "1757707147.438802"
"last_save": "1757771132.8947892"
}

View File

@@ -551,3 +551,7 @@
2025-09-13 13:17:14,824 [INFO ] DuckHuntBot - load_database:402: Loaded 19 players from duckhunt.json
2025-09-13 13:22:07,954 [INFO ] DuckHuntBot - setup_logger:79: Enhanced logging system initialized with file rotation
2025-09-13 13:22:07,956 [INFO ] DuckHuntBot - load_database:402: Loaded 19 players from duckhunt.json
2025-09-13 14:45:32,890 [INFO ] DuckHuntBot - setup_logger:79: Enhanced logging system initialized with file rotation
2025-09-13 14:45:32,893 [INFO ] DuckHuntBot - load_database:402: Loaded 19 players from duckhunt.json
2025-09-13 14:47:29,566 [INFO ] DuckHuntBot - setup_logger:79: Enhanced logging system initialized with file rotation
2025-09-13 14:47:29,568 [INFO ] DuckHuntBot - load_database:403: Loaded 21 players from duckhunt.json

View File

@@ -172,6 +172,7 @@ class SimpleIRCBot:
'yellow': '\x0308',
'orange': '\x0307',
'purple': '\x0306',
'magenta': '\x0313',
'cyan': '\x0311',
'white': '\x0300',
'black': '\x0301',
@@ -1837,7 +1838,7 @@ class SimpleIRCBot:
# Compact footer
self.send_message(channel, f"Use !shop <id> to buy")
async def handle_buy(self, nick, channel, item, user):
"""Buy items and add to inventory"""
player = self.get_player(user)