Skip to content

Latest commit

 

History

History
113 lines (88 loc) · 3.82 KB

README.md

File metadata and controls

113 lines (88 loc) · 3.82 KB

Palette Bot

This repository contains code contribute by NUSCAS Palette Members.

The project encompasses a Discord Bot which currently supports the following features:

Feature Description
Birthday Tracker From an excel sheet on Google Drive, tracks birthday dates and reminds the Discord channel when a date corresponds with a member's birthdate.
Artwork Image Dumper From an excel sheet on Google Drive, tracks artwork permissions and dumps artworks from a selected Discord Channel.
Inktober Tracker Runs the Inktober minigame for one month.
Waifu War Tracker Work in progress. Tracks scores for Waifu Wars.

Recommended prerequisites

  1. Basic Command Line interface
  2. Version control with Git and Github
  3. Discord Library for Python (Google as you go)
  4. Python Pandas

Resources to Learn

  1. Kaggle Courses

    1. Python
    2. Pandas
  2. Discord Bot Tutorial

  3. Discord Bot Documentation

    • You don't need to know everything. Just look up what you happen to need to know.
  4. Software Engineering @ CS2113/T

    1. Good place to learn version control
    2. Learn about Forking Workflow
  5. Google Service API Auth

  6. Stack Overflow. Seriously.

Set-up

  1. Install Python 3.9.5 as well as Pip.
  2. Install Git.
  3. Download an IDE. VSCode is the recommended IDE for this project. You can also look at Pycharm or Sublime.
  4. Fork the repository to your own repository.
  5. Open up a new command terminal.
  6. Clone the repository to your local directory.
    • git clone https://github.com/yourname/palettebot.git
  7. Set up a python virtual environment.
    • python -m venv env
  8. Start your python virtual environment.
    • env\Scripts\activate.bat
  9. Run pip install
    • pip install -r requirements.txt
  10. Run the script and verify that it works.
    • python app.py

Directory overview

  1. Procfile, runtime.txt

    • Heroku files. Heroku is a cloud service that we use to run the script 24/7. This means no one needs to leave their computer on forever.
  2. config_loader.py

    • If script is run from Heroku, then use actual channels for input and output. (#art-gallery, #general)
    • Else if script is run from a PC (local environment), then use test channels. (#bot-spam, #exco-chat)
  3. controller/

    • Main folder for files encompassing feature logic
  4. io/

    • Main folder for image files, or any other output artifacts that are not required in feature logic
  5. utils/

    • If alot of features use the same function, then consolidate in this folder.
  6. .gitignore

    • Some features require automated access to Google Sheet and stuff.
    • Since they are mostly sensitive data, we need to protect it with credentials.
    • Instead of a login page, verifying credentials in code is provision of a certain file, for instance credentials.json
    • We want our keys in our own pockets (local directory), but we don't wnat them on some random garden bench (Github repository)
    • This file is to tell Github which files to not put onto this garden bench.
  7. requirements.txt

    • To do cooler stuff in python, you need to use other people's code to build your own code. We call them libraries.
    • This file contains all libraries that a new developer must download so that the code has what it needs to run.