mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
types: use GuildFeature enum from discord-api-types (#7397)
This commit is contained in:
@@ -161,6 +161,7 @@ exports.ButtonStyle = require('discord-api-types/v9').ButtonStyle;
|
|||||||
exports.ChannelType = require('discord-api-types/v9').ChannelType;
|
exports.ChannelType = require('discord-api-types/v9').ChannelType;
|
||||||
exports.ComponentType = require('discord-api-types/v9').ComponentType;
|
exports.ComponentType = require('discord-api-types/v9').ComponentType;
|
||||||
exports.GatewayIntentBits = require('discord-api-types/v9').GatewayIntentBits;
|
exports.GatewayIntentBits = require('discord-api-types/v9').GatewayIntentBits;
|
||||||
|
exports.GuildFeature = require('discord-api-types/v9').GuildFeature;
|
||||||
exports.GuildMFALevel = require('discord-api-types/v9').GuildMFALevel;
|
exports.GuildMFALevel = require('discord-api-types/v9').GuildMFALevel;
|
||||||
exports.GuildNSFWLevel = require('discord-api-types/v9').GuildNSFWLevel;
|
exports.GuildNSFWLevel = require('discord-api-types/v9').GuildNSFWLevel;
|
||||||
exports.GuildPremiumTier = require('discord-api-types/v9').GuildPremiumTier;
|
exports.GuildPremiumTier = require('discord-api-types/v9').GuildPremiumTier;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class BaseGuild extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of features available to this guild
|
* An array of features available to this guild
|
||||||
* @type {Features[]}
|
* @type {GuildFeature[]}
|
||||||
*/
|
*/
|
||||||
this.features = data.features;
|
this.features = data.features;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,34 +169,6 @@ class Guild extends AnonymousGuild {
|
|||||||
this.premiumProgressBarEnabled = data.premium_progress_bar_enabled;
|
this.premiumProgressBarEnabled = data.premium_progress_bar_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* An array of enabled guild features, here are the possible values:
|
|
||||||
* * ANIMATED_ICON
|
|
||||||
* * BANNER
|
|
||||||
* * COMMERCE
|
|
||||||
* * COMMUNITY
|
|
||||||
* * DISCOVERABLE
|
|
||||||
* * FEATURABLE
|
|
||||||
* * INVITE_SPLASH
|
|
||||||
* * MEMBER_VERIFICATION_GATE_ENABLED
|
|
||||||
* * NEWS
|
|
||||||
* * PARTNERED
|
|
||||||
* * PREVIEW_ENABLED
|
|
||||||
* * VANITY_URL
|
|
||||||
* * VERIFIED
|
|
||||||
* * VIP_REGIONS
|
|
||||||
* * WELCOME_SCREEN_ENABLED
|
|
||||||
* * TICKETED_EVENTS_ENABLED
|
|
||||||
* * MONETIZATION_ENABLED
|
|
||||||
* * MORE_STICKERS
|
|
||||||
* * THREE_DAY_THREAD_ARCHIVE
|
|
||||||
* * SEVEN_DAY_THREAD_ARCHIVE
|
|
||||||
* * PRIVATE_THREADS
|
|
||||||
* * ROLE_ICONS
|
|
||||||
* @typedef {string} Features
|
|
||||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-features}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ('application_id' in data) {
|
if ('application_id' in data) {
|
||||||
/**
|
/**
|
||||||
* The id of the application that created this guild (if applicable)
|
* The id of the application that created this guild (if applicable)
|
||||||
@@ -789,7 +761,7 @@ class Guild extends AnonymousGuild {
|
|||||||
* @property {string} [preferredLocale] The preferred locale of the guild
|
* @property {string} [preferredLocale] The preferred locale of the guild
|
||||||
* @property {boolean} [premiumProgressBarEnabled] Whether the guild's premium progress bar is enabled
|
* @property {boolean} [premiumProgressBarEnabled] Whether the guild's premium progress bar is enabled
|
||||||
* @property {string} [description] The discovery description of the guild
|
* @property {string} [description] The discovery description of the guild
|
||||||
* @property {Features[]} [features] The features of the guild
|
* @property {GuildFeature[]} [features] The features of the guild
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class GuildPreview extends Base {
|
|||||||
if ('features' in data) {
|
if ('features' in data) {
|
||||||
/**
|
/**
|
||||||
* An array of enabled guild features
|
* An array of enabled guild features
|
||||||
* @type {Features[]}
|
* @type {GuildFeature[]}
|
||||||
*/
|
*/
|
||||||
this.features = data.features;
|
this.features = data.features;
|
||||||
}
|
}
|
||||||
|
|||||||
32
packages/discord.js/typings/index.d.ts
vendored
32
packages/discord.js/typings/index.d.ts
vendored
@@ -54,6 +54,7 @@ import {
|
|||||||
ComponentType,
|
ComponentType,
|
||||||
GatewayVoiceServerUpdateDispatchData,
|
GatewayVoiceServerUpdateDispatchData,
|
||||||
GatewayVoiceStateUpdateDispatchData,
|
GatewayVoiceStateUpdateDispatchData,
|
||||||
|
GuildFeature,
|
||||||
GuildMFALevel,
|
GuildMFALevel,
|
||||||
GuildNSFWLevel,
|
GuildNSFWLevel,
|
||||||
GuildPremiumTier,
|
GuildPremiumTier,
|
||||||
@@ -355,7 +356,7 @@ export abstract class BaseGuild extends Base {
|
|||||||
protected constructor(client: Client, data: RawBaseGuildData);
|
protected constructor(client: Client, data: RawBaseGuildData);
|
||||||
public readonly createdAt: Date;
|
public readonly createdAt: Date;
|
||||||
public readonly createdTimestamp: number;
|
public readonly createdTimestamp: number;
|
||||||
public features: GuildFeatures[];
|
public features: GuildFeature[];
|
||||||
public icon: string | null;
|
public icon: string | null;
|
||||||
public id: Snowflake;
|
public id: Snowflake;
|
||||||
public name: string;
|
public name: string;
|
||||||
@@ -1137,7 +1138,7 @@ export class GuildPreview extends Base {
|
|||||||
public discoverySplash: string | null;
|
public discoverySplash: string | null;
|
||||||
public emojis: Collection<Snowflake, GuildPreviewEmoji>;
|
public emojis: Collection<Snowflake, GuildPreviewEmoji>;
|
||||||
public stickers: Collection<Snowflake, Sticker>;
|
public stickers: Collection<Snowflake, Sticker>;
|
||||||
public features: GuildFeatures[];
|
public features: GuildFeature[];
|
||||||
public icon: string | null;
|
public icon: string | null;
|
||||||
public id: Snowflake;
|
public id: Snowflake;
|
||||||
public name: string;
|
public name: string;
|
||||||
@@ -4281,7 +4282,7 @@ export interface GuildEditData {
|
|||||||
preferredLocale?: string;
|
preferredLocale?: string;
|
||||||
premiumProgressBarEnabled?: boolean;
|
premiumProgressBarEnabled?: boolean;
|
||||||
description?: string | null;
|
description?: string | null;
|
||||||
features?: GuildFeatures[];
|
features?: GuildFeature[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GuildEmojiCreateOptions {
|
export interface GuildEmojiCreateOptions {
|
||||||
@@ -4305,30 +4306,6 @@ export interface GuildStickerEditData {
|
|||||||
tags?: string;
|
tags?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GuildFeatures =
|
|
||||||
| 'ANIMATED_ICON'
|
|
||||||
| 'BANNER'
|
|
||||||
| 'COMMERCE'
|
|
||||||
| 'COMMUNITY'
|
|
||||||
| 'DISCOVERABLE'
|
|
||||||
| 'FEATURABLE'
|
|
||||||
| 'INVITE_SPLASH'
|
|
||||||
| 'MEMBER_VERIFICATION_GATE_ENABLED'
|
|
||||||
| 'NEWS'
|
|
||||||
| 'PARTNERED'
|
|
||||||
| 'PREVIEW_ENABLED'
|
|
||||||
| 'VANITY_URL'
|
|
||||||
| 'VERIFIED'
|
|
||||||
| 'VIP_REGIONS'
|
|
||||||
| 'WELCOME_SCREEN_ENABLED'
|
|
||||||
| 'TICKETED_EVENTS_ENABLED'
|
|
||||||
| 'MONETIZATION_ENABLED'
|
|
||||||
| 'MORE_STICKERS'
|
|
||||||
| 'THREE_DAY_THREAD_ARCHIVE'
|
|
||||||
| 'SEVEN_DAY_THREAD_ARCHIVE'
|
|
||||||
| 'PRIVATE_THREADS'
|
|
||||||
| 'ROLE_ICONS';
|
|
||||||
|
|
||||||
export interface GuildMemberEditData {
|
export interface GuildMemberEditData {
|
||||||
nick?: string | null;
|
nick?: string | null;
|
||||||
roles?: Collection<Snowflake, Role> | readonly RoleResolvable[];
|
roles?: Collection<Snowflake, Role> | readonly RoleResolvable[];
|
||||||
@@ -5188,6 +5165,7 @@ export {
|
|||||||
ButtonStyle,
|
ButtonStyle,
|
||||||
ChannelType,
|
ChannelType,
|
||||||
ComponentType,
|
ComponentType,
|
||||||
|
GuildFeature,
|
||||||
GuildMFALevel,
|
GuildMFALevel,
|
||||||
GuildNSFWLevel,
|
GuildNSFWLevel,
|
||||||
GuildPremiumTier,
|
GuildPremiumTier,
|
||||||
|
|||||||
Reference in New Issue
Block a user