Preview deployment

class GuildScheduledEvent

extends

Base
export class GuildScheduledEvent<Status extends GuildScheduledEventStatus = GuildScheduledEventStatus> extends Base

Represents a scheduled event in a Guild.

Type Parameters

readonly
channel : VoiceChannel | StageChannel | null

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

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

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() : string | null

The URL of this scheduled event's cover image

Creates an invite URL to this guild scheduled event.

delete() : Promise<GuildScheduledEvent<Status>>

Deletes this guild scheduled event.

Examples:
// Delete a guild scheduled event
guildScheduledEvent.delete()
 .then(guildScheduledEvent => console.log(guildScheduledEvent))
 .catch(console.error);

edit<

AcceptableStatus extends GuildScheduledEventSetStatusArg<Status>

>(
options: GuildScheduledEventEditOptions<Status, AcceptableStatus>
) : Promise<GuildScheduledEvent<AcceptableStatus>>

Edits this guild scheduled event.

Examples:
// Edit a guild scheduled event
guildScheduledEvent.edit({ name: 'Party' })
 .then(guildScheduledEvent => console.log(guildScheduledEvent))
 .catch(console.error);

fetch(
force?: boolean
) : Promise<GuildScheduledEvent<Status>>

Fetches this guild scheduled event.

fetchSubscribers<>(
options?: Options
) : Promise<GuildScheduledEventManagerFetchSubscribersResult<Options>>

Fetches subscribers of this guild scheduled event.

Indicates whether this guild scheduled event has an GuildScheduledEventStatus status.

Indicates whether this guild scheduled event has a GuildScheduledEventStatus status.

Indicates whether this guild scheduled event has a GuildScheduledEventStatus status.

Indicates whether this guild scheduled event has a GuildScheduledEventStatus status.

setDescription(
description: string
reason?: string
) : Promise<GuildScheduledEvent<Status>>

Sets the new description of the guild scheduled event.

Examples:
// 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(
location: string
reason?: string
) : Promise<GuildScheduledEvent<Status>>

Sets the new location of the guild scheduled event.

Examples:
// 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(
name: string
reason?: string
) : Promise<GuildScheduledEvent<Status>>

Sets a new name for the guild scheduled event.

Examples:
// Set name of a guild scheduled event
guildScheduledEvent.setName('Birthday Party')
 .then(guildScheduledEvent => console.log(`Set the name to: ${guildScheduledEvent.name}`))
 .catch(console.error);

setScheduledEndTime(
scheduledEndTime: DateResolvable
reason?: string
) : Promise<GuildScheduledEvent<Status>>

Sets a new time to end the event at.

Examples:
// 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);

setScheduledStartTime(
scheduledStartTime: DateResolvable
reason?: string
) : Promise<GuildScheduledEvent<Status>>

Sets a new time to schedule the event at.

Examples:
// 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);

setStatus<

AcceptableStatus extends GuildScheduledEventSetStatusArg<Status>

>(
status: AcceptableStatus
reason?: string
) : 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

Examples:
// Set status of a guild scheduled event
guildScheduledEvent.setStatus(GuildScheduledEventStatus.Active)
 .then(guildScheduledEvent => console.log(`Set the status to: ${guildScheduledEvent.status}`))
 .catch(console.error);

toJSON(
...props: Record<string, boolean | string>[]
) : unknown

Inherited from: Base

toString() : string

When concatenated with a string, this automatically concatenates the event's URL instead of the object.

Examples:
// Logs: Event: https://discord.com/events/412345678901234567/499876543211234567
console.log(`Event: ${guildScheduledEvent}`);

valueOf() : string

Inherited from: Base