mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -151,6 +151,7 @@ export interface ActivityLocation {
|
||||
|
||||
export interface Application {
|
||||
flags?: ApplicationFlags;
|
||||
flagsNew?: ToggleBitfield;
|
||||
icon?: bigint;
|
||||
rpcOrigins?: string[];
|
||||
termsOfServiceUrl?: string;
|
||||
|
||||
@@ -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) */
|
||||
|
||||
Reference in New Issue
Block a user