Update request token endpoint URL and logic
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import httpx
|
||||
import json
|
||||
from base_api import BaseAPI
|
||||
from config import Config
|
||||
|
||||
app_config = Config()
|
||||
|
||||
class RadioAPIClient(BaseAPI):
|
||||
"""
|
||||
@@ -62,8 +65,9 @@ class RadioAPIClient(BaseAPI):
|
||||
Returns:
|
||||
str: A token for the bot to use
|
||||
"""
|
||||
print(f"Fetching a token from {self.base_url}/request_token")
|
||||
return await self._request("POST", "/request_token")
|
||||
url = "/bots/request_token"
|
||||
print(f"Fetching a token from {self.base_url}{url}")
|
||||
return await self._request("POST", url, json={"client_id":app_conf.client_id})
|
||||
|
||||
async def send_command(self, client_id: str, command_name: str, args: list = None):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user