class GuildScheduledEvent
extends
Baseexport class GuildScheduledEvent<Status extends GuildScheduledEventStatus = GuildScheduledEventStatus> extends Base
Represents a scheduled event in a Guild.
Type Parameters
optionalGuildScheduledEventStatus = GuildScheduledEventStatus Status? extends
readonlyVoiceChannel | StageChannel | null channel :
The channel associated with this scheduled event
The channel id in which the scheduled event will be hosted, or null
if entity type is GuildScheduledEventEntityType.External
readonlyDate createdAt :
The time the guild scheduled event was created at
readonlynumber createdTimestamp :
The timestamp the guild scheduled event was created at
GuildScheduledEventEntityMetadata | null entityMetadata :
Additional metadata
GuildScheduledEventEntityType entityType :
The type of hosting entity associated with the scheduled event
Snowflake guildId :
The id of the guild this guild scheduled event belongs to
Snowflake id :
The id of the guild scheduled event
string name :
The name of the guild scheduled event
GuildScheduledEventPrivacyLevel privacyLevel :
The privacy level of the guild scheduled event
The time the guild scheduled event will end at, or null
if the event does not have a scheduled time to end
The timestamp the guild scheduled event will end at or null
if the event does not have a scheduled time to end
The time the guild scheduled event will start at This can be potentially null
only when it's an target
readonlystring url :
The URL to the guild scheduled event
coverImageURLoptions?: Readonly<BaseImageURLOptions>) : string | null (
The URL of this scheduled event's cover image
deletePromise<GuildScheduledEvent<Status>> () :
Deletes this guild scheduled event.
// Delete a guild scheduled event
guildScheduledEvent.delete()
.then(guildScheduledEvent => console.log(guildScheduledEvent))
.catch(console.error);
editAcceptableStatus extends GuildScheduledEventSetStatusArg<Status>
>(options: GuildScheduledEventEditOptions<Status, AcceptableStatus>) : Promise<GuildScheduledEvent<AcceptableStatus>> <
AcceptableStatus extends GuildScheduledEventSetStatusArg<Status>
Edits this guild scheduled event.
// Edit a guild scheduled event
guildScheduledEvent.edit({ name: 'Party' })
.then(guildScheduledEvent => console.log(guildScheduledEvent))
.catch(console.error);
fetchforce?: boolean) : Promise<GuildScheduledEvent<Status>> (
Fetches this guild scheduled event.
fetchSubscribersOptions extends FetchGuildScheduledEventSubscribersOptions
>(options?: Options) : Promise<GuildScheduledEventManagerFetchSubscribersResult<Options>> <
Options extends FetchGuildScheduledEventSubscribersOptions
Fetches subscribers of this guild scheduled event.
isActivethis is GuildScheduledEvent<GuildScheduledEventStatus.Active> () :
Indicates whether this guild scheduled event has an GuildScheduledEventStatus.Active status.
isCanceledthis is GuildScheduledEvent<GuildScheduledEventStatus.Canceled> () :
Indicates whether this guild scheduled event has a GuildScheduledEventStatus.Canceled status.
isCompletedthis is GuildScheduledEvent<GuildScheduledEventStatus.Completed> () :
Indicates whether this guild scheduled event has a GuildScheduledEventStatus.Completed status.
isScheduledthis is GuildScheduledEvent<GuildScheduledEventStatus.Scheduled> () :
Indicates whether this guild scheduled event has a GuildScheduledEventStatus.Scheduled status.
setDescription) : Promise<GuildScheduledEvent<Status>> (
Sets the new description of the guild scheduled event.
// 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);
setLocation) : Promise<GuildScheduledEvent<Status>> (
Sets the new location of the guild scheduled event.
// Set location of a guild scheduled event
guildScheduledEvent.setLocation('Earth')
.then(guildScheduledEvent => console.log(`Set the location to: ${guildScheduledEvent.entityMetadata.location}`))
.catch(console.error);
setName) : Promise<GuildScheduledEvent<Status>> (
Sets a new name for the guild scheduled event.
// Set name of a guild scheduled event
guildScheduledEvent.setName('Birthday Party')
.then(guildScheduledEvent => console.log(`Set the name to: ${guildScheduledEvent.name}`))
.catch(console.error);
setScheduledEndTimescheduledEndTime: DateResolvablereason?: string) : Promise<GuildScheduledEvent<Status>> (
Sets a new time to end the event at.
// 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);
setScheduledStartTimescheduledStartTime: DateResolvablereason?: string) : Promise<GuildScheduledEvent<Status>> (
Sets a new time to schedule the event at.
// 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);
setStatusAcceptableStatus extends GuildScheduledEventSetStatusArg<Status>
>(status: AcceptableStatusreason?: string) : Promise<GuildScheduledEvent<AcceptableStatus>> <
AcceptableStatus extends GuildScheduledEventSetStatusArg<Status>
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 isScheduled to get only valid status as suggestion
// Set status of a guild scheduled event
guildScheduledEvent.setStatus(GuildScheduledEventStatus.Active)
.then(guildScheduledEvent => console.log(`Set the status to: ${guildScheduledEvent.status}`))
.catch(console.error);
toStringstring () :
When concatenated with a string, this automatically concatenates the event's URL instead of the object.
// Logs: Event: https://discord.com/events/412345678901234567/499876543211234567
console.log(`Event: ${guildScheduledEvent}`);