Update project configuration files, and API routes accordingly. Add SQLite runtime file ignores to .gitignore for better file management.
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||
# ║ |H|e|x|a|H|o|s|t| ║
|
||||
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ discord ── https://discord.gg/hexahost ║
|
||||
# ║ github ── https://github.com/theoneandonlymace ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
@@ -21,13 +20,13 @@ from slowapi import Limiter
|
||||
from slowapi.util import get_remote_address
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from core.zyrox import zyrox
|
||||
from core.hexahost import HexaHost
|
||||
|
||||
# Initialize rate limiter
|
||||
limiter = Limiter(key_func=get_remote_address, default_limits=["1000 per minute"])
|
||||
|
||||
# Global reference to the bot instance
|
||||
_bot_instance: Optional["zyrox"] = None
|
||||
_bot_instance: Optional["HexaHost"] = None
|
||||
|
||||
# Security scheme
|
||||
security = HTTPBearer()
|
||||
@@ -54,18 +53,18 @@ def verify_api_key(credentials: HTTPAuthorizationCredentials = Security(security
|
||||
)
|
||||
return credentials.credentials
|
||||
|
||||
def set_bot(bot_instance: "zyrox"):
|
||||
def set_bot(bot_instance: "HexaHost"):
|
||||
"""
|
||||
Sets the global bot instance.
|
||||
This should be called in CodeX.py during startup.
|
||||
This should be called in HexaHost.py during startup.
|
||||
"""
|
||||
global _bot_instance
|
||||
_bot_instance = bot_instance
|
||||
|
||||
def get_bot() -> "zyrox":
|
||||
def get_bot() -> "HexaHost":
|
||||
"""
|
||||
FastAPI dependency to retrieve the Discord bot instance.
|
||||
Usage: bot: zyrox = Depends(get_bot)
|
||||
Usage: bot: HexaHost = Depends(get_bot)
|
||||
"""
|
||||
if _bot_instance is None:
|
||||
raise HTTPException(
|
||||
|
||||
Reference in New Issue
Block a user