Weeb.sh handler
Kind: global class
- Handler
- new Handler(key, [keyType], [userAgent])
- .getTags([hidden]) ⇒
Promise.<Array.<String>>
- .getTypes([hidden]) ⇒
Promise.<Array.<String>>
- .getInfo() ⇒
Promise.<Object>
- .getRandom(options) ⇒
Promise.<Object>
Param | Type | Default | Description |
---|---|---|---|
key | String |
your API key for weeb.sh | |
[keyType] | String |
'Bearer' |
Type of key you're using. Either 'Bearer' or 'Wolke' |
[userAgent] | String |
'Wolken/VERSION' |
The User-Agent to use for requests. Should be in the format BotName/Version or BotName/Version/environment |
handler.getTags([hidden]) ⇒ Promise.<Array.<String>>
Gets a list of all the available tags in the API.
Kind: instance method of Handler
Returns: Promise.<Array.<String>>
- All the available tags.
Param | Type | Default | Description |
---|---|---|---|
[hidden] | Boolean |
false |
Whether to retrieve hidden tags. |
handler.getTypes([hidden]) ⇒ Promise.<Array.<String>>
Gets a list of all the available types in the API.
Kind: instance method of Handler
Returns: Promise.<Array.<String>>
- All the available types.
Param | Type | Default | Description |
---|---|---|---|
[hidden] | Boolean |
false |
Whether to retrieve hidden types. |
Gets a list of all the available tags in the API.
Kind: instance method of Handler
Returns: Promise.<Object>
- Information about the API.
Get's a random image from the API.
Kind: instance method of Handler
Returns: Promise.<Object>
- .
Param | Type | Description |
---|---|---|
options | Object |
Options to pass to the API. |
options.type | String |
Category of the image to get. Either this or options.tags are required. |
options.tags | Array.<String> |
Tags that the image should have. Either this or options.type are required. |
[options.allowNSFW] | Boolean | String |
Whether to allow NSFW results. If this is a string, it should be 'only'. |
[options.hidden] | Boolean |
Whether to allow hidden results. |
[options.filetype] | String |
The filetype the image should be. |