feat: Application flags_new property (#5172)

* feat: Application flags_new property

* Update packages/types/src/discord/application.ts

* run biome
This commit is contained in:
Fleny
2026-07-24 18:04:42 +05:30
committed by GitHub
parent dd18449ce6
commit c3e9a790fc
3 changed files with 15 additions and 1 deletions
@@ -1,6 +1,7 @@
import { type DiscordApplication, DiscordApplicationIntegrationType, type DiscordUser } from '@discordeno/types';
import { iconHashToBigInt } from '@discordeno/utils';
import type { Bot } from '../bot.js';
import { ToggleBitfield } from './toggles/ToggleBitfield.js';
import type { Application } from './types.js';
export function transformApplication(bot: Bot, payload: DiscordApplication, extra?: { shardId?: number }): Application {
@@ -17,6 +18,8 @@ export function transformApplication(bot: Bot, payload: DiscordApplication, extr
slug: payload.slug,
coverImage: payload.cover_image ? iconHashToBigInt(payload.cover_image) : undefined,
flags: payload.flags,
// flags_new is a string with the bitfield inside
flagsNew: payload.flags_new ? new ToggleBitfield(Number(payload.flags_new)) : undefined,
id: bot.transformers.snowflake(payload.id),
icon: payload.icon ? iconHashToBigInt(payload.icon) : undefined,
+1
View File
@@ -151,6 +151,7 @@ export interface ActivityLocation {
export interface Application {
flags?: ApplicationFlags;
flagsNew?: ToggleBitfield;
icon?: bigint;
rpcOrigins?: string[];
termsOfServiceUrl?: string;
+11 -1
View File
@@ -44,8 +44,18 @@ export interface DiscordApplication {
slug?: string;
/** If this application is a game sold on Discord, this field will be the hash of the image on store embeds */
cover_image?: string;
/** The application's public flags */
/**
* App's legacy public flags
*
* @see {@link ApplicationFlags}
*/
flags?: ApplicationFlags;
/**
* App's public flags
*
* @see {@link ApplicationFlags}
*/
flags_new?: string;
/** An approximate count of the app's guild membership. */
approximate_guild_count?: number;
/** Approximate count of users that have installed the app. (authorized with `application.commands` as a scope) */