PM-only admin reload restarts bot; raise clover price

This commit is contained in:
3nd3r
2025-12-30 23:21:48 -06:00
parent b944e234d6
commit 292db0c95e
2 changed files with 15 additions and 9 deletions

View File

@@ -64,7 +64,7 @@
}, },
"10": { "10": {
"name": "4-Leaf Clover", "name": "4-Leaf Clover",
"price": 100, "price": 250,
"description": "Crazy luck for 10 minutes - greatly boosts hit & befriend success", "description": "Crazy luck for 10 minutes - greatly boosts hit & befriend success",
"type": "clover_luck", "type": "clover_luck",
"duration": 600, "duration": 600,

View File

@@ -651,6 +651,19 @@ class DuckHuntBot:
# Execute command with error recovery # Execute command with error recovery
command_executed = False command_executed = False
# Special case: admin PM-only bot restart uses !reload.
# In channels, !reload remains the gameplay reload command.
if cmd == "reload" and not channel.startswith('#') and self.is_admin(user):
command_executed = True
await self.error_recovery.safe_execute_async(
lambda: self.handle_reloadbot(nick, channel),
fallback=None,
logger=self.logger
)
if command_executed:
return
if cmd == "bang": if cmd == "bang":
command_executed = True command_executed = True
await self.error_recovery.safe_execute_async( await self.error_recovery.safe_execute_async(
@@ -771,13 +784,6 @@ class DuckHuntBot:
logger=self.logger logger=self.logger
) )
elif cmd in ("reloadbot", "restartbot") and self.is_admin(user):
command_executed = True
await self.error_recovery.safe_execute_async(
lambda: self.handle_reloadbot(nick, channel),
fallback=None,
logger=self.logger
)
# If no command was executed, it might be an unknown command # If no command was executed, it might be an unknown command
if not command_executed: if not command_executed:
@@ -1201,7 +1207,7 @@ class DuckHuntBot:
self.send_message(nick, line) self.send_message(nick, line)
async def handle_reloadbot(self, nick, channel): async def handle_reloadbot(self, nick, channel):
"""Admin-only: restart the bot process via PM to apply code changes.""" """Admin-only: restart the bot process via PM (!reload) to apply code changes."""
# PM-only to avoid accidental public restarts # PM-only to avoid accidental public restarts
if channel.startswith('#'): if channel.startswith('#'):
self.send_message(channel, f"{nick} > Use this command in PM only.") self.send_message(channel, f"{nick} > Use this command in PM only.")