Skip to content

GuildScheduledEvent

classe · Source

Represents a scheduled event in a Guild.

Extends: Base

Properties

id

id: Snowflake

The id of the guild scheduled event Source

guildId

guildId: Snowflake

The id of the guild this guild scheduled event belongs to Source

channelId

nullable

channelId: Snowflake

The channel id in which the scheduled event will be hosted, or null if entity type is EXTERNALSource

creatorId

nullable

creatorId: Snowflake

The id of the user that created this guild scheduled event Source

name

nullable

name: string

The name of the guild scheduled event Source

description

nullable

description: string

The description of the guild scheduled event Source

scheduledStartTimestamp

nullable

scheduledStartTimestamp: number

The timestamp the guild scheduled event will start at This can be potentially null only when it's an AuditLogEntryTargetSource

scheduledEndTimestamp

nullable

scheduledEndTimestamp: number

The timestamp the guild scheduled event will end at or null if the event does not have a scheduled time to end Source

privacyLevel

privacyLevel: PrivacyLevel

The privacy level of the guild scheduled event Source

status

status: GuildScheduledEventStatus

The status of the guild scheduled event Source

entityType

entityType: GuildScheduledEventEntityType

The type of hosting entity associated with the scheduled event Source

entityId

nullable

entityId: Snowflake

The id of the hosting entity associated with the scheduled event Source

userCount

nullable

userCount: number

The number of users who are subscribed to this guild scheduled event Source

creator

nullable

creator: User

The user that created this guild scheduled event Source

entityMetadata

nullable

entityMetadata: GuildScheduledEventEntityMetadata

Additional metadata Source

image

nullable

image: string

The cover image hash for this scheduled event Source

recurrenceRule

nullable

recurrenceRule: GuildScheduledEventRecurrenceRule

The recurrence rule for this scheduled event Source

partial

readonly

partial: boolean

Whether this guild scheduled event is partial. Source

createdTimestamp

readonly

createdTimestamp: number

The timestamp the guild scheduled event was created at Source

createdAt

readonly

createdAt: Date

The time the guild scheduled event was created at Source

scheduledStartAt

readonly

scheduledStartAt: Date

The time the guild scheduled event will start at Source

scheduledEndAt

readonly · nullable

scheduledEndAt: Date

The time the guild scheduled event will end at, or null if the event does not have a scheduled time to end Source

channel

readonly · nullable

channel: VoiceChannel | StageChannel

The channel associated with this scheduled event Source

guild

readonly · nullable

guild: Guild

The guild this scheduled event belongs to Source

url

readonly

url: string

The URL to the guild scheduled event Source

client

readonly

client: Client

The client that instantiated this Source

Methods

coverImageURL

coverImageURL(options?: StaticImageURLOptions): string

The URL of this scheduled event's cover image Parameters

NameTypeDescription
options?StaticImageURLOptionsOptions for image URL Default: {}.

Returns: stringSource

fetch

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

Fetches this guild scheduled event. Parameters

NameTypeDescription
force?booleanWhether to skip the cache check and request the API Default: true.

Returns: Promise<GuildScheduledEvent>Source

createInviteURL

async

async createInviteURL(options?: CreateGuildScheduledEventInviteURLOptions): Promise<string>

Creates an invite URL to this guild scheduled event. Parameters

NameTypeDescription
options?CreateGuildScheduledEventInviteURLOptionsThe options to create the invite

Returns: Promise<string>Source

edit

edit(options: GuildScheduledEventEditOptions): Promise<GuildScheduledEvent>

Edits this guild scheduled event. Parameters

NameTypeDescription
optionsGuildScheduledEventEditOptionsThe options to edit the guild scheduled event

Returns: Promise<GuildScheduledEvent>

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

Source

delete

async

async delete(): Promise<GuildScheduledEvent>

Deletes this guild scheduled event. Returns: Promise<GuildScheduledEvent>

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

Source

setName

setName(name: string, reason?: string): Promise<GuildScheduledEvent>

Sets a new name for the guild scheduled event. Parameters

NameTypeDescription
namestringThe new name of the guild scheduled event
reason?stringThe reason for changing the name

Returns: Promise<GuildScheduledEvent>

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

Source

setScheduledStartTime

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

Sets a new time to schedule the event at. Parameters

NameTypeDescription
scheduledStartTimeDateResolvableThe time to schedule the event at
reason?stringThe reason for changing the scheduled start time

Returns: Promise<GuildScheduledEvent>

js
// 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);

Source

setScheduledEndTime

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

Sets a new time to end the event at. Parameters

NameTypeDescription
scheduledEndTimeDateResolvableThe time to end the event at
reason?stringThe reason for changing the scheduled end time

Returns: Promise<GuildScheduledEvent>

js
// 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);

Source

setDescription

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

Sets the new description of the guild scheduled event. Parameters

NameTypeDescription
descriptionstringThe description of the guild scheduled event
reason?stringThe reason for changing the description

Returns: Promise<GuildScheduledEvent>

js
// 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);

Source

setStatus

setStatus(status: GuildScheduledEventStatus | number, reason?: string): Promise<GuildScheduledEvent>

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

NameTypeDescription
statusGuildScheduledEventStatus | numberThe status of the guild scheduled event
reason?stringThe reason for changing the status

Returns: Promise<GuildScheduledEvent>

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

Source

setLocation

setLocation(location: string, reason?: string): Promise<GuildScheduledEvent>

Sets the new location of the guild scheduled event. Parameters

NameTypeDescription
locationstringThe location of the guild scheduled event
reason?stringThe reason for changing the location

Returns: Promise<GuildScheduledEvent>

js
// Set location of a guild scheduled event
guildScheduledEvent.setLocation('Earth')
 .then(guildScheduledEvent => console.log(`Set the location to: ${guildScheduledEvent.entityMetadata.location}`))
 .catch(console.error);

Source

fetchSubscribers

fetchSubscribers(options?: FetchGuildScheduledEventSubscribersOptions): Promise<Collection<Snowflake, GuildScheduledEventUser>>

Fetches subscribers of this guild scheduled event. Parameters

NameTypeDescription
options?FetchGuildScheduledEventSubscribersOptionsOptions for fetching the subscribers

Returns: Promise<Collection<Snowflake, GuildScheduledEventUser>>Source

toString

toString(): string

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

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

Source

isActive

isActive(): boolean

Indicates whether this guild scheduled event has an ACTIVE status. Returns: booleanSource

isCanceled

isCanceled(): boolean

Indicates whether this guild scheduled event has a CANCELED status. Returns: booleanSource

isCompleted

isCompleted(): boolean

Indicates whether this guild scheduled event has a COMPLETED status. Returns: booleanSource

isScheduled

isScheduled(): boolean

Indicates whether this guild scheduled event has a SCHEDULED status. Returns: booleanSource

Unofficial software. Not affiliated with or supported by Discord.