GuildWidgetSettings
GuildWidgetSettings ⇐ Base
Represents the settings for a guild widget.
Kind: global class
Extends: Base
- GuildWidgetSettings ⇐
Base
- new GuildWidgetSettings([data], guildId, client)
- .guild ⇒
- .channel ⇒
Channel
|null
- .edit(options) ⇒
Promise
- .setEnabled(enabled, reason) ⇒
Promise
- .setChannel(channel, reason) ⇒
Promise.<void>
new GuildWidgetSettings([data], guildId, client)
Constructs a new instance of the class.
Param | Type | Description |
---|---|---|
[data] | Object | The data for the guild widget settings. |
guildId | string | The ID of the guild. |
client | Client | The 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.
Param | Type | Description |
---|---|---|
options | Object | The 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.
Param | Type | Description |
---|---|---|
enabled | boolean | The new enabled status of the item. |
reason | string | The 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.
Param | Type | Description |
---|---|---|
channel | Channel | The channel to set. |
reason | string | The reason for setting the channel. |