SupportClass / lfg-sublistener

Easy Twitch subscription events for NodeCG
MIT License
8 stars 4 forks source link

Might have found a problem in extension.js or in NodeCG documentation #3

Closed headwarsun closed 8 years ago

headwarsun commented 8 years ago

Hello,

First of all thanks to the dev to have made NodeCG and all these bundles available. I didn't manage to use lfg-sublistener bundle until I modified line 36 in file extension.js

if (nodecg.config.login.twitch.scope.split(' ').indexOf('channel_subscriptions') < 0) {

to

if (nodecg.config.login.twitch.scope.indexOf('channel_subscriptions') < 0) {

The problem is nodecg,config.login.twitch.scope should already be an array of string as it is indicated in nodecg documentation, the current code assumes it should be a string of space separated permissions.

headwarsun commented 8 years ago

Pull request done (I guess, not yet familiar with GitHub), by the way shouldn't the documentation example be modified as well ? Something like

{
    (...)
        "twitch": {
            (...)
            "scope": [
                "user_read"
            ],
            (...)
        }
    }
}

instead of

{
    (...)
        "twitch": {
            (...)
            "scope": "user_read",
            (...)
        }
    }
}
headwarsun commented 8 years ago

I understand, nothing "a bit silly" it is just as the Twitch-API doc says :

"Scopes are specified as a space separated list (...)"

Already closed my Pull request, gonna modify my nodecg config file, thanks for your answer.