Add endpoint to fetch a token
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user