Cloning the repo and installing dependencies - chicklightning/tcg-pocket-trading-bot GitHub Wiki

Installing dependencies

You will need to install the following major dependencies to get started:

  1. Git
  2. Node.js
  3. PostgreSQL
  4. Discord

It's also recommended that you install GitHub Desktop if you're unfamiliar with Git. The section on cloning the repository will assume you are using this program to do this.

Installing Git

To install Git, you can follow their instructions here or go directly to their Downloads page. Use all of the default setup options during installation.

About Git

Git is used for version control, meaning that it's for tracking all of the changes made to files in a project. It's the backbone technology for GitHub, where this project is hosted. We will be using it to create a local copy of the files in this repository, and to grab changes to the files as the project is updated.

Installing Node.js

To install Node.js, go to their Downloads page. If you're on Windows, I would recommend downloadingtheir Windows installer (.msi). Use all of the default setup options during installation.

About Node.js

Node.js is the framework used to create this project. It lets us create a project using JavaScript and helps us easily manage our libraries and dependencies.

Installing PostgreSQL

To install PostgreSQL, go to their Downloads page. Use all of the default setup options during installation EXCEPT do not opt to run Stack Builder after installation is finished. IMPORTANT: When prompted to create a superuser password, be sure to save this password somewhere. It will ensure you have access to all databases created locally!

About PostgreSQL

PostgreSQL (also written often as Postgres) is the database system. It's what we use to read and write information to our own database so we can persist data between sessions of the bot running (i.e. if the bot breaks and needs to be restarted, we can still see which users need certain cards without losing data). It helps us query for this information efficiently.

Installing Discord

You probably have Discord installed already, but if you don't, you can download the installer here.

About Discord

Discord is a VOIP (Voice Over IP) application that lets users communicate via text messages or voice/video calls. It provides a host of APIs that allow people like me to build bots like this. Bots can then read your messages or command requests and then respond to you via the app.

Installing GitHub Desktop

Go to the Download page. Install with all of the default setup options.

About GitHub Desktop

This provides a nice user interface for us to clone the repository and update it when necessary instead of needing to use Git commands in the Command terminal.

After installation

After installing every dependency, it is highly recommended that you restart your computer. Many of these programs, when installed, change an environment variable on your computer called "PATH". This allows us to call these programs in the Command terminal from anywhere, rather than using the programs where they are located.

Cloning the repository

You will need to:

  1. Create a GitHub account here (if you don't have one)
  2. Sign in to this account on GitHub Desktop
  3. Go to the main page for this repository here
  4. Under the button "Code", select "Open with GitHub Desktop" (see image below)
  5. Choose a place to save the code to your computer that you can easily access later

Next steps

Now you're done setting up the initial dependencies and downloading the bot code! For the next step, go to Creating your bot in the Discord Developer Portal.