Message - Bilal2453/discordia-components GitHub Wiki

The Discordia Message class patched to include additional features.

This is a patched class. For full usage refer to the Discordia Wiki, only patched methods and properities are documented here.

Properties

Name Type Description
components table The raw table representing the components attached to this Message. See Discord's Component Structure for documentations of this field.

Methods

replyComponents(content, components)

Parameter Type Optional
content string/table
components Components-Resolvable/table

Equivalent to Message.channel:sendComponents(content, components).

This method always makes an HTTP request.

Returns: Message


setComponents(components)

Parameter Type Optional
components Components-Resolvable/boolean

Sets the message's components. If components is false or nil, the message's components are removed.

Returns true on success, otherwise nil, err.

Returns: boolean


update(data)

Parameter Type
data table

Sets multiple properties of the message at the same time. Identical to the one in Discordia; except supported fields are content, embed and components.

Returns true on success, otherwise nil, err.

This method always makes an HTTP request.

Returns: boolean


waitComponent(type, id, timeout, predicate)

Parameter Type Optional
type string/number
id Custom-ID-Resolvable
timeout number
predicate function

Equivalent to Message.client:waitComponent(Message, ...).

Returns: boolean, ...