Repository of tutorial from https://pachevjoseph.com/posts/python-discord-bot
- Python 3.6+
This project is best ran in a virtual environment. You can use [pyvenv][3], which comes with python 3 and greater. The virtual enviroment lets you run different versions of python and packages from other projects.
First install python3+ on your machine which should come with [pip][4]. If not, download from link provided.
python3 -m venv env
- Create a virtual environment in the env foldersource env/bin/activate
- Load the environmentpip install -r requirements.txt
- Install dependenciesdeactivate
- Unloads the environment
Note - Most documentation is for unix systems. Differences between windows and unix are: env\Scripts\
instead of env/bin/
and libraries go in env\Lib\
rather than env/lib/
)
First install python3+ on your machine and then download and install [pip][4]. Then from the root of the project run:
pip install virtualenv
- Install virtualenv if not already done soCreate a virtual environment in the venv foldervirtualenv venv
- This creates will create a series of directories and scriptsvenv/Scripts/activate
- Load the enviroment (There should be a (venv) before the current directory path namepip install -r requirements.txt
- Install dependenciesdeactivate
- Unloads the environment
Once dependencies are running, make sure that the environmental variable BOT_TOKEN
is set to your bot token.
Use python bot.py
in order to run the bot.