From d0b93b454d493406b492c437e352a69d477e215b Mon Sep 17 00:00:00 2001 From: hibobmaster Date: Thu, 1 Jun 2023 10:06:48 +0800 Subject: [PATCH] Fix crash caused by variable initialise --- bot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index a6b4d78..ca2cfa4 100644 --- a/bot.py +++ b/bot.py @@ -116,9 +116,9 @@ def __init__( "bing_api_endpoint is not provided, !bing command will not work" ) + self.pandora_api_endpoint = pandora_api_endpoint # initialize pandora if pandora_api_endpoint is not None: - self.pandora_api_endpoint = pandora_api_endpoint self.pandora = Pandora( api_endpoint=pandora_api_endpoint, clientSession=self.session @@ -127,7 +127,8 @@ def __init__( self.pandora_api_model = "text-davinci-002-render-sha-mobile" else: self.pandora_api_model = pandora_api_model - + self.pandora_data = {} + self.bard_token = bard_token # initialize bard if self.bard_token is not None: @@ -155,8 +156,6 @@ def __init__( self.goon_prog = re.compile(r"^\s*!goon\s*.*$") self.new_prog = re.compile(r"^\s*!new\s*.*$") - self.pandora_data = {} - # close session def __del__(self) -> None: self.driver.disconnect()