Skip to content

WidgetSettings

Implementation of discords WidgetSettings object as a Luau builder.

https://discord.com/developers/docs/resources/guild#guild-widget-settings-object

WidgetSettings.enabled  :: boolean?

Whether the widget is enabled for the guild.

WidgetSettings.channelId  :: string?

The channel id that the widget will generate an invite to.

WidgetSettings : setEnabled ( enabled )  -> WidgetSettings

Set whether the widget is enabled

Parameters

enabled: boolean

Returns

WidgetSettings
WidgetSettings : setChannelId ( channelId )  -> WidgetSettings

Set the widget channel id

Parameters

channelId: string

Returns

WidgetSettings
WidgetSettings : build ( )  -> JSON

Responsible for building the WidgetSettingsObject JSON that can be parsed by the Discord API.

Returns

JSON
WidgetSettings . new ( resource )  -> WidgetSettings

Responsible for creating a new WidgetSettings.

local settings = WidgetSettings.new({
enabled = true,
channelId = "123456789"
})

Parameters

resource: {
enabled: boolean?,
channelId: string?,
}

Returns

WidgetSettings