Initial commit: Complete PetBot IRC Game
🎮 Features implemented: - Pokemon-style pet collection and battles - Multi-location exploration system - Dynamic weather with background updates - Achievement system with location unlocks - Web dashboard for player stats - Modular command system - Async database with SQLite - PM flood prevention - Persistent player data 🌤️ Weather System: - 6 weather types with spawn modifiers - 30min-3hour dynamic durations - Background task for automatic updates - Location-specific weather patterns 🐛 Recent Bug Fixes: - Database persistence on restart - Player page SQLite row conversion - Achievement count calculations - Travel requirement messages - Battle move color coding - Locations page display 🔧 Generated with Claude Code 🤖 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
commit
47f160a295
31 changed files with 6235 additions and 0 deletions
30
modules/admin.py
Normal file
30
modules/admin.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Admin commands module for PetBot"""
|
||||
|
||||
from .base_module import BaseModule
|
||||
|
||||
class Admin(BaseModule):
|
||||
"""Handles admin-only commands like reload"""
|
||||
|
||||
def get_commands(self):
|
||||
return ["reload"]
|
||||
|
||||
async def handle_command(self, channel, nickname, command, args):
|
||||
if command == "reload":
|
||||
await self.cmd_reload(channel, nickname)
|
||||
|
||||
async def cmd_reload(self, channel, nickname):
|
||||
"""Reload bot modules (megasconed only)"""
|
||||
if nickname.lower() != "megasconed":
|
||||
self.send_message(channel, f"{nickname}: Access denied. Admin command.")
|
||||
return
|
||||
|
||||
try:
|
||||
# Trigger module reload in main bot
|
||||
success = await self.bot.reload_modules()
|
||||
if success:
|
||||
self.send_message(channel, f"{nickname}: ✅ Modules reloaded successfully!")
|
||||
else:
|
||||
self.send_message(channel, f"{nickname}: ❌ Module reload failed!")
|
||||
except Exception as e:
|
||||
self.send_message(channel, f"{nickname}: ❌ Reload error: {str(e)}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue