|
|
@ -377,10 +377,10 @@ class Poe:
|
|
|
|
raise RuntimeError('Sorry, the model you provided does not exist. Please check and try again.')
|
|
|
|
raise RuntimeError('Sorry, the model you provided does not exist. Please check and try again.')
|
|
|
|
self.model = MODELS[model]
|
|
|
|
self.model = MODELS[model]
|
|
|
|
self.cookie_path = cookie_path
|
|
|
|
self.cookie_path = cookie_path
|
|
|
|
self.cookie = self.__load_cookie(driver, download_driver, driver_path=driver_path)
|
|
|
|
self.cookie = self.__load_cookie(driver, driver_path=driver_path)
|
|
|
|
self.client = PoeClient(self.cookie)
|
|
|
|
self.client = PoeClient(self.cookie)
|
|
|
|
|
|
|
|
|
|
|
|
def __load_cookie(self, driver: str, download_driver: bool, driver_path: Optional[str] = None) -> str:
|
|
|
|
def __load_cookie(self, driver: str, driver_path: Optional[str] = None) -> str:
|
|
|
|
if (cookie_file := Path(self.cookie_path)).exists():
|
|
|
|
if (cookie_file := Path(self.cookie_path)).exists():
|
|
|
|
with cookie_file.open() as fp:
|
|
|
|
with cookie_file.open() as fp:
|
|
|
|
cookie = json.load(fp)
|
|
|
|
cookie = json.load(fp)
|
|
|
@ -468,4 +468,4 @@ class Poe:
|
|
|
|
print(f'Successfully created bot with name: {response["bot"]["displayName"]}')
|
|
|
|
print(f'Successfully created bot with name: {response["bot"]["displayName"]}')
|
|
|
|
|
|
|
|
|
|
|
|
def list_bots(self) -> list:
|
|
|
|
def list_bots(self) -> list:
|
|
|
|
return list(self.client.bot_names.values())
|
|
|
|
return list(self.client.bot_names.values())
|
|
|
|