User Log and Persistent Faction Information

This commit is contained in:
2026-01-27 14:48:46 -05:00
parent 4ae3a9eb17
commit 4850c16b87
39 changed files with 782 additions and 71 deletions

View File

@@ -14,14 +14,14 @@ assignment_manager: Optional[BotAssignmentManager] = None
def set_assignment_manager(manager: BotAssignmentManager):
"""Set the global assignment manager reference."""
#Set the global assignment manager reference.
global assignment_manager
assignment_manager = manager
@router.get("/discord_mappings")
async def get_discord_mappings():
"""Get all Torn ID to Discord ID mappings"""
#Get all Torn ID to Discord ID mappings
path = Path("data/discord_mapping.json")
if not path.exists():
return {"mappings": {}}
@@ -33,7 +33,7 @@ async def get_discord_mappings():
@router.post("/discord_mapping")
async def add_discord_mapping(req: DiscordMappingRequest):
"""Add or update a Torn ID to Discord ID mapping"""
#Add or update a Torn ID to Discord ID mapping
path = Path("data/discord_mapping.json")
# Load existing mappings
@@ -59,7 +59,7 @@ async def add_discord_mapping(req: DiscordMappingRequest):
@router.delete("/discord_mapping/{torn_id}")
async def remove_discord_mapping(torn_id: int):
"""Remove a Discord mapping"""
#Remove a Discord mapping
path = Path("data/discord_mapping.json")
if not path.exists():