Setting up a discord.py bot

This assumes you have Python 3.6+ installed and set up, a Windows 10 64 bit machine.

GitHub setup

Step 1) Navigate to https://github.com and log in/create an account.

Step 2) Click New as shown below.
1f8b0e40bdb21b55f746592a2ae1704189f5b820c2e3c94e05ee90fb057be5ff1f209f4f0d871ed5?t=709522a5e85dc93f3fc8874e96e29e6c

Step 3) You will be shown the following screen
dd8d68b636bb2fa746a3c2e621db6bc8981bdb1866a3c6f06ce8ed4ff9a7c05b23f593234e91bb91?t=c2f650fe29d0bea1735d8bf8396dcc28

Step 4) Fill in the details.

I will put "Creating a discord.py bot" as the Repository name.


You can either select public or private depending on if you want people to see it but I prefer to keep my main projects accessible to the public so I will keep the repo Public. 

You can select the README file if you want a description of your project but you can make that in the IDE yourself. I prefer to select the .gitignore now and the license. 

I added the .gitignore template as Python and the license as MIT as it's non-restrictive.

Step 4) You should end up with something like this, press Create repository 

7d8745b86763b1c6502d626f645fdde41f265c464769906d1580d878facb7ed4db6e3c28b784b4c7?t=58b76222ee02770d807da423d229cf85

Step 5) On pressing Create repository, you should end up with a screen like so:
9badce067ada5e3c4c737ce0156472aaab8a5b84b81ba9886f4e97317a76938ccad5008eec8d819e?t=4e2899a09c707d9d50dbb7d48e5c9f8b
Step 6) Now you must add it to your computer, The git-SCM docs is a great place to start for git or GitHub's guide on it make sure to authenticate to GitHub otherwise some parts will not work. 

Environment setup - PyCharm

Personally, I wouldn't develop Python programs in any other IDE other than PyCharm because it's the most helpful and clean looking. You might choose to use VS code or sublime(Not recommended for a large project)

Step 1) Install PyCharm by using this link: https://www.jetbrains.com/pycharm/download, follow the setup and you should be shown something similar to Step 2's image.

Step 2) You will be presented with this screen but with fewer Projects on a first time install. Click 
036d799ce8e5f8e22d67bf97dc6e293dba15f896ef0057da2364ac254fd9b68719103b67c1d282fa?t=a8af97c36d5d0b4f3a15f84379bfe8bf

Step 3) Click GET FROM VCS, you should see:
ab99316d799f18b16aba242cb8b99fd10055aadc8967b23c99bab28b3678ea5d478a63799093b184?t=04f0d2f31b5f6b86eb9977819285613d
Step 4) Type in the URL you got from GitHub into the URL box. And click Clone. Make sure to allow pycharm access to GitHub.

Step 5) You should get something like this:

6958807a96ff4ba0d754666cc184407c0be18ccdd57136f32c83f914dcd0aba04eeacdbe5b173027?t=ef0758abadccea5e989dac7c799eaaaf
Setup a virtual env environment as it helps stop conflicts of other modules. 

Step 6) Press CTRL + ALT + S
d159f4200a2d5639abeb1fa2a42624a42997297f685d98d5f564122860b1e249288a5fc04a4408e2?t=4d111687ec74f11ad16d72b208eee314
You should see something that includes this.

Step 7) Press the Cog
84e186b1de6311a3f67c3f2af89c18341dc834d6a5a21c69e1d24cce454bce0af000acd0219348b9?t=4670d0dcff14796b7bc2eeef7b50130d
Step 8) Press Add

cfa41f085cfcbc8021fe4ece6bb7bee7f22d922f58985b3a28465e53c5cc988e5e8c31e9e2a71697?t=90f10a97e5d9295e5b13b4e39f7edf82

Step 9) Make sure it's set to New environment with the base interpreter(python executable) you want then press OK


Step 10) Patience is key now, time to wait for it to create

83cc9ae55b9c42d32e16db4c3cd198bf9962c23c05c08a06020612b0e964feb06436ca29ea99bd2a?t=51181c561c92ab09a0c16a5fc01d2809
Step 11) Press ok and you should see a venv file in your project window.

b61dd3e4442658bd6be7d1cf06a3e5cd5b304e664afbcf28476ea3c9671b6fab7c5fa91680f6f3f5?t=82a0e6759068e0efa2db80810f427dd7

Install depedencies - requirements.txt

Unless you selected Inherit global site-packages then you will need to use pip install or use a requirements.txt file.

Step 1) Create a requirements.txt file

45e4ea45526b381b12ba1f92e1bfca897c42fac711d3d4eb648aef307deaa90cbe66f6a55bd8c30f?t=72931bf7cdbbb90e4ea94694e7486631

Step 2) Select ADD

Step 3) Add the following to the file

discord.py 

Step 4) You should end up with something like this:

cfe57c4d7a3c2d9937465026e4aeec081178bc52f0eecc838cd9573155330aa113d0658900ca3da9?t=b3eeeb2fa5a729fc244efbcae731c654

Step 5) Select install requirement, you should end up with the following:

b576a019b0472e9d2037096524b8740cb9074abcfca1e31f2965335d60707ee430e57f0bf7dba350?t=2a83bec072b1069300852c5d41a423d0

Upload the created files to GitHub - GIT

Now you made all the changes you might want to upload it to the repositry you created earlier.

744c547cd0a28a3da014f2ded7520e8e897dc8a5e37b75992d84ef3654870bb75b930cdc388d1652?t=acc8f69a0e94eba926bb1ce4965512b5

Step 1) On the image above on the Commit tab, we have lots of unversioned files. To remove this edit .gitignore. Type in .idea/

125e3ba59ece4793ba1be809f6eb7819af29b7d185eba623d6e8f0b8279285f605c601e199a3a9a1?t=addcba5c2875a7f0297ee89cd1fc3283
Step 2) You should see 2 files that were changed: .gitignore and requirements.txt, select both

Step 3) Type in a commit message but I would do say Part 1

Step 4) Press commit and push

If you enabled verified commits, you will need to insert your pass phrase if set

cc53f1b73e5ebcadda442a2a4030a716c8ddd7fb00e53aab755f75470529c6087f590ece11772fbe?t=79c40e0ab2b008c720451f2b72f26850

Step 5) Select Push

13bf6114281e2769d05b15a8b957e75fcab8955704d85e794f6b65f47c2c2507d6c733e49d863d07?t=2b6f276080c1ddec8aa7c01d1271a0da

Step 6) Now relax, you now have a github repo of your discord.py bot.