twitchbots-base
v1.0.5
Published
Generic API consumer for https://twitchbots.info. Independent of request method.
Downloads
11
Maintainers
Readme
twitchbots-base
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)
: BotgetBots(usernames)
: arraygetAllBots()
: arraygetAllBotsByType(typeId)
: arraygetType(typeId)
: Type
Return Values
Bot
An object with the following properties:
isBot
: booleanusername
: stringtype
: typeId (number)
Type
An object with the following properties:
id
: typeId (number)name
: stringmultiChannel
: booleanurl
: string
License
This project is licensed under the MIT License.