From b249bc1ec0810c6ce2673b9c1a1f2f527fe779ac Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Eugenio Halili Date: Tue, 18 Aug 2020 19:56:31 +0800 Subject: [PATCH 1/4] [config] Make it an example config file Editing the config file and committing it with secrets was the wrong idea. So, I renamed it to 'config.example.py'. Signed-off-by: Andrei Jiroh Eugenio Halili --- BotBase/{config.py => config.example.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename BotBase/{config.py => config.example.py} (100%) diff --git a/BotBase/config.py b/BotBase/config.example.py similarity index 100% rename from BotBase/config.py rename to BotBase/config.example.py From 490aad08e322c60df12afdde7ecf308bb18dbbbc Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Eugenio Halili Date: Tue, 18 Aug 2020 20:00:41 +0800 Subject: [PATCH 2/4] [repo] Update the README As per the previous commit, committing Telegram API app ID, app hash, and Bot API token is a REALLY BAD IDEA. Signed-off-by: Andrei Jiroh Eugenio Halili --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7a6551..7ed912a 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ To setup a project using BotBase, follow this step-by-step guide (assuming `pip` - Open a terminal and type `git clone https://github.com/nocturn9x/BotBase` - `cd` into the newly created directory and run `python3 -m pip install -r requirements.txt` -- Once that is done, open the `BotBase/config.py` module with a text editor and start changing the default settings -- The first thing you might want to do is change the `API_ID`, `API_HASH` and `BOT_TOKEN` global variables. Check [this page](https://my.telegram.org/apps) and login with your telegram account to create an API_ID/API_HASH pair. For the bot token, just create one with [BotFather](https://telegram.me/BotFather) +- Once that is done, copy `BotBase/config.example.py` as `config.py` and edit your `config.py` module with a text editor and start changing the default settings +- The first thing you might want to do is change the `API_ID`, `API_HASH` and `BOT_TOKEN` global variables. Check [this page](https://my.telegram.org/apps) and login with your Telegram account to create an API_ID/API_HASH pair by registering a new application. For the bot token, just create one with [BotFather](https://telegram.me/BotFather). **Note**: The configuration file is still a python file and when it will be imported any python code that you typed inside it will be executed, so be careful! If you need to perform pre-startup operations it is advised to do them in the `if __name__ == "main":` block inside `bot.py`, before `bot.start()` From bb2b3559f072035cc4f7dff135a3c92aa331b834 Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Eugenio Halili Date: Tue, 18 Aug 2020 20:03:06 +0800 Subject: [PATCH 3/4] [gitignore] Add BotBase/config.py to ignore file Signed-off-by: Andrei Jiroh Eugenio Halili --- .gitignore | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 565b46e..242c5e2 100644 --- a/.gitignore +++ b/.gitignore @@ -129,13 +129,14 @@ dmypy.json .pyre/ # SQlite3 database and session files - database.db *.session *.session-journal -# Virtual Environment +# config file +BotBase/config.py +# virtualenv BotEnv BotEnv/ -BotEnv/* \ No newline at end of file +BotEnv/* From 2f81b10790ee0873f0f59b1f494583704ebc7a1a Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Eugenio Halili Date: Tue, 18 Aug 2020 20:09:01 +0800 Subject: [PATCH 4/4] [repo] Improve formatting on README Signed-off-by: Andrei Jiroh Eugenio Halili --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ed912a..4bf41be 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To setup a project using BotBase, follow this step-by-step guide (assuming `pip` - Open a terminal and type `git clone https://github.com/nocturn9x/BotBase` - `cd` into the newly created directory and run `python3 -m pip install -r requirements.txt` - Once that is done, copy `BotBase/config.example.py` as `config.py` and edit your `config.py` module with a text editor and start changing the default settings -- The first thing you might want to do is change the `API_ID`, `API_HASH` and `BOT_TOKEN` global variables. Check [this page](https://my.telegram.org/apps) and login with your Telegram account to create an API_ID/API_HASH pair by registering a new application. For the bot token, just create one with [BotFather](https://telegram.me/BotFather). +- The first thing you might want to do is change the `API_ID`, `API_HASH` and `BOT_TOKEN` global variables. Check [this page](https://my.telegram.org/apps) and login with your Telegram account to create an `API_ID`/`API_HASH` pair by registering a new application. For the bot token, just create one with [BotFather](https://telegram.me/BotFather). **Note**: The configuration file is still a python file and when it will be imported any python code that you typed inside it will be executed, so be careful! If you need to perform pre-startup operations it is advised to do them in the `if __name__ == "main":` block inside `bot.py`, before `bot.start()`