Skip to content

GuildWidgetSettings

GuildWidgetSettings ⇐ Base

Represents the settings for a guild widget.

Kind: global class
Extends: Base

new GuildWidgetSettings([data], guildId, client)

Constructs a new instance of the class.

ParamTypeDescription
[data]ObjectThe data for the guild widget settings.
guildIdstringThe ID of the guild.
clientClientThe client instance.

guildWidgetSettings.guild ⇒

Retrieves the guild associated with this guildId.

Kind: instance property of GuildWidgetSettings
Returns: The guild object if found, otherwise null.

guildWidgetSettings.channel ⇒ Channel | null

Retrieves the channel object associated with this instance.

Kind: instance property of GuildWidgetSettings
Returns: Channel | null - The channel object, or null if it does not exist.

guildWidgetSettings.edit(options) ⇒ Promise

Edits the guild’s widget with the given options.

Kind: instance method of GuildWidgetSettings
Returns: Promise - A promise that resolves when the widget is successfully edited.

ParamTypeDescription
optionsObjectThe options to edit the widget with.

guildWidgetSettings.setEnabled(enabled, reason) ⇒ Promise

Sets the enabled status of an item and provides a reason for the change.

Kind: instance method of GuildWidgetSettings
Returns: Promise - - A promise that resolves when the edit is complete.

ParamTypeDescription
enabledbooleanThe new enabled status of the item.
reasonstringThe reason for the change in enabled status.

guildWidgetSettings.setChannel(channel, reason) ⇒ Promise.<void>

Sets the channel for the current object and updates it with the given reason.

Kind: instance method of GuildWidgetSettings
Returns: Promise.<void> - - A promise that resolves when the channel is successfully set.

ParamTypeDescription
channelChannelThe channel to set.
reasonstringThe reason for setting the channel.