1.0.5 • Published 10 years ago

twitchbots-base v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

twitchbots-base

Build Status codecov Dependency Status

This is a base-module for using the twitchbots.info API with JS. It requires a request function to be passed in. For modules with a request method built in, see jetpack-twitchbots and twitchbots-node.

Usage

To instantiate, construct the global export of the module, with one argument, an object of the following form:

{
    request: function(url) {
        return new Promise(function(resolve, reject) {
            //TODO make request. Resolve with parsed JSON on 200 status code,
            // else reject with an error that has a "code" attribute with the
            // error code.
        });
    }
}

Methods

All methods resolve to promises. The return values are explained later on.

  • getBot(username): Bot
  • getBots(usernames): array
  • getAllBots(): array
  • getAllBotsByType(typeId): array
  • getType(typeId): Type

Return Values

Bot

An object with the following properties:

  • isBot: boolean
  • username: string
  • type: typeId (number)

Type

An object with the following properties:

  • id: typeId (number)
  • name: string
  • multiChannel: boolean
  • url: string

License

This project is licensed under the MIT License.

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago