WebUIClient

WebUIClient

An API for creating WebUIs, which allow users to enter responses from a webpage

Constructor

new WebUIClient(client)

Instantiates a WebUIClient.

Source:
Parameters:
Name Type Description
client Discord.Client

Constructor

Members

UIs :Discord.Collection.<WebUI>

A collection of the UIs, keyed by their UI IDs

Source:
Type:
  • Discord.Collection.<WebUI>

Methods

create(user, message, variables, duration, callback)

Creates a new WebUI and returns the generated ID.

Source:
Parameters:
Name Type Default Description
user Discord.Member | Discord.User

The Discord user this UI is for.

message String Enter your response here

The string message to display to the usser

variables Array.<Array.<String>> | Array.<Array.<RegExp>>

Array of [tag, replacement] pairs to customize webpage content. Accepts RegExp.

duration Number 300

How long to keep the webpage alive, in seconds

callback handlePlayerWebResponse

The callback function that handles the data from the Web UI

createWebUI(member, callback, optionsopt)

Helper function for creating a Web UI.

Source:
Parameters:
Name Type Attributes Description
member Discord.Member

The Discord member this UI is for.

callback handlePlayerWebResponse

The callback function that handles the data from the Web UI

options WebUIOptions <optional>

The options for this WebUI.

Returns:

The UI's link

receive(data)

Receives the data and runs the callback function

Source:
Parameters:
Name Type Description
data *

The data received from the WebUI