disgroove 3.0.0-dev.32616ef → 3.0.0-dev.474d332

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.
@@ -6,7 +6,7 @@ import type { snowflake } from "./common";
6
6
  import type { RawEntitlement, Entitlement } from "./entitlements";
7
7
  import type { RawGuildMember, GuildMember, Guild, RawGuild } from "./guild";
8
8
  import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions } from "./message";
9
- import type { ActionRow, ChannelSelectInteractionResponse, Container, File, Label, LabelInteractionResponse, MediaGallery, MentionableSelectInteractionResponse, RawActionRow, RawChannelSelectInteractionResponse, RawContainer, RawFile, RawLabel, RawLabelInteractionResponse, RawMediaGallery, RawMentionableSelectInteractionResponse, RawRoleSelectInteractionResponse, RawSection, RawSeparator, RawStringSelectInteractionResponse, RawTextDisplay, RawTextDisplayInteractionResponse, RawTextInputInteractionResponse, RawUserSelectInteractionResponse, RoleSelectInteractionResponse, Section, Separator, StringSelectInteractionResponse, TextDisplay, TextDisplayInteractionResponse, TextInputInteractionResponse, UserSelectInteractionResponse } from "./components";
9
+ import type { ActionRow, ChannelSelectInteractionResponse, Container, File, FileUploadInteractionResponse, Label, LabelInteractionResponse, MediaGallery, MentionableSelectInteractionResponse, RawActionRow, RawChannelSelectInteractionResponse, RawContainer, RawFile, RawFileUploadInteractionResponse, RawLabel, RawLabelInteractionResponse, RawMediaGallery, RawMentionableSelectInteractionResponse, RawRoleSelectInteractionResponse, RawSection, RawSeparator, RawStringSelectInteractionResponse, RawTextDisplay, RawTextDisplayInteractionResponse, RawTextInputInteractionResponse, RawUserSelectInteractionResponse, RoleSelectInteractionResponse, Section, Separator, StringSelectInteractionResponse, TextDisplay, TextDisplayInteractionResponse, TextInputInteractionResponse, UserSelectInteractionResponse } from "./components";
10
10
  import type { RawPollCreateParams, PollCreateParams } from "./poll";
11
11
  import type { RawRole, Role } from "./role";
12
12
  import type { RawUser, User } from "./user";
@@ -57,7 +57,7 @@ export interface RawModalSubmitData {
57
57
  custom_id: string;
58
58
  components: Array<{
59
59
  type: ComponentTypes.ActionRow;
60
- components: Array<RawTextInputInteractionResponse | RawStringSelectInteractionResponse | RawUserSelectInteractionResponse | RawRoleSelectInteractionResponse | RawMentionableSelectInteractionResponse | RawChannelSelectInteractionResponse>;
60
+ components: Array<RawTextInputInteractionResponse | RawStringSelectInteractionResponse | RawUserSelectInteractionResponse | RawRoleSelectInteractionResponse | RawMentionableSelectInteractionResponse | RawChannelSelectInteractionResponse | RawFileUploadInteractionResponse>;
61
61
  } | RawTextDisplayInteractionResponse | RawLabelInteractionResponse>;
62
62
  resolved?: RawResolvedData;
63
63
  }
@@ -177,7 +177,7 @@ export interface ModalSubmitData {
177
177
  customId: string;
178
178
  components: Array<{
179
179
  type: ComponentTypes.ActionRow;
180
- components: Array<TextInputInteractionResponse | StringSelectInteractionResponse | UserSelectInteractionResponse | RoleSelectInteractionResponse | MentionableSelectInteractionResponse | ChannelSelectInteractionResponse>;
180
+ components: Array<TextInputInteractionResponse | StringSelectInteractionResponse | UserSelectInteractionResponse | RoleSelectInteractionResponse | MentionableSelectInteractionResponse | ChannelSelectInteractionResponse | FileUploadInteractionResponse>;
181
181
  } | TextDisplayInteractionResponse | LabelInteractionResponse>;
182
182
  resolved?: ResolvedData;
183
183
  }
@@ -1,4 +1,4 @@
1
- import type { JSONErrorCodes } from "../constants";
1
+ import { GatewayOPCodes, type JSONErrorCodes } from "../constants";
2
2
  export declare class RESTError extends Error {
3
3
  name: string;
4
4
  method: string;
@@ -14,5 +14,7 @@ export declare class HTTPError extends Error {
14
14
  }
15
15
  export declare class GatewayError extends Error {
16
16
  name: string;
17
+ code: GatewayOPCodes | number;
18
+ reason: string;
17
19
  constructor(code: number, reason: string);
18
20
  }
@@ -47,8 +47,12 @@ class HTTPError extends Error {
47
47
  exports.HTTPError = HTTPError;
48
48
  class GatewayError extends Error {
49
49
  name = "GatewayError";
50
+ code;
51
+ reason;
50
52
  constructor(code, reason) {
51
53
  super(`[${code}] ${reason}`);
54
+ this.code = code;
55
+ this.reason = reason;
52
56
  }
53
57
  }
54
58
  exports.GatewayError = GatewayError;
@@ -1,3 +1,4 @@
1
1
  export * as CDN from "./CDN";
2
2
  export * from "./errors";
3
3
  export * from "./formatters";
4
+ export * from "./permissions";
@@ -40,3 +40,4 @@ exports.CDN = void 0;
40
40
  exports.CDN = __importStar(require("./CDN"));
41
41
  __exportStar(require("./errors"), exports);
42
42
  __exportStar(require("./formatters"), exports);
43
+ __exportStar(require("./permissions"), exports);
@@ -0,0 +1,2 @@
1
+ /** https://discord.com/developers/docs/topics/permissions */
2
+ export declare function hasPermission(userPermissions: string, permission: bigint): boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasPermission = hasPermission;
4
+ /** https://discord.com/developers/docs/topics/permissions */
5
+ function hasPermission(userPermissions, permission) {
6
+ return (BigInt(userPermissions) & permission) === permission;
7
+ }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "3.0.0-dev.32616ef",
3
+ "version": "3.0.0-dev.474d332",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "3.0.0-dev.32616ef",
3
+ "version": "3.0.0-dev.474d332",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",