GuildInviteManager
classe · Source
Manages API methods for GuildInvites and stores their cache.
Extends: CachedManager
Properties
guild
The guild this Manager belongs to Source
cache
The cache of this Manager Source
_cache
The private cache of items for this manager. Source
holds
The data structure belonging to this manager. Source
client
The client that instantiated this Manager Source
Methods
resolve
Resolves an InviteResolvable to an Invite object. Parameters
| Name | Type | Description |
|---|---|---|
invite | InviteResolvable | The invite resolvable to resolve |
Returns: InviteSource
resolveId
Resolves an InviteResolvable to an invite code string. Parameters
| Name | Type | Description |
|---|---|---|
invite | InviteResolvable | The invite resolvable to resolve |
Returns: stringSource
fetch
Fetches invite(s) from Discord. Parameters
| Name | Type | Description |
|---|---|---|
options? | InviteResolvable | FetchInviteOptions | FetchInvitesOptions | Options for fetching guild invite(s) |
Returns: Promise<(Invite\|Collection<string, Invite>)>
// Fetch all invites from a guild
guild.invites.fetch()
.then(console.log)
.catch(console.error);// Fetch all invites from a guild without caching
guild.invites.fetch({ cache: false })
.then(console.log)
.catch(console.error);// Fetch all invites from a channel
guild.invites.fetch({ channelId: '222197033908436994' })
.then(console.log)
.catch(console.error);// Fetch a single invite
guild.invites.fetch('bRCvFy9')
.then(console.log)
.catch(console.error);// Fetch a single invite without checking cache
guild.invites.fetch({ code: 'bRCvFy9', force: true })
.then(console.log)
.catch(console.error)// Fetch a single invite without caching
guild.invites.fetch({ code: 'bRCvFy9', cache: false })
.then(console.log)
.catch(console.error);create
Create an invite to the guild from the provided channel. Parameters
| Name | Type | Description |
|---|---|---|
channel | GuildInvitableChannelResolvable | The options for creating the invite from a channel. |
options? | CreateInviteOptions | The options for creating the invite from a channel. Default: {}. |
Returns: Promise<Invite>
// Create an invite to a selected channel
guild.invites.create('599942732013764608')
.then(console.log)
.catch(console.error);delete
Deletes an invite. Parameters
| Name | Type | Description |
|---|---|---|
invite | InviteResolvable | The invite to delete |
reason? | string | Reason for deleting the invite |
Returns: Promise<void>Source
fetchTargetUsers
Fetches the users allowed to see and accept a targeted invite. Parameters
| Name | Type | Description |
|---|---|---|
invite | InviteResolvable | The invite to fetch target users for |
Returns: Promise<Array<Snowflake>>Source
updateTargetUsers
Replaces the users allowed to see and accept a targeted invite. Parameters
| Name | Type | Description |
|---|---|---|
invite | InviteResolvable | The invite to update |
targetUsersFile | TargetUsersFileResolvable | Target-user CSV file or users |
Returns: Promise<void>Source
fetchTargetUsersJobStatus
Fetches the processing status of a targeted-invite user list. Parameters
| Name | Type | Description |
|---|---|---|
invite | InviteResolvable | The invite to check |
Returns: Promise<InviteTargetUsersJobStatus>Source