Added more Temporary project files to .gitignore, Added notification in the console when the bot is ready

This commit is contained in:
blackfur 2021-01-21 17:26:20 +01:00
parent f5a1db99fe
commit 14af9a1859
3 changed files with 4 additions and 8 deletions

2
.gitignore vendored
View file

@ -8,4 +8,6 @@ venv/
chatlogs/ chatlogs/
db.sqlite3 db.sqlite3
db.sqlite3-shm
db.sqlite3-wal
config.yml config.yml

View file

@ -1,7 +0,0 @@
botname: "ChatBot"
excludeprefix: "!"
filterpings: True
usechannels: []
trainchannels: [[]]
corpus: ["chatterbot.english"]
token: "TOKEN"

3
run.py
View file

@ -91,6 +91,7 @@ async def on_ready():
chatbot = ChatBot(config["botname"]) chatbot = ChatBot(config["botname"])
global finished global finished
finished = True finished = True
print("Starting to listen to messages...")
@bot.event @bot.event
@ -98,7 +99,7 @@ async def on_message(message):
if finished: 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["excludeprefix"]):
return return
else: else:
response = chatbot.get_response(message.content) response = chatbot.get_response(message.content)