Getting started - dvirby20/BotIt GitHub Wiki

In this page you will get all the necessary preperations so you can program your first bot.

Step 1: Create a bot

  1. Open Telegram on your computer using Telegram Web or Telegram Desktop.

  2. Search "BotFather" and press on the first option.

  3. Press the "/start" command on the lower part of the chat (or just send "/start" to it).

  4. Send "/newbot" command to the bot and choose a bot name and username (note that the username must end with bot).

  5. Now a message like the one below will be sent to you. Copy the text in red after HTTP API (your text is going to be different, that's okay).

  6. Well done! You created your first bot! Soon you can start coding it.

image

Step 2: Download PyCharm 2019

To code our bot we need a proper programming software. Our code works only with pyCharm 2019. It doesn't work on other programming software or other versions of PyCharm.

  1. Search "PyCharm" on google and press on the first result.

  2. Press "DOWNLOAD".

  3. On the side, press "Other versions".

  4. Scroll down to "Version 2019.1" and download it.

  5. Well done!

Step 3: Download Python 3.8

Our API works only with Python 3.8, so make sure to have it downloaded before you start coding.

  1. Search "Download Python" on google and press on the first result.

  2. Press ctrl + f and search "Python 3.8.0".

  3. Press "DOWNLOAD".

  4. Scroll down to the bottom and choose "Windows x86-64 executable installer" for windows and "macOS 64-bit installer" for mac.

  5. Open the file you downloaded and press "Install now".

Step 4: Downloading MongoDB

MongoDB is the database that our bot uses to save his users details and groups.

  1. On google search "download mongodb" and press on the first result.

  2. On the right press "DOWNLOAD" (the version doesn't matter).

image

  1. Open the file that was downloaded and install MongoDB as you like.

  2. After you installed it, open the folder in which it was installed. Press server > YOUR_VERSION > bin > mongod.exe

  3. In the same place, press mongo.exe. This will open the command line.

  4. In the command line paste the following code, but with your name and password:

db.createUser(
  {
    user: "YOUR_NAME",
    pwd: "YOUR_PASSWORD",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
  }
)

  1. Remember these details, you will need them later.

Step 5: Downloading our API

  1. Go to <> Code section in our git

image

  1. Press Code and then copy the url it prompts to you.

image

image

  1. On file explorer, create a new folder. This will serve as the folder for you to get our API in.

  2. Open the folder and then double click on the top right where it shows the folder location.

image

  1. Write "cmd" in there and press 'Enter'.

image

  1. Write "git clone " and the url that you copied before in the pop-up window. Press Enter.

image

  1. Congratulations! You have saved our API in your folder!

Configure Python

  1. Open PyCharm. On the top left press file open and open the folder (named BotIt) that you downloaded in the previous step.

  2. Open the main.py file and wait a while. On the top of the screen you will see a yellow rectangle which says you need to install requirments. Press "install requirments".

  3. After all the requirements are downloaded, on the upper side of the screen press "add configuration".

  4. Click on Python Interpreter and then "show all".

  5. Press the one with Python 3.8 and BotIt.

  6. Press "apply".

  7. Double press shift on your keyboard and search "settings".

  8. Enter the first option.

  9. On the get_credentials() function, change the user name and password to your MongoDB username and password.

  10. On get_bot_token() function change the string after the return to your bot token that you got from the bot father.

  11. You are ready to build your first feature! Create your first feature.