Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 3.19 KB

API.md

File metadata and controls

74 lines (52 loc) · 3.19 KB

API Documentation

Handler

Weeb.sh handler

Kind: global class

new Handler(key, [keyType], [userAgent])

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.

handler.getInfo() ⇒ Promise.<Object>

Gets a list of all the available tags in the API.

Kind: instance method of Handler
Returns: Promise.<Object> - Information about the API.

handler.getRandom(options) ⇒ Promise.<Object>

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.