Fixed global declaration of "chatbot" var
This commit is contained in:
parent
d3e004deaa
commit
67c473d7f0
|
@ -1 +0,0 @@
|
||||||
["Hello", "Hi"]
|
|
3
run.py
3
run.py
|
@ -49,6 +49,7 @@ async def train():
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
|
global chatbot
|
||||||
print("Logged in!")
|
print("Logged in!")
|
||||||
args = sys.argv
|
args = sys.argv
|
||||||
args.pop(0)
|
args.pop(0)
|
||||||
|
@ -75,12 +76,10 @@ async def on_ready():
|
||||||
print("Finished download!")
|
print("Finished download!")
|
||||||
if tasks[1]:
|
if tasks[1]:
|
||||||
os.system("rm db.sqlite3")
|
os.system("rm db.sqlite3")
|
||||||
global chatbot
|
|
||||||
chatbot = ChatBot(config["botname"])
|
chatbot = ChatBot(config["botname"])
|
||||||
await train()
|
await train()
|
||||||
print("Finished train!")
|
print("Finished train!")
|
||||||
else:
|
else:
|
||||||
global chatbot
|
|
||||||
chatbot = ChatBot(config["botname"])
|
chatbot = ChatBot(config["botname"])
|
||||||
|
|
||||||
bot.run(config["token"])
|
bot.run(config["token"])
|
||||||
|
|
Loading…
Reference in a new issue