GuildWidgetManager
GuildWidgetManager ⇐ Base
Represents a manager for guild widget settings.
Kind: global class
Extends: Base
- GuildWidgetManager ⇐
Base
- new GuildWidgetManager(guildId, client)
- instance
- .fetchSettings() ⇒
Promise.<GuildWidgetSettings>
- .fetch() ⇒
Promise.<GuildWidget>
- .edit([options]) ⇒
Promise.<GuildWidgetSettings>
- .fetchSettings() ⇒
- static
- .transformOptions(o) ⇒
Object
- .transformOptions(o) ⇒
new GuildWidgetManager(guildId, client)
Constructs a new instance of the class.
Param | Type | Description |
---|---|---|
guildId | string | The ID of the guild. |
client | Client | The client object. |
guildWidgetManager.fetchSettings() ⇒ Promise.<GuildWidgetSettings>
Fetches the widget settings for the guild.
Kind: instance method of GuildWidgetManager
Returns: Promise.<GuildWidgetSettings>
- - A promise that resolves to an instance of GuildWidgetSettings.
guildWidgetManager.fetch() ⇒ Promise.<GuildWidget>
Fetches the guild widget data for the current guild.
Kind: instance method of GuildWidgetManager
Returns: Promise.<GuildWidget>
- A promise that resolves to a GuildWidget object representing the guild widget data.
guildWidgetManager.edit([options]) ⇒ Promise.<GuildWidgetSettings>
Edits the guild widget settings with the provided options.
Kind: instance method of GuildWidgetManager
Returns: Promise.<GuildWidgetSettings>
- A promise that resolves with the updated guild widget settings.
Param | Type | Description |
---|---|---|
[options] | Object | The options for editing the guild widget settings. |
[options.reason] | string | The reason for the edit. |
GuildWidgetManager.transformOptions(o) ⇒ Object
Transforms the given options object into a new object with specific properties.
Kind: static method of GuildWidgetManager
Returns: Object
- - The transformed object with the following properties:
- enabled: A boolean indicating whether the option is enabled.
- channel_id: A string representing the channel ID, or null if not provided.
Param | Type | Description |
---|---|---|
o | Object | The options object to transform. |