Skip to content

Commit b950ec0

Browse files
committed
feat: a stable release? in this economy? - Update cogs to use async setup and improve performance tracking
1 parent 472f8f8 commit b950ec0

17 files changed

Lines changed: 126 additions & 36 deletions

File tree

cogs/Help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
# Import the modular help system
77
from .help import Help
88

9-
def setup(bot):
9+
async def setup(bot):
1010
"""Setup function for the help cog"""
11-
bot.add_cog(Help(bot))
11+
await bot.add_cog(Help(bot))

cogs/Stats.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
Stats Cog - Compatibility Shim
3+
This file maintains backwards compatibility by importing from the modular stats system.
4+
The actual implementation is now in /cogs/stats/
5+
"""
6+
7+
# Import the modular Stats cog
8+
from .stats.stats_cog import Stats
9+
10+
# Re-export for backwards compatibility
11+
__all__ = ['Stats']
12+
13+
# For any direct imports that might reference this module
14+
from .stats.constants import *
15+
from .stats.stats_manager import StatsManager
16+
from .stats.performance_manager import PerformanceManager
17+
from .stats.task_manager import TaskManager
18+
from .stats.dashboard_manager import DashboardManager
19+
from .stats.guild_manager import GuildManager
20+
from .stats.command_tracker import CommandTracker
21+
22+
async def setup(bot):
23+
"""Setup function for the cog"""
24+
await bot.add_cog(Stats(bot))

cogs/admin/Admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
# Import the modular admin system
77
from .admin import Admin
88

9-
def setup(bot):
9+
async def setup(bot):
1010
"""Setup function for the admin cog"""
11-
bot.add_cog(Admin(bot))
11+
await bot.add_cog(Admin(bot))

cogs/admin/admin/admin_cog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ async def clearcommands(self, ctx):
280280

281281
@commands.command(name="botstats")
282282
@commands.has_permissions(administrator=True)
283-
async def bot_stats(self, ctx):
283+
async def get_bot_stats(self, ctx):
284284
"""Get comprehensive bot statistics"""
285285
stats = await self.system_admin.get_bot_stats()
286286

cogs/economy/Bazaar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
# Import the modular bazaar system
77
from .bazaar import Bazaar
88

9-
def setup(bot):
9+
async def setup(bot):
1010
"""Setup function for the bazaar cog"""
11-
bot.add_cog(Bazaar(bot))
11+
await bot.add_cog(Bazaar(bot))

cogs/economy/Economy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
# Import the modular economy system
77
from .economy import Economy
88

9-
def setup(bot):
9+
async def setup(bot):
1010
"""Setup function for the economy cog"""
11-
bot.add_cog(Economy(bot))
11+
await bot.add_cog(Economy(bot))

cogs/economy/Trading.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
# Import the modular trading system
77
from .trading import Trading
88

9-
def setup(bot):
9+
async def setup(bot):
1010
"""Setup function for the trading cog"""
11-
bot.add_cog(Trading(bot))
11+
await bot.add_cog(Trading(bot))

cogs/economy/Work.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
# Import the modular work system
77
from .work import Work
88

9-
def setup(bot):
9+
async def setup(bot):
1010
"""Setup function for the work cog"""
11-
bot.add_cog(Work(bot))
11+
await bot.add_cog(Work(bot))

cogs/economy/bazaar/bazaar_cog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def __init__(self, bot):
4343
self.visitors = set()
4444
self.total_spent = 0
4545

46-
# Initialize bazaar
47-
self.reset_bazaar_items()
46+
# Initialize bazaar (will be done async)
47+
self.bot.loop.create_task(self.reset_bazaar_items())
4848

4949
# Start background tasks
5050
self.reset_bazaar_task.start()

cogs/economy/economy/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Economy System Module
22
from .economy_cog import Economy
33

4-
def setup(bot):
5-
bot.add_cog(Economy(bot))
4+
__all__ = ['Economy']
5+
6+
async def setup(bot):
7+
"""Setup function for the economy cog"""
8+
await bot.add_cog(Economy(bot))

0 commit comments

Comments
 (0)