Giter Club home page Giter Club logo

aoc-private-lb-discord-bot's Introduction

Advent of Code Private Leaderboard Discord Bot

A self-hosted discord bot to show your private Advent of Code leaderboards on your discord servers

Setup

  1. Clone
git clone https://github.com/kavinvalli/aoc-private-lb-discord-bot.git
  1. Install dependencies
npm install
  1. Setup environment variables

    1. App Name could be anything (optional)
    2. Get your DISCORD_BOT_TOKEN and DISCORD_CLIENT_ID from here. More details here.
    3. For SESSION, follow the following steps.
      1. Go to the Private Leaderboards Page on adventofcode.com.
      2. Click on View on the leaderboard you want the discord bot to run for.
      3. Click on API, then click on JSON.
      4. Now, right click on the page and click on Inspect.
      5. Go to the Network tab.
      6. Refresh the page.
      7. On the table, click on the one which has a name ending in .json and type as document.
      8. Scroll down, and in the Request Headers section, you will find a field that says cookie. Copy everything after session= and that is your SESSION.
    4. PRIVATE_LEADERBOARD_ID: In step 3, after clicking on JSON, you visit a page. The URL would look something like this: https://adventofcode.com/2022/leaderboard/private/view/1234567.json. Here 1234567 is the PRIVATE_LEADERBOARD_ID.
  2. Run the App

    1. Development mode
    npm run dev
    1. Normal Start
    npm start
    1. Build the application. The build files will be in the dist/ folder.
    npm run build

Deployment

To deploy the app on an EC2, GCP Instance, etc. use pm2.

  1. Build the app using npm run build.
  2. Start the pm2 process.
pm2 start dist/index.js --name aoc-private-lb-discord-bot # Replace aoc-private-lb-discord-bot with whatever you want to name the process (this is only for reference)

aoc-private-lb-discord-bot's People

Contributors

kavinvalli avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.