User Log and Persistent Faction Information
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user