Fix crash caused by variable initialise
This commit is contained in:
parent
a5d88a104c
commit
d0b93b454d
1 changed files with 3 additions and 4 deletions
7
bot.py
7
bot.py
|
@ -116,9 +116,9 @@ class Bot:
|
||||||
"bing_api_endpoint is not provided, !bing command will not work"
|
"bing_api_endpoint is not provided, !bing command will not work"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.pandora_api_endpoint = pandora_api_endpoint
|
||||||
# initialize pandora
|
# initialize pandora
|
||||||
if pandora_api_endpoint is not None:
|
if pandora_api_endpoint is not None:
|
||||||
self.pandora_api_endpoint = pandora_api_endpoint
|
|
||||||
self.pandora = Pandora(
|
self.pandora = Pandora(
|
||||||
api_endpoint=pandora_api_endpoint,
|
api_endpoint=pandora_api_endpoint,
|
||||||
clientSession=self.session
|
clientSession=self.session
|
||||||
|
@ -127,7 +127,8 @@ class Bot:
|
||||||
self.pandora_api_model = "text-davinci-002-render-sha-mobile"
|
self.pandora_api_model = "text-davinci-002-render-sha-mobile"
|
||||||
else:
|
else:
|
||||||
self.pandora_api_model = pandora_api_model
|
self.pandora_api_model = pandora_api_model
|
||||||
|
self.pandora_data = {}
|
||||||
|
|
||||||
self.bard_token = bard_token
|
self.bard_token = bard_token
|
||||||
# initialize bard
|
# initialize bard
|
||||||
if self.bard_token is not None:
|
if self.bard_token is not None:
|
||||||
|
@ -155,8 +156,6 @@ class Bot:
|
||||||
self.goon_prog = re.compile(r"^\s*!goon\s*.*$")
|
self.goon_prog = re.compile(r"^\s*!goon\s*.*$")
|
||||||
self.new_prog = re.compile(r"^\s*!new\s*.*$")
|
self.new_prog = re.compile(r"^\s*!new\s*.*$")
|
||||||
|
|
||||||
self.pandora_data = {}
|
|
||||||
|
|
||||||
# close session
|
# close session
|
||||||
def __del__(self) -> None:
|
def __del__(self) -> None:
|
||||||
self.driver.disconnect()
|
self.driver.disconnect()
|
||||||
|
|
Loading…
Reference in a new issue