Skip to content

GuildManager ​

classe · Source

Manages API methods for Guilds and stores their cache.

Extends: CachedManager

Properties ​

cache ​

cache: Collection<Snowflake, Guild>

The cache of this Manager Source

_cache ​

readonly · private

_cache: Collection

The private cache of items for this manager. Source

holds ​

readonly · private

holds: function

The data structure belonging to this manager. Source

client ​

readonly

client: Client

The client that instantiated this Manager Source

Methods ​

resolve ​

resolve(guild: GuildResolvable): Guild

Resolves a GuildResolvable to a Guild object. Parameters

NameTypeDescription
guildGuildResolvableThe guild resolvable to identify

Returns: GuildSource

resolveId ​

resolveId(guild: GuildResolvable): Snowflake

Resolves a GuildResolvable to a Guild id string. Parameters

NameTypeDescription
guildGuildResolvableThe guild resolvable to identify

Returns: SnowflakeSource

create ​

async

async create(name: string, options?: GuildCreateOptions): Promise<Guild>

Creates a guild. This endpoint is no longer part of the public application API. It is retained only for undocumented user-account compatibility and may stop working without notice. Parameters

NameTypeDescription
namestringThe name of the guild
options?GuildCreateOptionsOptions for creating the guild

Returns: Promise<Guild> — The guild that was created Source

fetch ​

async

async fetch(options?: GuildResolvable | FetchGuildOptions | FetchGuildsOptions): Promise<(Guild|Collection<Snowflake, OAuth2Guild>)>

Obtains one or multiple guilds from Discord, or the guild cache if it's already available. Parameters

NameTypeDescription
options?GuildResolvable | FetchGuildOptions | FetchGuildsOptionsThe guild's id or options

Returns: Promise<(Guild\|Collection<Snowflake, OAuth2Guild>)>Source

setIncidentActions ​

async

async setIncidentActions(guild: GuildResolvable, incidentActions: IncidentActionsEditOptions): Promise<IncidentActions>

Sets the incident actions for a guild. Parameters

NameTypeDescription
guildGuildResolvableThe guild
incidentActionsIncidentActionsEditOptionsThe incident actions to set

Returns: Promise<IncidentActions>Source

Unofficial software. Not affiliated with or supported by Discord.