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!")
|
||||
else:
|
||||
chatbot = ChatBot(config["botname"])
|
||||
global finished
|
||||
finished = True
|
||||
|
||||
|
||||
@bot.event
|
||||
async def on_message(message):
|
||||
if finished:
|
||||
if message.author != bot.user:
|
||||
if message.channel.id in config["usechannels"]:
|
||||
if message.content.startswith(config["exclutionprefix"]):
|
||||
|
@ -111,5 +114,7 @@ async def on_message(message):
|
|||
position = response.find("<@")
|
||||
await message.channel.send(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"])
|
||||
|
|
Loading…
Reference in a new issue