types(GuildScheduledEvent): allow setting null for description

This commit is contained in:
Danial Raza
2026-09-10 11:53:36 +02:00
parent a4116036be
commit 2a73f4e7c4
4 changed files with 14 additions and 4 deletions
@@ -196,7 +196,7 @@ class GuildScheduledEventManager extends CachedManager {
* @property {DateResolvable} [scheduledEndTime] The time to end the event at
* @property {GuildScheduledEventPrivacyLevel} [privacyLevel] The privacy level of the guild scheduled event
* @property {GuildScheduledEventEntityType} [entityType] The scheduled entity type of the event
* @property {string} [description] The description of the guild scheduled event
* @property {?string} [description] The description of the guild scheduled event, or `null` to remove it
* @property {?GuildVoiceChannelResolvable} [channel] The channel of the guild scheduled event
* @property {GuildScheduledEventStatus} [status] The status of the guild scheduled event
* @property {GuildScheduledEventEntityMetadataOptions} [entityMetadata] The entity metadata of the
@@ -470,7 +470,7 @@ class GuildScheduledEvent extends Base {
/**
* Sets the new description of the guild scheduled event.
*
* @param {string} description The description of the guild scheduled event
* @param {?string} description The description of the guild scheduled event, or `null` to remove it
* @param {string} [reason] The reason for changing the description
* @returns {Promise<GuildScheduledEvent>}
* @example
+3 -2
View File
@@ -1817,7 +1817,7 @@ export class GuildScheduledEvent<Status extends GuildScheduledEventStatus = Guil
reason?: string,
): Promise<GuildScheduledEvent<Status>>;
public setScheduledEndTime(scheduledEndTime: DateResolvable, reason?: string): Promise<GuildScheduledEvent<Status>>;
public setDescription(description: string, reason?: string): Promise<GuildScheduledEvent<Status>>;
public setDescription(description: string | null, reason?: string): Promise<GuildScheduledEvent<Status>>;
public setStatus<AcceptableStatus extends GuildScheduledEventSetStatusArg<Status>>(
status: AcceptableStatus,
reason?: string,
@@ -6453,7 +6453,7 @@ export interface GuildListMembersOptions {
export interface BaseGuildScheduledEventOptions {
channel?: GuildVoiceChannelResolvable | null;
description?: string;
description?: string | null;
entityMetadata?: GuildScheduledEventEntityMetadataOptions;
entityType?: GuildScheduledEventEntityType;
image?: Base64Resolvable | BufferResolvable | null;
@@ -6468,6 +6468,7 @@ export interface BaseGuildScheduledEventOptions {
// TODO: use conditional types for better TS support
export interface GuildScheduledEventCreateOptions extends BaseGuildScheduledEventOptions {
channel?: GuildVoiceChannelResolvable;
description?: string;
entityType: GuildScheduledEventEntityType;
name: string;
privacyLevel: GuildScheduledEventPrivacyLevel;
@@ -139,6 +139,7 @@ import type {
GuildMessageManager,
GuildOnboarding,
GuildResolvable,
GuildScheduledEventCreateOptions,
GuildScheduledEventManager,
GuildScheduledEventRecurrenceRuleOptions,
GuildTextBasedChannel,
@@ -2999,6 +3000,14 @@ client.on('interactionCreate', async interaction => {
declare const guildScheduledEventManager: GuildScheduledEventManager;
await guildScheduledEventManager.edit(snowflake, { recurrenceRule: null });
await guildScheduledEventManager.edit(snowflake, { description: null });
{
const event = await guildScheduledEventManager.fetch(snowflake);
await event.setDescription(null);
await event.edit({ description: null });
expectNotAssignable<GuildScheduledEventCreateOptions['description']>(null);
}
{
expectNotAssignable<GuildScheduledEventRecurrenceRuleOptions>({