GithubHelp home page GithubHelp logo

marcuswindecker / the-speaker Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 336 KB

Retrieves a Destiny 2 Raid Report for a given user and returns it to a Slack channel

License: MIT License

JavaScript 100.00%
slack slack-commands destiny2 bungie nodejs shitposting the-speaker

the-speaker's Introduction

The Speaker

Because knowing is half the battle.

This is a Slack app designed to help you build a competent raid fireteam in Destiny 2. It's triggered with a slash command that you customize.

/speaker marcuswindecker returns an initial response that looks like:

I'm consulting with the Traveler...

This initial response satisfies the 3sec window that Slack waits for before timing out the request. Once the full stats are retrieved, a followup response is POSTed to the response_url sent with the initial Slack request.

Optionally, you can submit a platform ('psn', 'xbox', 'pc') to search that platform specifically. If this platform isn't present, then the request will default to PSN.

An error message is returned if the user isn't found on the platform or if an incorrect number of params is sent in the request.

Deploying this app on Heroku.
  1. Clone or fork this repo
  2. npm install
  3. npm start
  4. The server will spin up at http://localhost:3000 (you can configure the port in index.js)
  5. Verify that the app has compiled correctly and is accessible using Postman or cURL
  6. When you are able to verify that the app is responding as expected, follow these instructions to deploy the app on Heroku
  7. When you've verified that the app is correctly deployed on Heroku, create a new slack app in your channel. Create a slash command within the app and point it at your newly created Heroku URL using whatever command you prefer to trigger the app, I like /speaker but you can use /freaker if you want.
  8. If all goes well, you'll be reporting on fools in no time and getting those 30-minute raids in with a solid team.

Note: currently, there is only a single endpoint configured: /api/raid. The request/response structures are as follows:

POST /api/raid

Request:
{
    text: '[<platform>] <username>',
    response_url: <url>
}

Initial Response:
{
    response_type: 'in_channel',
    text: 'I\'m consulting with the Traveler...'
}

Delayed Response (success):
{
    response_type: 'in_channel',
    text: 'Here are the detailed stats for <username> on <platform>'
    attachments: [{
        fallback: '<username> has <completion_count> completions in total on <platform>.',
        fields: [
            {
                title: 'Total Completions',
                value: <completion_count>,
                short: true
            },
            {
                title: 'Completion Percentage',
                value: <completion_percentage>,
                short: true
            },
            {
                title: 'Fastest Time',
                value: <fastest_time>,
                short: true
            }
        ],
        color: 'good'
    }]
}

Delayed Response (error):
{
    response_type: 'in_channel',
    attachments: [{
        fallback: <error_message>,
        text: <error_message>,
        color: 'danger'
    }]
}

Warning!

The code in this repo may be stable or unstable at any given time. Beware! Maybe if this thing gets traction I'll put a proper release protocol in place but for now everything's going to master!

Roadmap:

  • Ability to specify a specific raid with the request i.e. /speaker leviathan marcuswindecker, /speaker eaterofworlds marcuswindecker
  • Include additional stats like:
    • times: average, most recent
    • dates: first, most recent

Acknowledgements

  • The Traveler npm package from @alexanderwe - This package is the only reason this entire project came together. I can't express how happy I was to find this and how smooth it made the project.
  • The raid.report team for their work on one of the most damn useful Destiny 2 webapps I've come across. Seriously, that thing is slick.
  • Bungie for providing such a comprehensive API for Destiny 2.

the-speaker's People

Contributors

marcuswindecker 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.