Giter Club home page Giter Club logo

do-your-turn-discord's Introduction

do-your-turn-discord

This is a node.js Discord bot that pings users when their GMR turn comes up.

It is dead simple and does not scale to multiple games, guilds, or channels.

Configuration

Drop a config file into configuration/config.json. It looks like this:

{
    "gmr": {
        "apiKey": "API key from GMR",
        "endpoint": "http://multiplayerrobot.com/api/Diplomacy",
        "referencePlayerId": "GMR ID of any player in the game you want to monitor",
        "gameId": "ID of the game to monitor",
        "players": {
            "76561197967998342": { // GMR id of a player in the game
                "friendlyName": "Rein", // A display name so you can keep track of all these IDs. Not used.
                "discordId": "161282472624128001" // ID of the corresponding user in Discord
            },
            "76561197993457891": {
                "friendlyName": "Zyrjello",
                "discordId": "102499714120826880"
            },
            "76561197993798090": {
                "friendlyName": "Asimir",
                "discordId": "234441482113777664"
            },
            "76561198024953688": {
                "friendlyName": "Ersuis",
                "discordId": "155058083112943616"
            },
            "76561198027089728": {
                "friendlyName": "Xavier",
                "discordId": "239527336997945345"
            }
        }
    },
    "discord": {
        "token": "Auth token for your Discord bot",
        "guildId": "ID of the guild where the below channel is located",
        "channelId": "Channel to ping when the current turn changes"
    }
}

Where do I get all these IDs?

GMR

  1. In GMR, find your game. Its ID will be in the URL.
  2. Inspect the HTML element holding a user's avatar on your game page. The user ID should be in there somewhere (it probably starts with 76). You can get the IDs of everyone in the game this way.

Discord

  1. In the Discord settings, turn on developer mode.
  2. Right-click on whatever thing you want the ID of and click "Copy ID".

Execution

npm start

Send an interrupt (Ctrl-C) to shut it down.

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.