Skip to content

ActionMetadata

Implementation of a discord automoderation action metadata object as a luau builder.

ActionMetadata.channelId  :: string

The ID of the channel where the action should be taken.

ActionMetadata.durationSeconds  :: number

The duration of the action in seconds.

ActionMetadata.customMessage  :: string?

A custom message that will be shown to members when the action is taken.

ActionMetadata : setChannelId ( channelId )  -> ActionMetadata

Sets the ID of the channel where the action should be taken.

Parameters

channelId: Snowflake

Returns

ActionMetadata
ActionMetadata : setDurationSeconds ( durationSeconds )  -> ActionMetadata

Sets the duration of the action in seconds.

Parameters

durationSeconds: number

Returns

ActionMetadata
ActionMetadata : setCustomMessage ( customMessage )  -> ActionMetadata

Sets a custom message to be sent with the action.

Parameters

customMessage: string

Returns

ActionMetadata
ActionMetadata : build ( )  -> JSON

Builds the action metadata object.

Returns

JSON
ActionMetadata . new ( resource )  -> ActionMetadata

Responsible for creating a new ActionMetadata.

local metadata = ActionMetadata.new({
channelId = "123456789",
durationSeconds = 300,
customMessage = "Action taken due to rule violation"
})

Parameters

resource: {
channelId: apiTypes.Snowflake?,
durationSeconds: number?,
customMessage: string?,
}

Returns

ActionMetadata