Fixed global declaration of "chatbot" var

master
blackfur 2021-01-17 19:20:33 +01:00
parent d114bfe7cc
commit d1c58df7f2
2 changed files with 1 additions and 3 deletions

View File

@ -1 +0,0 @@
["Hello", "Hi"]

3
run.py
View File

@ -49,6 +49,7 @@ async def train():
@bot.event
async def on_ready():
global chatbot
print("Logged in!")
args = sys.argv
args.pop(0)
@ -75,12 +76,10 @@ async def on_ready():
print("Finished download!")
if tasks[1]:
os.system("rm db.sqlite3")
global chatbot
chatbot = ChatBot(config["botname"])
await train()
print("Finished train!")
else:
global chatbot
chatbot = ChatBot(config["botname"])
bot.run(config["token"])