GuildScheduledEvent
classe · Source
Represents a scheduled event in a Guild.
Extends: Base
Properties
id
The id of the guild scheduled event Source
guildId
The id of the guild this guild scheduled event belongs to Source
channelId
The channel id in which the scheduled event will be hosted, or null if entity type is EXTERNALSource
creatorId
The id of the user that created this guild scheduled event Source
name
The name of the guild scheduled event Source
description
The description of the guild scheduled event Source
scheduledStartTimestamp
The timestamp the guild scheduled event will start at This can be potentially null only when it's an AuditLogEntryTargetSource
scheduledEndTimestamp
The timestamp the guild scheduled event will end at or null if the event does not have a scheduled time to end Source
privacyLevel
The privacy level of the guild scheduled event Source
status
The status of the guild scheduled event Source
entityType
The type of hosting entity associated with the scheduled event Source
entityId
The id of the hosting entity associated with the scheduled event Source
userCount
The number of users who are subscribed to this guild scheduled event Source
creator
The user that created this guild scheduled event Source
entityMetadata
Additional metadata Source
image
The cover image hash for this scheduled event Source
recurrenceRule
The recurrence rule for this scheduled event Source
partial
Whether this guild scheduled event is partial. Source
createdTimestamp
The timestamp the guild scheduled event was created at Source
createdAt
The time the guild scheduled event was created at Source
scheduledStartAt
The time the guild scheduled event will start at Source
scheduledEndAt
The time the guild scheduled event will end at, or null if the event does not have a scheduled time to end Source
channel
The channel associated with this scheduled event Source
guild
The guild this scheduled event belongs to Source
url
The URL to the guild scheduled event Source
client
The client that instantiated this Source
Methods
coverImageURL
The URL of this scheduled event's cover image Parameters
| Name | Type | Description |
|---|---|---|
options? | StaticImageURLOptions | Options for image URL Default: {}. |
Returns: stringSource
fetch
Fetches this guild scheduled event. Parameters
| Name | Type | Description |
|---|---|---|
force? | boolean | Whether to skip the cache check and request the API Default: true. |
Returns: Promise<GuildScheduledEvent>Source
createInviteURL
Creates an invite URL to this guild scheduled event. Parameters
| Name | Type | Description |
|---|---|---|
options? | CreateGuildScheduledEventInviteURLOptions | The options to create the invite |
Returns: Promise<string>Source
edit
Edits this guild scheduled event. Parameters
| Name | Type | Description |
|---|---|---|
options | GuildScheduledEventEditOptions | The options to edit the guild scheduled event |
Returns: Promise<GuildScheduledEvent>
// Edit a guild scheduled event
guildScheduledEvent.edit({ name: 'Party' })
.then(guildScheduledEvent => console.log(guildScheduledEvent))
.catch(console.error);delete
Deletes this guild scheduled event. Returns: Promise<GuildScheduledEvent>
// Delete a guild scheduled event
guildScheduledEvent.delete()
.then(guildScheduledEvent => console.log(guildScheduledEvent))
.catch(console.error);setName
Sets a new name for the guild scheduled event. Parameters
| Name | Type | Description |
|---|---|---|
name | string | The new name of the guild scheduled event |
reason? | string | The reason for changing the name |
Returns: Promise<GuildScheduledEvent>
// Set name of a guild scheduled event
guildScheduledEvent.setName('Birthday Party')
.then(guildScheduledEvent => console.log(`Set the name to: ${guildScheduledEvent.name}`))
.catch(console.error);setScheduledStartTime
Sets a new time to schedule the event at. Parameters
| Name | Type | Description |
|---|---|---|
scheduledStartTime | DateResolvable | The time to schedule the event at |
reason? | string | The reason for changing the scheduled start time |
Returns: Promise<GuildScheduledEvent>
// Set start time of a guild scheduled event
guildScheduledEvent.setScheduledStartTime('2022-09-24T00:00:00+05:30')
.then(guildScheduledEvent => console.log(`Set the start time to: ${guildScheduledEvent.scheduledStartTime}`))
.catch(console.error);setScheduledEndTime
Sets a new time to end the event at. Parameters
| Name | Type | Description |
|---|---|---|
scheduledEndTime | DateResolvable | The time to end the event at |
reason? | string | The reason for changing the scheduled end time |
Returns: Promise<GuildScheduledEvent>
// Set end time of a guild scheduled event
guildScheduledEvent.setScheduledEndTime('2022-09-25T00:00:00+05:30')
.then(guildScheduledEvent => console.log(`Set the end time to: ${guildScheduledEvent.scheduledEndTime}`))
.catch(console.error);setDescription
Sets the new description of the guild scheduled event. Parameters
| Name | Type | Description |
|---|---|---|
description | string | The description of the guild scheduled event |
reason? | string | The reason for changing the description |
Returns: Promise<GuildScheduledEvent>
// Set description of a guild scheduled event
guildScheduledEvent.setDescription('A virtual birthday party')
.then(guildScheduledEvent => console.log(`Set the description to: ${guildScheduledEvent.description}`))
.catch(console.error);setStatus
Sets the new status of the guild scheduled event. If you're working with TypeScript, use this method in conjunction with status type-guards like GuildScheduledEvent#isScheduled to get only valid status as suggestion Parameters
| Name | Type | Description |
|---|---|---|
status | GuildScheduledEventStatus | number | The status of the guild scheduled event |
reason? | string | The reason for changing the status |
Returns: Promise<GuildScheduledEvent>
// Set status of a guild scheduled event
guildScheduledEvent.setStatus('ACTIVE')
.then(guildScheduledEvent => console.log(`Set the status to: ${guildScheduledEvent.status}`))
.catch(console.error);setLocation
Sets the new location of the guild scheduled event. Parameters
| Name | Type | Description |
|---|---|---|
location | string | The location of the guild scheduled event |
reason? | string | The reason for changing the location |
Returns: Promise<GuildScheduledEvent>
// Set location of a guild scheduled event
guildScheduledEvent.setLocation('Earth')
.then(guildScheduledEvent => console.log(`Set the location to: ${guildScheduledEvent.entityMetadata.location}`))
.catch(console.error);fetchSubscribers
Fetches subscribers of this guild scheduled event. Parameters
| Name | Type | Description |
|---|---|---|
options? | FetchGuildScheduledEventSubscribersOptions | Options for fetching the subscribers |
Returns: Promise<Collection<Snowflake, GuildScheduledEventUser>>Source
toString
When concatenated with a string, this automatically concatenates the event's URL instead of the object. Returns: string
// Logs: Event: https://discord.com/events/412345678901234567/499876543211234567
console.log(`Event: ${guildScheduledEvent}`);isActive
Indicates whether this guild scheduled event has an ACTIVE status. Returns: booleanSource
isCanceled
Indicates whether this guild scheduled event has a CANCELED status. Returns: booleanSource
isCompleted
Indicates whether this guild scheduled event has a COMPLETED status. Returns: booleanSource
isScheduled
Indicates whether this guild scheduled event has a SCHEDULED status. Returns: booleanSource