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