GuildScheduledEvent

export class GuildScheduledEvent<Status extends GuildScheduledEventStatus = GuildScheduledEventStatus> extends Base
export class GuildScheduledEvent<Status extends GuildScheduledEventStatus = GuildScheduledEventStatus> extends Base
Represents a scheduled event in a Guild.

Extends

Base
NameConstraintsOptionalDefaultDescription
StatusGuildScheduledEventStatusYesGuildScheduledEventStatusNone
Readonly
The channel associated with this scheduled event
channelId:Snowflake | null
The channel id in which the scheduled event will be hosted, or null if entity type is GuildScheduledEventEntityType.External
Readonly
client:Client<true>
The client that instantiated this
Inherited from Base
Readonly
createdAt:Date
The time the guild scheduled event was created at
Readonly
createdTimestamp:number
The timestamp the guild scheduled event was created at
creator:User | null
The user that created this guild scheduled event
creatorId:Snowflake | null
The id of the user that created this guild scheduled event
description:string | null
The description of the guild scheduled event
entityId:Snowflake | null
The id of the hosting entity associated with the scheduled event
Additional metadata
The type of hosting entity associated with the scheduled event
Readonly
guild:Guild | null
The guild this scheduled event belongs to
guildId:Snowflake
The id of the guild this guild scheduled event belongs to
The id of the guild scheduled event
image:string | null
The cover image hash for this scheduled event
name:string
The name of the guild scheduled event
Readonly
partial:false
Whether this guild scheduled event is partial.
The privacy level of the guild scheduled event
The recurrence rule for this scheduled event
Readonly
scheduledEndAt:Date | null
The time the guild scheduled event will end at, or null if the event does not have a scheduled time to end
scheduledEndTimestamp:number | null
The timestamp the guild scheduled event will end at or null if the event does not have a scheduled time to end
Readonly
scheduledStartAt:Date | null
The time the guild scheduled event will start at This can be potentially null only when it's an target
scheduledStartTimestamp:number | null
The timestamp the guild scheduled event will start at
status:Status
The status of the guild scheduled event
Readonly
url:string
The URL to the guild scheduled event
userCount:number | null
The number of users who are subscribed to this guild scheduled event
coverImageURL(options?):string | null
The URL of this scheduled event's cover image
Returns
NameTypeOptionalDescription
optionsReadonly<BaseImageURLOptions>YesOptions for image URL
createInviteURL(options?):Promise<string>
Creates an invite URL to this guild scheduled event.
NameTypeOptionalDescription
optionsGuildScheduledEventInviteURLCreateOptionsYesThe options to create the invite
delete():Promise<GuildScheduledEvent<Status>>
Deletes this guild scheduled event.
Example
// Delete a guild scheduled event
guildScheduledEvent.delete()
.then(guildScheduledEvent => console.log(guildScheduledEvent))
.catch(console.error);
// Delete a guild scheduled event
guildScheduledEvent.delete()
.then(guildScheduledEvent => console.log(guildScheduledEvent))
.catch(console.error);
edit(options):Promise<GuildScheduledEvent<AcceptableStatus>>
Edits this guild scheduled event.
Example
// Edit a guild scheduled event
guildScheduledEvent.edit({ name: 'Party' })
.then(guildScheduledEvent => console.log(guildScheduledEvent))
.catch(console.error);
// Edit a guild scheduled event
guildScheduledEvent.edit({ name: 'Party' })
.then(guildScheduledEvent => console.log(guildScheduledEvent))
.catch(console.error);
NameTypeOptionalDescription
optionsGuildScheduledEventEditOptions<Status, AcceptableStatus>NoThe options to edit the guild scheduled event
fetch(force?):Promise<GuildScheduledEvent<Status>>
Fetches this guild scheduled event.
NameTypeOptionalDescription
forcebooleanYesWhether to skip the cache check and request the API
fetchSubscribers(options?):Promise<GuildScheduledEventManagerFetchSubscribersResult<Options>>
Fetches subscribers of this guild scheduled event.
NameTypeOptionalDescription
optionsOptionsYesOptions for fetching the subscribers
Indicates whether this guild scheduled event has an GuildScheduledEventStatus.Active status.
Indicates whether this guild scheduled event has a GuildScheduledEventStatus.Canceled status.
Indicates whether this guild scheduled event has a GuildScheduledEventStatus.Completed status.
Indicates whether this guild scheduled event has a GuildScheduledEventStatus.Scheduled status.
setDescription(description, reason?):Promise<GuildScheduledEvent<Status>>
Sets the new description of the guild scheduled event.
Example
// 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);
// 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);
NameTypeOptionalDescription
descriptionstringNoThe description of the guild scheduled event
reasonstringYesThe reason for changing the description
setLocation(location, reason?):Promise<GuildScheduledEvent<Status>>
Sets the new location of the guild scheduled event.
Example
// Set location of a guild scheduled event
guildScheduledEvent.setLocation('Earth')
.then(guildScheduledEvent => console.log(`Set the location to: ${guildScheduledEvent.entityMetadata.location}`))
.catch(console.error);
// Set location of a guild scheduled event
guildScheduledEvent.setLocation('Earth')
.then(guildScheduledEvent => console.log(`Set the location to: ${guildScheduledEvent.entityMetadata.location}`))
.catch(console.error);
NameTypeOptionalDescription
locationstringNoThe location of the guild scheduled event
reasonstringYesThe reason for changing the location
setName(name, reason?):Promise<GuildScheduledEvent<Status>>
Sets a new name for the guild scheduled event.
Example
// Set name of a guild scheduled event
guildScheduledEvent.setName('Birthday Party')
.then(guildScheduledEvent => console.log(`Set the name to: ${guildScheduledEvent.name}`))
.catch(console.error);
// Set name of a guild scheduled event
guildScheduledEvent.setName('Birthday Party')
.then(guildScheduledEvent => console.log(`Set the name to: ${guildScheduledEvent.name}`))
.catch(console.error);
NameTypeOptionalDescription
namestringNoThe new name of the guild scheduled event
reasonstringYesThe reason for changing the name
setScheduledEndTime(scheduledEndTime, reason?):Promise<GuildScheduledEvent<Status>>
Sets a new time to end the event at.
Example
// 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);
// 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);
NameTypeOptionalDescription
scheduledEndTimeDateResolvableNoThe time to end the event at
reasonstringYesThe reason for changing the scheduled end time
setScheduledStartTime(scheduledStartTime, reason?):Promise<GuildScheduledEvent<Status>>
Sets a new time to schedule the event at.
Example
// 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);
// 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);
NameTypeOptionalDescription
scheduledStartTimeDateResolvableNoThe time to schedule the event at
reasonstringYesThe reason for changing the scheduled start time
setStatus(status, reason?):Promise<GuildScheduledEvent<AcceptableStatus>>
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
Example
// Set status of a guild scheduled event
guildScheduledEvent.setStatus(GuildScheduledEventStatus.Active)
.then(guildScheduledEvent => console.log(`Set the status to: ${guildScheduledEvent.status}`))
.catch(console.error);
// Set status of a guild scheduled event
guildScheduledEvent.setStatus(GuildScheduledEventStatus.Active)
.then(guildScheduledEvent => console.log(`Set the status to: ${guildScheduledEvent.status}`))
.catch(console.error);
NameTypeOptionalDescription
statusAcceptableStatusNoThe status of the guild scheduled event
reasonstringYesThe reason for changing the status
toJSON(...props):unknown
NameTypeOptionalDescription
...propsRecord<string, boolean | string>[]NoNone
Inherited from Base
toString():string
When concatenated with a string, this automatically concatenates the event's URL instead of the object.
Example
// Logs: Event: https://discord.com/events/412345678901234567/499876543211234567
console.log(`Event: ${guildScheduledEvent}`);
// Logs: Event: https://discord.com/events/412345678901234567/499876543211234567
console.log(`Event: ${guildScheduledEvent}`);
valueOf():string