Skip to content

GuildWidgetManager

GuildWidgetManager ⇐ Base

Represents a manager for guild widget settings.

Kind: global class
Extends: Base

new GuildWidgetManager(guildId, client)

Constructs a new instance of the class.

ParamTypeDescription
guildIdstringThe ID of the guild.
clientClientThe 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.

ParamTypeDescription
[options]ObjectThe options for editing the guild widget settings.
[options.reason]stringThe 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.
ParamTypeDescription
oObjectThe options object to transform.