Skip to content

Plugin Docs

kwaroran edited this page Apr 22, 2023 · 1 revision

Headers

Headers must be in top of the script.

//@risu-name (name)

Required

Parameters

  • name (string): name of the plugin

Able from 0.3.1

//@risu-arg (name) (type)

Parameters

  • name (string): name of the argument
  • type (string): type of the plugin, must be 'string' or 'int'

multiple headers with same type is supported

Able from 0.3.1

//@risu-display-name (name)

Parameters

  • name (string): display name of the plugin

Able from 0.3.3

Functions

risuFetch(url, arg)

Parameters

  • url (string): request url
  • arg (RisuFetchArg): request options

Returns Promise

  • ok (boolean): is successfuly requested
  • data (any): data of the response.

Able from 0.3.1

getArg(key)

Parameters

  • key (string): key of the argument. must been defined by header @risu-arg. must be like "::"

Example

  • const result = await getArg("examplePluginName::FirstArg")

Returns Promise

Able from 0.3.1