A community project for Hacktoberfest 2018. A Discord bot primarily designed to help teach Python learners from the PythonDiscord community how to contribute to open source.
You can find our community by going to https://discord.gg/python
We know it can be difficult to get into the whole open source thing at first. To help out, we've decided to start a little community project during hacktober that you can all choose to contribute to if you're finding the event a little overwhelming, or if you're new to this whole thing and just want someone to hold your hand at first.
!repository - Links to this repository
!Git - Links to getting started with Git page !Git.commit - An example commit command
If you are new to this you will find it far easier using PyCharm:
First things first, what is PyCharm?
PyCharm is a Python IDE(integrated development environment) that is used to make python development quicker and easier overall.
So now your going to need to download it here.
Ok, now you have got PyCharm downloading you are going to want to fork this project and find its git URL. To fork scroll to the top of the page and press this button.
Then when you new forked repository loads you are going to want to get the Git Url by clicking the green clone or download
button and then the copy link button as seen below:
Now that you have done that you are going to want to load up Pycharm and you'll get something like this without the left sidebar:
You going to want to click Check Out from Version Control->Git
and you'll get a popup like the one below:
Now paste your link in, test the connection and hit clone
. You now have a copy of your repository to work with and it should setup your Pipenv automatically.
Now we have setup our repository we need somewhere to test out bot.
You'll need to make a new discord server:
We need to make the applicaiton for our bot... navigate over to discordapp.com/developers and hit new application
Now we have our discord application you'll want to name your bot as below:
To actually make the bot hit Bot->Add Bot->Yes, do It!
as below:
Copy that Token and put to somewhere for safe keeping.
Now to add that robot to out new discord server we need to generate an OAuth2 Url to do so navigate to the OAuth2 tab, Scroll to the OAUTH2 URL GENERATOR section, click the Bot
checkbox in the scope section and finally hit the administrator
checkbox in the newly formed Bot Permissions section.
Copy and paste the link into your browser and follow the instructions to add the bot to your server - ensure it is the server you have just created.
Go back to PyCharm and you should have something a bit like below, Your going to want to hit the Add Configuration
button in the top right.
We are going to want to choose a python config as below:
The first setting we need to change is script path as below (the start script may have changed from bot.py so be sure to click the right one
Now we need to add an enviroment variable - what this will do is allow us to set a value without it affact the main repository.
To do this click the folder icon to the right of the text, then on the new window the plus icon. Now name the var HACKTOBERBOT_TOKEN
and give the value the token we kept for safe keeping earilier.
Now hit apply on that window and your ready to get going!
As we work on our project we are going to want to make commits. Commits are effectively a list of changes you made to the pervious version. To make one first hit the green tick in the top right
- Select the files you wish to commit
- Write a brief description of what your commit is
- See the actual changes you commit does here (you can also turn some of them off or on if you wish)
- Hit commit
Now once you have made a few commits and are happy with your changes you are going to want to push them back to your fork. There are three ways of doing this.
- Using the VSC Menu
VSC->Git->Push
- Using the VSC popup
alt-`->Push
- A shortcut:
ctrl+shift+K
You should get a menu like below:
- List of commits
- List of changed files
- Hit Push to send to fork!
Goto https://github.com/discord-python/hacktoberbot/pulls and the green New Pull Request button!
Now you should hit Compare across forks
then on the third dropdown select your fork (it will be your username/hacktoberbot
) then hit Create Pull request.
1
Now to tell other people what your PR does
- Title - be concise and informative
- Description - write what the PR changes as well as what issues it relates to
- Hit
Create pull request
At this point your PR will either be accepted or a maintainer might request some changes.
So you can read up some more on https://try.github.io, https://www.jetbrains.com/help/pycharm/quick-start-guide.html or you might want to learn more about Python and discord: [https://discordpy.readthedocs.io/en/rewrite/](discord.py rewrite)
The process above can be completed without PyCharm however it will be necessary to learn how to use Git, Pipenv and Environment variables.
You can find tutorials for the above below:
- Git: try.github
- Pipenv Pipenv.readthedocs
- Environment Variables: youtube