From d249ce11158f36be5a0a0f48aa82b60d0d51dd08 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 13 Jan 2021 11:45:30 +0100 Subject: [PATCH] Fixed Discord Bot Token being published via git --- .gitignore | 6 ++++-- run.py | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e24d8a8..5da55af 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ # Exclude VENV venv/ -# Exclude ChatLogs +# Exclude ChatLogs, DataBases and the API Token -chatlogs/* \ No newline at end of file +chatlogs/* +db.sqlite3 +token \ No newline at end of file diff --git a/run.py b/run.py index 5658075..170f2dd 100644 --- a/run.py +++ b/run.py @@ -9,8 +9,10 @@ config = {"botname": "Sheepy", "filterpings": True, "usechannels": [717758904527880253, 772839872557088769, 773980809471197235], "trainchannels": [[492412566430154783, 1000], [761462125696385047, 1000]], - "corpus": ["chatterbot.corpus.english", "chatterbot.corpus.uswest"], - "token": "NzU2NTgxNjQ0NTY3MTgzMzcw.X2T7kA.J7RthGGYMjgE_ZreLrGo2A3tCvg"} + "corpus": ["chatterbot.corpus.english", "chatterbot.corpus.uswest"]} + +with open("token", "r") as tokenfile: + token = tokenfile.read() bot = discord.Client() chatbot = ChatBot(config["botname"]) @@ -82,4 +84,4 @@ async def on_ready(): await train() -bot.run(config["token"]) +bot.run(token)