mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-10-22 05:52:10 +00:00
Refactor command handling and enhance plugin validation
- Removed redundant command list in config example for clarity. - Improved plugin validation by adding checks for required attributes and types, ensuring better error handling during plugin instantiation. - Enhanced rate limiter classes to track total sends and throttled attempts, providing statistics for better monitoring. - Updated command implementations to include metadata for better organization and clarity in command handling.
This commit is contained in:
1 parent
e5f98d69e6
commit
5ae67bc071
6 files changed
+261
-40
No files matched your search
@@ -11,9 +11,14 @@ from ..models import MeshMessage
|
||||
class SunCommand(BaseCommand):
|
||||
"""Command to get sun information"""
|
||||
|
||||
# Plugin metadata
|
||||
name = "sun"
|
||||
keywords = ['sun']
|
||||
description = "Get sunrise/sunset times"
|
||||
category = "solar"
|
||||
|
||||
def __init__(self, bot):
|
||||
super().__init__(bot)
|
||||
self.keywords = ['sun']
|
||||
|
||||
async def execute(self, message: MeshMessage) -> bool:
|
||||
"""Execute the sun command"""
|
||||
|
||||
Reference in new issue
Block a user