@theholocron/discord-client 1.47.1 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -102,7 +102,7 @@ the create response.
102
102
  | Resource | Methods |
103
103
  | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
104
104
  | `client.users` | `me()` — `GET /users/@me`, a cheap token check; `get(id)` — a user's name |
105
- | `client.application` | `get`, `modify` (the bot's own application: description, tags, install settings, URLs) |
105
+ | `client.application` | `get`, `modify` (the bot's own application: description, tags, install settings, URLs, and `flags` for the privileged-intent toggles; `redirect_uris` can be read but not written, so add them in the developer portal) |
106
106
  | `client.guilds` | `get`, `modify`, `channels`, `createChannel`, `roles`, `createRole`, `modifyRole`, `create`, `delete`, `emojis`, `member`, `members`, `membersWithRole`, `addMemberRole`, `removeMemberRole`, `welcomeScreen`, `modifyWelcomeScreen`, `onboarding`, `modifyOnboarding` |
107
107
  | `client.channels` | `modify`, `webhooks`, `createWebhook`, `createMessage`, `createInvite`, `messages`, `pin`, `deleteMessage` |
108
108
  | `client.webhooks` | `modify` (name, avatar), `delete` |
package/dist/index.d.mts CHANGED
@@ -238,6 +238,18 @@ interface DiscordInstallParams {
238
238
  /** Permission bitfield the default install link asks for, as a string. */
239
239
  permissions: string;
240
240
  }
241
+ /**
242
+ * Bits of the application's `flags`. The `*Limited` ones are the portal's privileged-intent toggles for an app
243
+ * that Discord has not verified; once verified, the plain ones take over and the toggle is Discord's to change.
244
+ */
245
+ declare const ApplicationFlag: {
246
+ readonly GatewayPresence: number;
247
+ readonly GatewayPresenceLimited: number;
248
+ readonly GatewayGuildMembers: number;
249
+ readonly GatewayGuildMembersLimited: number;
250
+ readonly GatewayMessageContent: number;
251
+ readonly GatewayMessageContentLimited: number;
252
+ };
241
253
  /** The bot's own application, as `GET /applications/@me` returns it. Fields Discord leaves out are absent or null. */
242
254
  interface DiscordApplication {
243
255
  id: string;
@@ -257,6 +269,11 @@ interface DiscordApplication {
257
269
  bot_public?: boolean;
258
270
  bot_require_code_grant?: boolean;
259
271
  flags?: number;
272
+ /**
273
+ * The OAuth2 redirect URIs registered on the application. Read-only here: Discord accepts a write to this
274
+ * field and silently ignores it, so add them in the developer portal (OAuth2 → Redirects).
275
+ */
276
+ redirect_uris?: string[];
260
277
  }
261
278
  /** What `PATCH /applications/@me` takes; a field left out is left alone, and `null` clears the ones that can be cleared. */
262
279
  interface ModifyApplicationInput {
@@ -268,6 +285,11 @@ interface ModifyApplicationInput {
268
285
  terms_of_service_url?: string | null;
269
286
  privacy_policy_url?: string | null;
270
287
  interactions_endpoint_url?: string | null;
288
+ /**
289
+ * The whole flags value. Discord keeps only the bits an app may change (the `*Limited` privileged-intent
290
+ * toggles among them), so read `flags` first and send it back with your bit set or cleared.
291
+ */
292
+ flags?: number;
271
293
  }
272
294
  interface ModifyWebhookInput {
273
295
  name?: string;
@@ -589,4 +611,4 @@ declare function createDiscordClient(opts?: DiscordClientOptions): {
589
611
  };
590
612
  type DiscordClient = ReturnType<typeof createDiscordClient>;
591
613
  //#endregion
592
- export { ChannelType, CreateChannelInput, CreateGuildInput, CreateInviteInput, CreateMessageInput, CreateRoleInput, DEFAULT_STATE_TTL_SECONDS, DiscordApplication, DiscordBotClient, DiscordBotClientOptions, DiscordChannel, DiscordChannelMessage, DiscordChannelWebhook, DiscordClient, type DiscordClientOptions, DiscordConnection, DiscordEmoji, DiscordGuild, DiscordGuildMember, DiscordInstallParams, DiscordInvite, DiscordMessage, DiscordOAuthClient, DiscordOAuthClientOptions, DiscordOAuthScope, DiscordOAuthToken, DiscordOAuthUser, DiscordOnboarding, DiscordOnboardingOption, DiscordOnboardingPrompt, DiscordPermissionOverwrite, DiscordRole, DiscordUser, type DiscordWebhookInfo, DiscordWelcomeChannel, DiscordWelcomeScreen, ListMembersInput, ModifyApplicationInput, ModifyChannelInput, ModifyGuildInput, ModifyRoleInput, ModifyWebhookInput, ModifyWelcomeScreenInput, Permission, PermissionName, createDiscordBotClient, createDiscordClient, createDiscordOAuthClient, findVerifiedConnection, parseWebhookUrl, permissionNames, permissions, signOAuthState, verifyOAuthState };
614
+ export { ApplicationFlag, ChannelType, CreateChannelInput, CreateGuildInput, CreateInviteInput, CreateMessageInput, CreateRoleInput, DEFAULT_STATE_TTL_SECONDS, DiscordApplication, DiscordBotClient, DiscordBotClientOptions, DiscordChannel, DiscordChannelMessage, DiscordChannelWebhook, DiscordClient, type DiscordClientOptions, DiscordConnection, DiscordEmoji, DiscordGuild, DiscordGuildMember, DiscordInstallParams, DiscordInvite, DiscordMessage, DiscordOAuthClient, DiscordOAuthClientOptions, DiscordOAuthScope, DiscordOAuthToken, DiscordOAuthUser, DiscordOnboarding, DiscordOnboardingOption, DiscordOnboardingPrompt, DiscordPermissionOverwrite, DiscordRole, DiscordUser, type DiscordWebhookInfo, DiscordWelcomeChannel, DiscordWelcomeScreen, ListMembersInput, ModifyApplicationInput, ModifyChannelInput, ModifyGuildInput, ModifyRoleInput, ModifyWebhookInput, ModifyWelcomeScreenInput, Permission, PermissionName, createDiscordBotClient, createDiscordClient, createDiscordOAuthClient, findVerifiedConnection, parseWebhookUrl, permissionNames, permissions, signOAuthState, verifyOAuthState };
package/dist/index.mjs CHANGED
@@ -343,6 +343,18 @@ const ChannelType = {
343
343
  Announcement: 5,
344
344
  Forum: 15
345
345
  };
346
+ /**
347
+ * Bits of the application's `flags`. The `*Limited` ones are the portal's privileged-intent toggles for an app
348
+ * that Discord has not verified; once verified, the plain ones take over and the toggle is Discord's to change.
349
+ */
350
+ const ApplicationFlag = {
351
+ GatewayPresence: 4096,
352
+ GatewayPresenceLimited: 8192,
353
+ GatewayGuildMembers: 16384,
354
+ GatewayGuildMembersLimited: 32768,
355
+ GatewayMessageContent: 1 << 18,
356
+ GatewayMessageContentLimited: 1 << 19
357
+ };
346
358
  //#endregion
347
359
  //#region ../../../../../src/bot/permissions.ts
348
360
  /**
@@ -550,4 +562,4 @@ function createDiscordClient(opts = {}) {
550
562
  return { webhooks: webhooks(opts.baseUrl ?? "https://discord.com/api/v10", opts.fetch ?? globalThis.fetch) };
551
563
  }
552
564
  //#endregion
553
- export { ChannelType, DEFAULT_STATE_TTL_SECONDS, Permission, createDiscordBotClient, createDiscordClient, createDiscordOAuthClient, findVerifiedConnection, parseWebhookUrl, permissionNames, permissions, signOAuthState, verifyOAuthState };
565
+ export { ApplicationFlag, ChannelType, DEFAULT_STATE_TTL_SECONDS, Permission, createDiscordBotClient, createDiscordClient, createDiscordOAuthClient, findVerifiedConnection, parseWebhookUrl, permissionNames, permissions, signOAuthState, verifyOAuthState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/discord-client",
3
- "version": "1.47.1",
3
+ "version": "1.48.0",
4
4
  "description": "A TypeScript client for the Discord webhooks API",
5
5
  "keywords": [
6
6
  "discord",
@@ -32,7 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/http-client": "^1.47.1"
35
+ "@theholocron/http-client": "^1.48.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@theholocron/cli": "5.0.0-alpha.79",