Add endpoint to fetch a token

This commit is contained in:
Logan Cusano
2025-04-27 01:42:45 -04:00
parent 941843bbb1
commit 3ab2d06411
2 changed files with 15 additions and 1 deletions

View File

@@ -94,6 +94,16 @@ class RadioAPIClient:
print(f"Fetching connected clients from {self.base_url}/clients")
return await self._request("GET", "/clients")
async def request_token(self):
"""
Retrieves a discord bot token.
Returns:
str: A token for the bot to use
"""
print(f"Fetching a token from {self.base_url}/request_token")
return await self._request("GET", "/request_token")
async def send_command(self, client_id: str, command_name: str, args: list = None):
"""
Sends a command to a specific client via the server's API.