Added Finish checks
This commit is contained in:
parent
d44a47df86
commit
f5a1db99fe
5
run.py
5
run.py
|
@ -89,10 +89,13 @@ async def on_ready():
|
||||||
print("Finished train!")
|
print("Finished train!")
|
||||||
else:
|
else:
|
||||||
chatbot = ChatBot(config["botname"])
|
chatbot = ChatBot(config["botname"])
|
||||||
|
global finished
|
||||||
|
finished = True
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
|
if finished:
|
||||||
if message.author != bot.user:
|
if message.author != bot.user:
|
||||||
if message.channel.id in config["usechannels"]:
|
if message.channel.id in config["usechannels"]:
|
||||||
if message.content.startswith(config["exclutionprefix"]):
|
if message.content.startswith(config["exclutionprefix"]):
|
||||||
|
@ -111,5 +114,7 @@ async def on_message(message):
|
||||||
position = response.find("<@")
|
position = response.find("<@")
|
||||||
await message.channel.send(response)
|
await message.channel.send(response)
|
||||||
print(f"Input was given: '{message.content}', this output was found: '{response}'")
|
print(f"Input was given: '{message.content}', this output was found: '{response}'")
|
||||||
|
else:
|
||||||
|
await message.channel.send("Sorry, the Bot is still performing some tasks.")
|
||||||
|
|
||||||
bot.run(config["token"])
|
bot.run(config["token"])
|
||||||
|
|
Loading…
Reference in a new issue