disgroove 2.0.0 → 2.1.0-dev.118f285

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.
Files changed (190) hide show
  1. package/dist/lib/Client.d.ts +16 -4
  2. package/dist/lib/Client.js +216 -180
  3. package/dist/lib/constants.d.ts +29 -5
  4. package/dist/lib/constants.js +235 -209
  5. package/dist/lib/gateway/Shard.js +6 -1
  6. package/dist/lib/gateway/ShardManager.js +0 -1
  7. package/dist/lib/gateway/index.js +0 -1
  8. package/dist/lib/index.js +0 -1
  9. package/dist/lib/rest/CDN.js +0 -1
  10. package/dist/lib/rest/Endpoints.d.ts +5 -2
  11. package/dist/lib/rest/Endpoints.js +10 -5
  12. package/dist/lib/rest/RequestManager.d.ts +2 -3
  13. package/dist/lib/rest/RequestManager.js +17 -18
  14. package/dist/lib/rest/index.js +0 -1
  15. package/dist/lib/types/application-command.d.ts +5 -1
  16. package/dist/lib/types/application-command.js +0 -1
  17. package/dist/lib/types/application-role-connection-metadata.js +0 -1
  18. package/dist/lib/types/application.d.ts +11 -1
  19. package/dist/lib/types/application.js +0 -1
  20. package/dist/lib/types/audit-log.js +0 -1
  21. package/dist/lib/types/auto-moderation.js +0 -1
  22. package/dist/lib/types/channel.d.ts +4 -1
  23. package/dist/lib/types/channel.js +0 -1
  24. package/dist/lib/types/emoji.js +0 -1
  25. package/dist/lib/types/entitlements.js +0 -1
  26. package/dist/lib/types/gateway-events.d.ts +28 -0
  27. package/dist/lib/types/gateway-events.js +0 -1
  28. package/dist/lib/types/guild-scheduled-event.js +0 -1
  29. package/dist/lib/types/guild-template.js +0 -1
  30. package/dist/lib/types/guild.d.ts +4 -0
  31. package/dist/lib/types/guild.js +0 -1
  32. package/dist/lib/types/index.d.ts +1 -0
  33. package/dist/lib/types/index.js +1 -1
  34. package/dist/lib/types/interaction.d.ts +3 -1
  35. package/dist/lib/types/interaction.js +0 -1
  36. package/dist/lib/types/invite.js +0 -1
  37. package/dist/lib/types/message-components.js +0 -1
  38. package/dist/lib/types/poll.d.ts +66 -0
  39. package/dist/lib/types/poll.js +2 -0
  40. package/dist/lib/types/role.js +0 -1
  41. package/dist/lib/types/sku.js +0 -1
  42. package/dist/lib/types/stage-instance.js +0 -1
  43. package/dist/lib/types/sticker.js +0 -1
  44. package/dist/lib/types/team.js +0 -1
  45. package/dist/lib/types/user.js +0 -1
  46. package/dist/lib/types/voice.js +0 -1
  47. package/dist/lib/types/webhook.d.ts +3 -1
  48. package/dist/lib/types/webhook.js +0 -1
  49. package/dist/lib/utils/Util.js +0 -1
  50. package/dist/lib/utils/errors.d.ts +1 -1
  51. package/dist/lib/utils/errors.js +4 -5
  52. package/dist/lib/utils/index.js +0 -1
  53. package/dist/package.json +4 -2
  54. package/package.json +4 -2
  55. package/dist/lib/Client.js.map +0 -1
  56. package/dist/lib/constants.js.map +0 -1
  57. package/dist/lib/gateway/Shard.js.map +0 -1
  58. package/dist/lib/gateway/ShardManager.js.map +0 -1
  59. package/dist/lib/gateway/ShardsManager.d.ts +0 -6
  60. package/dist/lib/gateway/ShardsManager.js +0 -14
  61. package/dist/lib/gateway/ShardsManager.js.map +0 -1
  62. package/dist/lib/gateway/index.js.map +0 -1
  63. package/dist/lib/index.js.map +0 -1
  64. package/dist/lib/rest/CDN.js.map +0 -1
  65. package/dist/lib/rest/Endpoints.js.map +0 -1
  66. package/dist/lib/rest/REST.d.ts +0 -17
  67. package/dist/lib/rest/REST.js +0 -35
  68. package/dist/lib/rest/REST.js.map +0 -1
  69. package/dist/lib/rest/RequestManager.js.map +0 -1
  70. package/dist/lib/rest/RequestsManager.d.ts +0 -22
  71. package/dist/lib/rest/RequestsManager.js +0 -123
  72. package/dist/lib/rest/RequestsManager.js.map +0 -1
  73. package/dist/lib/rest/index.js.map +0 -1
  74. package/dist/lib/structures/Application.d.ts +0 -174
  75. package/dist/lib/structures/Application.js +0 -328
  76. package/dist/lib/structures/Application.js.map +0 -1
  77. package/dist/lib/structures/ApplicationCommand.d.ts +0 -45
  78. package/dist/lib/structures/ApplicationCommand.js +0 -127
  79. package/dist/lib/structures/ApplicationCommand.js.map +0 -1
  80. package/dist/lib/structures/AuditLog.d.ts +0 -19
  81. package/dist/lib/structures/AuditLog.js +0 -101
  82. package/dist/lib/structures/AuditLog.js.map +0 -1
  83. package/dist/lib/structures/AutoModerationRule.d.ts +0 -34
  84. package/dist/lib/structures/AutoModerationRule.js +0 -96
  85. package/dist/lib/structures/AutoModerationRule.js.map +0 -1
  86. package/dist/lib/structures/Base.d.ts +0 -10
  87. package/dist/lib/structures/Base.js +0 -23
  88. package/dist/lib/structures/Base.js.map +0 -1
  89. package/dist/lib/structures/Channel.d.ts +0 -254
  90. package/dist/lib/structures/Channel.js +0 -592
  91. package/dist/lib/structures/Channel.js.map +0 -1
  92. package/dist/lib/structures/ClientApplication.d.ts +0 -150
  93. package/dist/lib/structures/ClientApplication.js +0 -241
  94. package/dist/lib/structures/ClientApplication.js.map +0 -1
  95. package/dist/lib/structures/Emoji.d.ts +0 -26
  96. package/dist/lib/structures/Emoji.js +0 -75
  97. package/dist/lib/structures/Emoji.js.map +0 -1
  98. package/dist/lib/structures/Entitlement.d.ts +0 -24
  99. package/dist/lib/structures/Entitlement.js +0 -68
  100. package/dist/lib/structures/Entitlement.js.map +0 -1
  101. package/dist/lib/structures/Guild.d.ts +0 -474
  102. package/dist/lib/structures/Guild.js +0 -1141
  103. package/dist/lib/structures/Guild.js.map +0 -1
  104. package/dist/lib/structures/GuildMember.d.ts +0 -49
  105. package/dist/lib/structures/GuildMember.js +0 -146
  106. package/dist/lib/structures/GuildMember.js.map +0 -1
  107. package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -49
  108. package/dist/lib/structures/GuildScheduledEvent.js +0 -118
  109. package/dist/lib/structures/GuildScheduledEvent.js.map +0 -1
  110. package/dist/lib/structures/GuildTemplate.d.ts +0 -30
  111. package/dist/lib/structures/GuildTemplate.js +0 -72
  112. package/dist/lib/structures/GuildTemplate.js.map +0 -1
  113. package/dist/lib/structures/IdentifiableBase.d.ts +0 -15
  114. package/dist/lib/structures/IdentifiableBase.js +0 -25
  115. package/dist/lib/structures/IdentifiableBase.js.map +0 -1
  116. package/dist/lib/structures/Integration.d.ts +0 -31
  117. package/dist/lib/structures/Integration.js +0 -103
  118. package/dist/lib/structures/Integration.js.map +0 -1
  119. package/dist/lib/structures/Interaction.d.ts +0 -76
  120. package/dist/lib/structures/Interaction.js +0 -346
  121. package/dist/lib/structures/Interaction.js.map +0 -1
  122. package/dist/lib/structures/Invite.d.ts +0 -26
  123. package/dist/lib/structures/Invite.js +0 -82
  124. package/dist/lib/structures/Invite.js.map +0 -1
  125. package/dist/lib/structures/Message.d.ts +0 -86
  126. package/dist/lib/structures/Message.js +0 -303
  127. package/dist/lib/structures/Message.js.map +0 -1
  128. package/dist/lib/structures/Role.d.ts +0 -37
  129. package/dist/lib/structures/Role.js +0 -90
  130. package/dist/lib/structures/Role.js.map +0 -1
  131. package/dist/lib/structures/SKU.d.ts +0 -23
  132. package/dist/lib/structures/SKU.js +0 -63
  133. package/dist/lib/structures/SKU.js.map +0 -1
  134. package/dist/lib/structures/StageInstance.d.ts +0 -24
  135. package/dist/lib/structures/StageInstance.js +0 -57
  136. package/dist/lib/structures/StageInstance.js.map +0 -1
  137. package/dist/lib/structures/Sticker.d.ts +0 -31
  138. package/dist/lib/structures/Sticker.js +0 -86
  139. package/dist/lib/structures/Sticker.js.map +0 -1
  140. package/dist/lib/structures/Team.d.ts +0 -14
  141. package/dist/lib/structures/Team.js +0 -39
  142. package/dist/lib/structures/Team.js.map +0 -1
  143. package/dist/lib/structures/TestEntitlement.d.ts +0 -23
  144. package/dist/lib/structures/TestEntitlement.js +0 -61
  145. package/dist/lib/structures/TestEntitlement.js.map +0 -1
  146. package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
  147. package/dist/lib/structures/UnavailableGuild.js +0 -25
  148. package/dist/lib/structures/UnavailableGuild.js.map +0 -1
  149. package/dist/lib/structures/User.d.ts +0 -63
  150. package/dist/lib/structures/User.js +0 -177
  151. package/dist/lib/structures/User.js.map +0 -1
  152. package/dist/lib/structures/VoiceState.d.ts +0 -24
  153. package/dist/lib/structures/VoiceState.js +0 -66
  154. package/dist/lib/structures/VoiceState.js.map +0 -1
  155. package/dist/lib/structures/Webhook.d.ts +0 -82
  156. package/dist/lib/structures/Webhook.js +0 -223
  157. package/dist/lib/structures/Webhook.js.map +0 -1
  158. package/dist/lib/structures/index.d.ts +0 -28
  159. package/dist/lib/structures/index.js +0 -45
  160. package/dist/lib/structures/index.js.map +0 -1
  161. package/dist/lib/types/application-command.js.map +0 -1
  162. package/dist/lib/types/application-role-connection-metadata.js.map +0 -1
  163. package/dist/lib/types/application.js.map +0 -1
  164. package/dist/lib/types/audit-log.js.map +0 -1
  165. package/dist/lib/types/auto-moderation.js.map +0 -1
  166. package/dist/lib/types/channel.js.map +0 -1
  167. package/dist/lib/types/emoji.js.map +0 -1
  168. package/dist/lib/types/entitlements.js.map +0 -1
  169. package/dist/lib/types/gateway-events.js.map +0 -1
  170. package/dist/lib/types/guild-scheduled-event.js.map +0 -1
  171. package/dist/lib/types/guild-template.js.map +0 -1
  172. package/dist/lib/types/guild.js.map +0 -1
  173. package/dist/lib/types/index.js.map +0 -1
  174. package/dist/lib/types/interaction.js.map +0 -1
  175. package/dist/lib/types/invite.js.map +0 -1
  176. package/dist/lib/types/message-components.js.map +0 -1
  177. package/dist/lib/types/role.js.map +0 -1
  178. package/dist/lib/types/sku.js.map +0 -1
  179. package/dist/lib/types/stage-instance.js.map +0 -1
  180. package/dist/lib/types/sticker.js.map +0 -1
  181. package/dist/lib/types/team.js.map +0 -1
  182. package/dist/lib/types/user.js.map +0 -1
  183. package/dist/lib/types/voice.js.map +0 -1
  184. package/dist/lib/types/webhook.js.map +0 -1
  185. package/dist/lib/utils/Collection.d.ts +0 -24
  186. package/dist/lib/utils/Collection.js +0 -65
  187. package/dist/lib/utils/Collection.js.map +0 -1
  188. package/dist/lib/utils/Util.js.map +0 -1
  189. package/dist/lib/utils/errors.js.map +0 -1
  190. package/dist/lib/utils/index.js.map +0 -1
@@ -1,3 +1,4 @@
1
+ export declare const bulkGuildBan: (guildId: string) => `guilds/${string}/bulk-ban`;
1
2
  export declare const guild: (guildId: string) => `guilds/${string}`;
2
3
  export declare const guilds: () => "guilds";
3
4
  export declare const guildActiveThreads: (guildId: string) => `guilds/${string}/threads/active`;
@@ -37,7 +38,7 @@ export declare const guildVoiceState: (guildId: string, userId?: string | "@me")
37
38
  export declare const guildWebhooks: (guildId: string) => `guilds/${string}/webhooks`;
38
39
  export declare const guildWelcomeScreen: (guildId: string) => `guilds/${string}/welcome-screen`;
39
40
  export declare const guildWidgetImage: (guildId: string) => `guilds/${string}/widget.png`;
40
- export declare const guildWidgetJson: (guildId: string) => `guilds/${string}/widget.json`;
41
+ export declare const guildWidgetJSON: (guildId: string) => `guilds/${string}/widget.json`;
41
42
  export declare const guildWidgetSettings: (guildId: string) => `guilds/${string}/widget`;
42
43
  export declare const template: (code: string) => `guilds/templates/${string}`;
43
44
  export declare const channel: (channelId: string) => `channels/${string}`;
@@ -53,11 +54,13 @@ export declare const channelPermission: (channelId: string, overwriteId: string)
53
54
  export declare const channelPin: (channelId: string, messageId: string) => `channels/${string}/pins/${string}`;
54
55
  export declare const channelPins: (channelId: string) => `channels/${string}/pins`;
55
56
  export declare const channelRecipient: (channelId: string, userId: string) => `channels/${string}/recipients/${string}`;
56
- export declare const channelThreads: (channelId: string, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/public` | `channels/${string}/threads/archived/private`;
57
+ export declare const channelThreads: (channelId: string, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/private` | `channels/${string}/threads/archived/public`;
57
58
  export declare const channelTyping: (channelId: string) => `channels/${string}/typing`;
58
59
  export declare const channelWebhooks: (channelId: string) => `channels/${string}/webhooks`;
59
60
  export declare const threads: (channelId: string, messageId?: string) => `channels/${string}/threads`;
60
61
  export declare const threadMembers: (threadId: string, userId?: string | "@me") => `channels/${string}/thread-members` | `channels/${string}/thread-members/${string}`;
62
+ export declare const pollAnswerVoters: (channelId: string, messageId: string, answerId: string) => `channels/${string}/polls/${string}/answers/${string}`;
63
+ export declare const pollExpire: (channelId: string, messageId: string) => `channels/${string}/polls/${string}/expire`;
61
64
  export declare const user: (userId?: string | "@me") => `users/${string}`;
62
65
  export declare const userApplicationRoleConnection: (applicationId: string) => `users/@me/applications/${string}/role-connection`;
63
66
  export declare const userChannels: () => "users/@me/channels";
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.channelMessageReaction = exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJson = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityUrl = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildEmojis = exports.guildEmoji = exports.guildCurrentMemberNickname = exports.guildChannels = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = void 0;
4
- exports.voiceRegions = exports.stickerPacks = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2CurrentAuthorization = exports.oauth2CurrentApplication = exports.oauth2Authorization = exports.gatewayBot = exports.gateway = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSkus = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlement = exports.applicationCurrentUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = void 0;
3
+ exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityUrl = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildEmojis = exports.guildEmoji = exports.guildCurrentMemberNickname = exports.guildChannels = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = exports.bulkGuildBan = void 0;
4
+ exports.voiceRegions = exports.stickerPacks = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2CurrentAuthorization = exports.oauth2CurrentApplication = exports.oauth2Authorization = exports.gatewayBot = exports.gateway = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSkus = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlement = exports.applicationCurrentUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = void 0;
5
5
  // Guilds
6
+ const bulkGuildBan = (guildId) => `guilds/${guildId}/bulk-ban`;
7
+ exports.bulkGuildBan = bulkGuildBan;
6
8
  const guild = (guildId) => `guilds/${guildId}`;
7
9
  exports.guild = guild;
8
10
  const guilds = () => "guilds";
@@ -81,8 +83,8 @@ const guildWelcomeScreen = (guildId) => `guilds/${guildId}/welcome-screen`;
81
83
  exports.guildWelcomeScreen = guildWelcomeScreen;
82
84
  const guildWidgetImage = (guildId) => `guilds/${guildId}/widget.png`;
83
85
  exports.guildWidgetImage = guildWidgetImage;
84
- const guildWidgetJson = (guildId) => `guilds/${guildId}/widget.json`;
85
- exports.guildWidgetJson = guildWidgetJson;
86
+ const guildWidgetJSON = (guildId) => `guilds/${guildId}/widget.json`;
87
+ exports.guildWidgetJSON = guildWidgetJSON;
86
88
  const guildWidgetSettings = (guildId) => `guilds/${guildId}/widget`;
87
89
  exports.guildWidgetSettings = guildWidgetSettings;
88
90
  const template = (code) => `guilds/templates/${code}`;
@@ -132,6 +134,10 @@ const threadMembers = (threadId, userId) => userId
132
134
  ? `channels/${threadId}/thread-members`
133
135
  : `channels/${threadId}/thread-members/${userId}`;
134
136
  exports.threadMembers = threadMembers;
137
+ const pollAnswerVoters = (channelId, messageId, answerId) => `channels/${channelId}/polls/${messageId}/answers/${answerId}`;
138
+ exports.pollAnswerVoters = pollAnswerVoters;
139
+ const pollExpire = (channelId, messageId) => `channels/${channelId}/polls/${messageId}/expire`;
140
+ exports.pollExpire = pollExpire;
135
141
  // Users
136
142
  const user = (userId = "@me") => `users/${userId}`;
137
143
  exports.user = user;
@@ -208,4 +214,3 @@ const stickerPacks = () => "sticker-packs";
208
214
  exports.stickerPacks = stickerPacks;
209
215
  const voiceRegions = () => "voice/regions";
210
216
  exports.voiceRegions = voiceRegions;
211
- //# sourceMappingURL=Endpoints.js.map
@@ -1,6 +1,5 @@
1
1
  /// <reference types="node" />
2
- /// <reference types="node" />
3
- export declare enum RestMethods {
2
+ export declare enum RESTMethods {
4
3
  Get = "GET",
5
4
  Post = "POST",
6
5
  Delete = "DELETE",
@@ -24,5 +23,5 @@ export declare class RequestManager {
24
23
  auth: "Bot" | "Bearer";
25
24
  globalBlock: boolean;
26
25
  constructor(token: string, auth: "Bot" | "Bearer");
27
- request<T = unknown>(method: RestMethods, endpoint: string, data?: RequestData): Promise<T>;
26
+ request<T = unknown>(method: RESTMethods, endpoint: string, data?: RequestData): Promise<T>;
28
27
  }
@@ -23,18 +23,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.RequestManager = exports.RestMethods = void 0;
26
+ exports.RequestManager = exports.RESTMethods = void 0;
27
27
  const constants_1 = require("../constants");
28
28
  const utils_1 = require("../utils");
29
29
  const pkg = __importStar(require("../../package.json"));
30
- var RestMethods;
31
- (function (RestMethods) {
32
- RestMethods["Get"] = "GET";
33
- RestMethods["Post"] = "POST";
34
- RestMethods["Delete"] = "DELETE";
35
- RestMethods["Patch"] = "PATCH";
36
- RestMethods["Put"] = "PUT";
37
- })(RestMethods || (exports.RestMethods = RestMethods = {}));
30
+ var RESTMethods;
31
+ (function (RESTMethods) {
32
+ RESTMethods["Get"] = "GET";
33
+ RESTMethods["Post"] = "POST";
34
+ RESTMethods["Delete"] = "DELETE";
35
+ RESTMethods["Patch"] = "PATCH";
36
+ RESTMethods["Put"] = "PUT";
37
+ })(RESTMethods || (exports.RESTMethods = RESTMethods = {}));
38
38
  class RequestManager {
39
39
  token;
40
40
  auth;
@@ -59,7 +59,7 @@ class RequestManager {
59
59
  let body;
60
60
  if (data?.authorization === false)
61
61
  delete headers["Authorization"];
62
- if (method !== RestMethods.Get) {
62
+ if (method !== RESTMethods.Get) {
63
63
  if (data?.form || (data?.files && data?.files?.length !== 0)) {
64
64
  const formData = data.form ?? new FormData();
65
65
  if (data?.files && data?.files?.length !== 0) {
@@ -103,13 +103,13 @@ class RequestManager {
103
103
  .catch(reject), 5 * 1000);
104
104
  }
105
105
  else {
106
- const responseJson = await response.json();
107
- reject(responseJson &&
108
- typeof responseJson === "object" &&
109
- "code" in responseJson &&
110
- "message" in responseJson &&
111
- responseJson.code !== 0
112
- ? new utils_1.RestError(`[${responseJson.code}] ${responseJson.message}`)
106
+ const responseJSON = await response.json();
107
+ reject(responseJSON &&
108
+ typeof responseJSON === "object" &&
109
+ "code" in responseJSON &&
110
+ "message" in responseJSON &&
111
+ responseJSON.code !== 0
112
+ ? new utils_1.RESTError(`[${responseJSON.code}] ${responseJSON.message}`)
113
113
  : new utils_1.HTTPError(`[${response.status}] ${response.statusText}`));
114
114
  }
115
115
  }
@@ -127,4 +127,3 @@ class RequestManager {
127
127
  }
128
128
  }
129
129
  exports.RequestManager = RequestManager;
130
- //# sourceMappingURL=RequestManager.js.map
@@ -30,4 +30,3 @@ exports.Endpoints = exports.CDN = void 0;
30
30
  exports.CDN = __importStar(require("./CDN"));
31
31
  exports.Endpoints = __importStar(require("./Endpoints"));
32
32
  __exportStar(require("./RequestManager"), exports);
33
- //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import type { LocaleMap } from ".";
2
- import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType } from "../constants";
2
+ import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType, ApplicationIntegrationTypes, InterationContextTypes } from "../constants";
3
3
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
4
4
  export interface RawApplicationCommand {
5
5
  id: string;
@@ -14,6 +14,8 @@ export interface RawApplicationCommand {
14
14
  default_member_permissions: string | null;
15
15
  dm_permission?: boolean;
16
16
  default_permission?: boolean | null;
17
+ integration_types?: Array<ApplicationIntegrationTypes>;
18
+ contexts?: Array<InterationContextTypes>;
17
19
  nsfw?: boolean;
18
20
  version: string;
19
21
  }
@@ -66,6 +68,8 @@ export interface ApplicationCommand {
66
68
  defaultMemberPermissions: string | null;
67
69
  dmPermission?: boolean;
68
70
  defaultPermission?: boolean | null;
71
+ integrationTypes?: Array<ApplicationIntegrationTypes>;
72
+ contexts?: Array<InterationContextTypes>;
69
73
  nsfw?: boolean;
70
74
  version: string;
71
75
  }
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=application-command.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=application-role-connection-metadata.js.map
@@ -1,5 +1,5 @@
1
1
  import type { RawUser, RawTeam, Team, User, RawGuild, Guild } from ".";
2
- import type { ApplicationFlags, OAuth2Scopes } from "../constants";
2
+ import type { ApplicationFlags, ApplicationIntegrationTypes, OAuth2Scopes } from "../constants";
3
3
  /** https://discord.com/developers/docs/resources/application#application-object-application-structure */
4
4
  export interface RawApplication {
5
5
  id: string;
@@ -26,8 +26,13 @@ export interface RawApplication {
26
26
  role_connections_verification_url?: string;
27
27
  tags?: Array<string>;
28
28
  install_params?: RawInstallParams;
29
+ integration_types_config?: Record<ApplicationIntegrationTypes, RawApplicationIntegrationTypeConfiguration>;
29
30
  custom_install_url?: string;
30
31
  }
32
+ /** https://discord.com/developers/docs/resources/application#application-object-application-integration-type-configuration-object */
33
+ export interface RawApplicationIntegrationTypeConfiguration {
34
+ oauth2_install_params: RawInstallParams;
35
+ }
31
36
  /** https://discord.com/developers/docs/resources/application#install-params-object-install-params-structure */
32
37
  export interface RawInstallParams {
33
38
  scopes: Array<OAuth2Scopes>;
@@ -58,8 +63,12 @@ export interface Application {
58
63
  roleConnectionsVerificationUrl?: string;
59
64
  tags?: Array<string>;
60
65
  installParams?: InstallParams;
66
+ integrationTypesConfig?: Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>;
61
67
  customInstallUrl?: string;
62
68
  }
69
+ export interface ApplicationIntegrationTypeConfiguration {
70
+ oauth2InstallParams: InstallParams;
71
+ }
63
72
  export interface InstallParams {
64
73
  scopes: Array<OAuth2Scopes>;
65
74
  permissions: string;
@@ -69,6 +78,7 @@ export interface EditCurrentApplicationParams {
69
78
  description?: string;
70
79
  roleConnectionsVerificationUrl?: string;
71
80
  installParams?: InstallParams;
81
+ integrationTypesConfig?: Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>;
72
82
  flags?: ApplicationFlags;
73
83
  icon?: string;
74
84
  coverImage?: string;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=application.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=audit-log.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=auto-moderation.js.map
@@ -1,5 +1,5 @@
1
1
  import type { AllowedMentionTypes, AttachmentFlags, ChannelFlags, ChannelTypes, ForumLayoutTypes, InviteTargetTypes, MessageActivityTypes, MessageFlags, MessageTypes, SortOrderTypes, VideoQualityModes } from "../constants";
2
- import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData } from ".";
2
+ import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData, RawPollCreateParams, PollCreateParams } from ".";
3
3
  import type { File } from "../rest";
4
4
  /** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
5
5
  export interface RawChannel {
@@ -73,6 +73,7 @@ export interface RawMessage {
73
73
  position?: number;
74
74
  role_subscription_data?: RawRoleSubscriptionData;
75
75
  resolved?: RawResolvedData;
76
+ poll?: RawPollCreateParams;
76
77
  }
77
78
  /** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
78
79
  export interface RawMessageActivity {
@@ -310,6 +311,7 @@ export interface Message {
310
311
  position?: number;
311
312
  roleSubscriptionData?: RoleSubscriptionData;
312
313
  resolved?: ResolvedData;
314
+ poll?: PollCreateParams;
313
315
  }
314
316
  export interface MessageActivity {
315
317
  type: MessageActivityTypes;
@@ -495,6 +497,7 @@ export interface CreateMessageParams {
495
497
  attachments?: Array<Attachment>;
496
498
  flags?: MessageFlags;
497
499
  enforceNonce?: boolean;
500
+ poll?: PollCreateParams;
498
501
  }
499
502
  export interface EditMessageParams {
500
503
  content?: string | null;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=channel.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=emoji.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=entitlements.js.map
@@ -257,6 +257,20 @@ export interface RawVoiceServerUpdateEventFields {
257
257
  guild_id: string;
258
258
  endpoint: string | null;
259
259
  }
260
+ export interface RawMessagePollVoteAddFields {
261
+ user_id: string;
262
+ channel_id: string;
263
+ message_id: string;
264
+ guild_id?: string;
265
+ answer_id: number;
266
+ }
267
+ export interface RawMessagePollVoteRemoveFields {
268
+ user_id: string;
269
+ channel_id: string;
270
+ message_id: string;
271
+ guild_id?: string;
272
+ answer_id: number;
273
+ }
260
274
  export interface AutoModerationActionExecutionEventFields {
261
275
  guildId: string;
262
276
  action: AutoModerationAction;
@@ -479,3 +493,17 @@ export interface VoiceServerUpdateEventFields {
479
493
  guildId: string;
480
494
  endpoint: string | null;
481
495
  }
496
+ export interface MessagePollVoteAddFields {
497
+ userId: string;
498
+ channelId: string;
499
+ messageId: string;
500
+ guildId?: string;
501
+ answerId: number;
502
+ }
503
+ export interface MessagePollVoteRemoveFields {
504
+ userId: string;
505
+ channelId: string;
506
+ messageId: string;
507
+ guildId?: string;
508
+ answerId: number;
509
+ }
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=gateway-events.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=guild-scheduled-event.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=guild-template.js.map
@@ -433,6 +433,10 @@ export interface CreateGuildBanParams {
433
433
  deleteMessageDays?: number;
434
434
  deleteMessageSeconds?: number;
435
435
  }
436
+ export interface BulkGuildBanParams {
437
+ userIds: Array<string>;
438
+ deleteMessageSeconds?: number;
439
+ }
436
440
  export interface CreateGuildRoleParams {
437
441
  name?: string;
438
442
  permissions?: string;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=guild.js.map
@@ -14,6 +14,7 @@ export * from "./guild";
14
14
  export * from "./interaction";
15
15
  export * from "./invite";
16
16
  export * from "./message-components";
17
+ export * from "./poll";
17
18
  export * from "./role";
18
19
  export * from "./sku";
19
20
  export * from "./stage-instance";
@@ -29,6 +29,7 @@ __exportStar(require("./guild"), exports);
29
29
  __exportStar(require("./interaction"), exports);
30
30
  __exportStar(require("./invite"), exports);
31
31
  __exportStar(require("./message-components"), exports);
32
+ __exportStar(require("./poll"), exports);
32
33
  __exportStar(require("./role"), exports);
33
34
  __exportStar(require("./sku"), exports);
34
35
  __exportStar(require("./stage-instance"), exports);
@@ -37,4 +38,3 @@ __exportStar(require("./team"), exports);
37
38
  __exportStar(require("./user"), exports);
38
39
  __exportStar(require("./voice"), exports);
39
40
  __exportStar(require("./webhook"), exports);
40
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { RawAttachment, RawChannel, RawGuildMember, RawMessage, RawUser, RawRole, Attachment, User, GuildMember, Message, Role, Channel, Entitlement, RawEntitlement, RawEmbed, RawAllowedMentions, RawActionRow, RawApplicationCommandOptionChoice, Embed, AllowedMentions, ActionRow, ApplicationCommandOptionChoice, RawTextInput, TextInput, ExecuteWebhookParams } from ".";
1
+ import type { RawAttachment, RawChannel, RawGuildMember, RawMessage, RawUser, RawRole, Attachment, User, GuildMember, Message, Role, Channel, Entitlement, RawEntitlement, RawEmbed, RawAllowedMentions, RawActionRow, RawApplicationCommandOptionChoice, Embed, AllowedMentions, ActionRow, ApplicationCommandOptionChoice, RawTextInput, TextInput, ExecuteWebhookParams, RawPollCreateParams, PollCreateParams } from ".";
2
2
  import type { ApplicationCommandOptionType, ApplicationCommandTypes, ComponentTypes, InteractionCallbackType, InteractionType, MessageFlags } from "../constants";
3
3
  import type { File } from "../rest";
4
4
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */
@@ -84,6 +84,7 @@ export interface RawInteractionCallbackData {
84
84
  flags?: MessageFlags;
85
85
  components?: Array<RawActionRow>;
86
86
  attachments?: Array<RawAttachment>;
87
+ poll?: RawPollCreateParams;
87
88
  files?: Array<File>;
88
89
  choices?: Array<RawApplicationCommandOptionChoice>;
89
90
  custom_id?: string;
@@ -163,6 +164,7 @@ export interface InteractionCallbackData {
163
164
  flags?: MessageFlags;
164
165
  components?: Array<ActionRow>;
165
166
  attachments?: Array<Attachment>;
167
+ poll?: PollCreateParams;
166
168
  files?: Array<File>;
167
169
  choices?: Array<ApplicationCommandOptionChoice>;
168
170
  customId?: string;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=interaction.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=invite.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=message-components.js.map
@@ -0,0 +1,66 @@
1
+ import type { LayoutType } from "../constants";
2
+ import type { Emoji, RawEmoji } from "./emoji";
3
+ export interface RawPoll {
4
+ question: RawPollMedia;
5
+ answers: Array<RawPollAnswer>;
6
+ expiry: string;
7
+ allow_multiselect: boolean;
8
+ layout_type: LayoutType;
9
+ results: RawPollResults;
10
+ }
11
+ export interface RawPollMedia {
12
+ text?: string;
13
+ emoji?: Pick<RawEmoji, "id" | "name">;
14
+ }
15
+ export interface RawPollAnswer {
16
+ answer_id: number;
17
+ poll_media: RawPollMedia;
18
+ }
19
+ export interface RawPollResults {
20
+ is_finalized: boolean;
21
+ answer_counts: Array<RawPollAnswerCount>;
22
+ }
23
+ export interface RawPollAnswerCount {
24
+ id: number;
25
+ count: number;
26
+ me_voted: boolean;
27
+ }
28
+ export interface RawPollCreateParams {
29
+ question: RawPollMedia;
30
+ answers: Array<RawPollAnswer>;
31
+ duration: number;
32
+ allow_multiselect: boolean;
33
+ layout_type?: LayoutType;
34
+ }
35
+ export interface Poll {
36
+ question: PollMedia;
37
+ answers: Array<PollAnswer>;
38
+ expiry: string;
39
+ allowMultiselect: boolean;
40
+ layoutType: LayoutType;
41
+ results: PollResults;
42
+ }
43
+ export interface PollMedia {
44
+ text?: string;
45
+ emoji?: Pick<Emoji, "id" | "name">;
46
+ }
47
+ export interface PollAnswer {
48
+ answerId: number;
49
+ pollMedia: PollMedia;
50
+ }
51
+ export interface PollResults {
52
+ isFinalized: boolean;
53
+ answerCounts: Array<PollAnswerCount>;
54
+ }
55
+ export interface PollAnswerCount {
56
+ id: number;
57
+ count: number;
58
+ meVoted: boolean;
59
+ }
60
+ export interface PollCreateParams {
61
+ question: PollMedia;
62
+ answers: Array<PollAnswer>;
63
+ duration: number;
64
+ allowMultiselect: boolean;
65
+ layoutType?: LayoutType;
66
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=role.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=sku.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=stage-instance.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=sticker.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=team.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=user.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=voice.js.map
@@ -1,5 +1,5 @@
1
1
  import type { MessageFlags, WebhookTypes } from "../constants";
2
- import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser } from ".";
2
+ import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser, PollCreateParams } from ".";
3
3
  import type { File } from "../rest";
4
4
  /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
5
5
  export interface RawWebhook {
@@ -51,6 +51,8 @@ export interface ExecuteWebhookParams {
51
51
  attachments?: Array<Attachment> | null;
52
52
  flags?: MessageFlags | null;
53
53
  threadName?: string;
54
+ appliedTags?: Array<string>;
55
+ poll?: PollCreateParams;
54
56
  }
55
57
  export interface EditWebhookMessageParams {
56
58
  content?: string | null;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=webhook.js.map
@@ -44,4 +44,3 @@ class Util {
44
44
  }
45
45
  }
46
46
  exports.Util = Util;
47
- //# sourceMappingURL=Util.js.map
@@ -1,4 +1,4 @@
1
- export declare class RestError extends Error {
1
+ export declare class RESTError extends Error {
2
2
  name: string;
3
3
  constructor(message: string);
4
4
  }
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GatewayError = exports.HTTPError = exports.RestError = void 0;
4
- class RestError extends Error {
5
- name = "RestError";
3
+ exports.GatewayError = exports.HTTPError = exports.RESTError = void 0;
4
+ class RESTError extends Error {
5
+ name = "RESTError";
6
6
  constructor(message) {
7
7
  super(message);
8
8
  }
9
9
  }
10
- exports.RestError = RestError;
10
+ exports.RESTError = RESTError;
11
11
  class HTTPError extends Error {
12
12
  name = "HTTPError";
13
13
  constructor(message) {
@@ -22,4 +22,3 @@ class GatewayError extends Error {
22
22
  }
23
23
  }
24
24
  exports.GatewayError = GatewayError;
25
- //# sourceMappingURL=errors.js.map
@@ -16,4 +16,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./errors"), exports);
18
18
  __exportStar(require("./Util"), exports);
19
- //# sourceMappingURL=index.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.0.0",
3
+ "version": "2.1.0-dev.118f285",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -24,7 +24,9 @@
24
24
  "devDependencies": {
25
25
  "@types/node": "^20.11.25",
26
26
  "@types/ws": "^8.5.10",
27
- "node": "^21.7.1",
27
+ "typescript": "^5.4.2"
28
+ },
29
+ "dependencies": {
28
30
  "ws": "^8.16.0"
29
31
  }
30
32
  }