Skip to content

Commit

Permalink
Fix crash caused by variable initialise
Browse files Browse the repository at this point in the history
  • Loading branch information
hibobmaster committed Jun 1, 2023
1 parent a5d88a1 commit d0b93b4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit d0b93b4

Please sign in to comment.