disgroove 2.0.0 → 2.1.0-dev.c430b6f

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 (186) hide show
  1. package/dist/lib/Client.d.ts +10 -1
  2. package/dist/lib/Client.js +193 -179
  3. package/dist/lib/constants.d.ts +17 -5
  4. package/dist/lib/constants.js +221 -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 +4 -2
  11. package/dist/lib/rest/Endpoints.js +8 -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.js +0 -1
  16. package/dist/lib/types/application-role-connection-metadata.js +0 -1
  17. package/dist/lib/types/application.js +0 -1
  18. package/dist/lib/types/audit-log.js +0 -1
  19. package/dist/lib/types/auto-moderation.js +0 -1
  20. package/dist/lib/types/channel.d.ts +4 -0
  21. package/dist/lib/types/channel.js +0 -1
  22. package/dist/lib/types/emoji.js +0 -1
  23. package/dist/lib/types/entitlements.js +0 -1
  24. package/dist/lib/types/gateway-events.d.ts +28 -0
  25. package/dist/lib/types/gateway-events.js +0 -1
  26. package/dist/lib/types/guild-scheduled-event.js +0 -1
  27. package/dist/lib/types/guild-template.js +0 -1
  28. package/dist/lib/types/guild.js +0 -1
  29. package/dist/lib/types/index.js +0 -1
  30. package/dist/lib/types/interaction.d.ts +3 -0
  31. package/dist/lib/types/interaction.js +0 -1
  32. package/dist/lib/types/invite.js +0 -1
  33. package/dist/lib/types/message-components.js +0 -1
  34. package/dist/lib/types/poll.d.ts +52 -0
  35. package/dist/lib/types/poll.js +2 -0
  36. package/dist/lib/types/role.js +0 -1
  37. package/dist/lib/types/sku.js +0 -1
  38. package/dist/lib/types/stage-instance.js +0 -1
  39. package/dist/lib/types/sticker.js +0 -1
  40. package/dist/lib/types/team.js +0 -1
  41. package/dist/lib/types/user.js +0 -1
  42. package/dist/lib/types/voice.js +0 -1
  43. package/dist/lib/types/webhook.d.ts +3 -0
  44. package/dist/lib/types/webhook.js +0 -1
  45. package/dist/lib/utils/Util.js +0 -1
  46. package/dist/lib/utils/errors.d.ts +1 -1
  47. package/dist/lib/utils/errors.js +4 -5
  48. package/dist/lib/utils/index.js +0 -1
  49. package/dist/package.json +4 -1
  50. package/package.json +4 -1
  51. package/dist/lib/Client.js.map +0 -1
  52. package/dist/lib/constants.js.map +0 -1
  53. package/dist/lib/gateway/Shard.js.map +0 -1
  54. package/dist/lib/gateway/ShardManager.js.map +0 -1
  55. package/dist/lib/gateway/ShardsManager.d.ts +0 -6
  56. package/dist/lib/gateway/ShardsManager.js +0 -14
  57. package/dist/lib/gateway/ShardsManager.js.map +0 -1
  58. package/dist/lib/gateway/index.js.map +0 -1
  59. package/dist/lib/index.js.map +0 -1
  60. package/dist/lib/rest/CDN.js.map +0 -1
  61. package/dist/lib/rest/Endpoints.js.map +0 -1
  62. package/dist/lib/rest/REST.d.ts +0 -17
  63. package/dist/lib/rest/REST.js +0 -35
  64. package/dist/lib/rest/REST.js.map +0 -1
  65. package/dist/lib/rest/RequestManager.js.map +0 -1
  66. package/dist/lib/rest/RequestsManager.d.ts +0 -22
  67. package/dist/lib/rest/RequestsManager.js +0 -123
  68. package/dist/lib/rest/RequestsManager.js.map +0 -1
  69. package/dist/lib/rest/index.js.map +0 -1
  70. package/dist/lib/structures/Application.d.ts +0 -174
  71. package/dist/lib/structures/Application.js +0 -328
  72. package/dist/lib/structures/Application.js.map +0 -1
  73. package/dist/lib/structures/ApplicationCommand.d.ts +0 -45
  74. package/dist/lib/structures/ApplicationCommand.js +0 -127
  75. package/dist/lib/structures/ApplicationCommand.js.map +0 -1
  76. package/dist/lib/structures/AuditLog.d.ts +0 -19
  77. package/dist/lib/structures/AuditLog.js +0 -101
  78. package/dist/lib/structures/AuditLog.js.map +0 -1
  79. package/dist/lib/structures/AutoModerationRule.d.ts +0 -34
  80. package/dist/lib/structures/AutoModerationRule.js +0 -96
  81. package/dist/lib/structures/AutoModerationRule.js.map +0 -1
  82. package/dist/lib/structures/Base.d.ts +0 -10
  83. package/dist/lib/structures/Base.js +0 -23
  84. package/dist/lib/structures/Base.js.map +0 -1
  85. package/dist/lib/structures/Channel.d.ts +0 -254
  86. package/dist/lib/structures/Channel.js +0 -592
  87. package/dist/lib/structures/Channel.js.map +0 -1
  88. package/dist/lib/structures/ClientApplication.d.ts +0 -150
  89. package/dist/lib/structures/ClientApplication.js +0 -241
  90. package/dist/lib/structures/ClientApplication.js.map +0 -1
  91. package/dist/lib/structures/Emoji.d.ts +0 -26
  92. package/dist/lib/structures/Emoji.js +0 -75
  93. package/dist/lib/structures/Emoji.js.map +0 -1
  94. package/dist/lib/structures/Entitlement.d.ts +0 -24
  95. package/dist/lib/structures/Entitlement.js +0 -68
  96. package/dist/lib/structures/Entitlement.js.map +0 -1
  97. package/dist/lib/structures/Guild.d.ts +0 -474
  98. package/dist/lib/structures/Guild.js +0 -1141
  99. package/dist/lib/structures/Guild.js.map +0 -1
  100. package/dist/lib/structures/GuildMember.d.ts +0 -49
  101. package/dist/lib/structures/GuildMember.js +0 -146
  102. package/dist/lib/structures/GuildMember.js.map +0 -1
  103. package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -49
  104. package/dist/lib/structures/GuildScheduledEvent.js +0 -118
  105. package/dist/lib/structures/GuildScheduledEvent.js.map +0 -1
  106. package/dist/lib/structures/GuildTemplate.d.ts +0 -30
  107. package/dist/lib/structures/GuildTemplate.js +0 -72
  108. package/dist/lib/structures/GuildTemplate.js.map +0 -1
  109. package/dist/lib/structures/IdentifiableBase.d.ts +0 -15
  110. package/dist/lib/structures/IdentifiableBase.js +0 -25
  111. package/dist/lib/structures/IdentifiableBase.js.map +0 -1
  112. package/dist/lib/structures/Integration.d.ts +0 -31
  113. package/dist/lib/structures/Integration.js +0 -103
  114. package/dist/lib/structures/Integration.js.map +0 -1
  115. package/dist/lib/structures/Interaction.d.ts +0 -76
  116. package/dist/lib/structures/Interaction.js +0 -346
  117. package/dist/lib/structures/Interaction.js.map +0 -1
  118. package/dist/lib/structures/Invite.d.ts +0 -26
  119. package/dist/lib/structures/Invite.js +0 -82
  120. package/dist/lib/structures/Invite.js.map +0 -1
  121. package/dist/lib/structures/Message.d.ts +0 -86
  122. package/dist/lib/structures/Message.js +0 -303
  123. package/dist/lib/structures/Message.js.map +0 -1
  124. package/dist/lib/structures/Role.d.ts +0 -37
  125. package/dist/lib/structures/Role.js +0 -90
  126. package/dist/lib/structures/Role.js.map +0 -1
  127. package/dist/lib/structures/SKU.d.ts +0 -23
  128. package/dist/lib/structures/SKU.js +0 -63
  129. package/dist/lib/structures/SKU.js.map +0 -1
  130. package/dist/lib/structures/StageInstance.d.ts +0 -24
  131. package/dist/lib/structures/StageInstance.js +0 -57
  132. package/dist/lib/structures/StageInstance.js.map +0 -1
  133. package/dist/lib/structures/Sticker.d.ts +0 -31
  134. package/dist/lib/structures/Sticker.js +0 -86
  135. package/dist/lib/structures/Sticker.js.map +0 -1
  136. package/dist/lib/structures/Team.d.ts +0 -14
  137. package/dist/lib/structures/Team.js +0 -39
  138. package/dist/lib/structures/Team.js.map +0 -1
  139. package/dist/lib/structures/TestEntitlement.d.ts +0 -23
  140. package/dist/lib/structures/TestEntitlement.js +0 -61
  141. package/dist/lib/structures/TestEntitlement.js.map +0 -1
  142. package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
  143. package/dist/lib/structures/UnavailableGuild.js +0 -25
  144. package/dist/lib/structures/UnavailableGuild.js.map +0 -1
  145. package/dist/lib/structures/User.d.ts +0 -63
  146. package/dist/lib/structures/User.js +0 -177
  147. package/dist/lib/structures/User.js.map +0 -1
  148. package/dist/lib/structures/VoiceState.d.ts +0 -24
  149. package/dist/lib/structures/VoiceState.js +0 -66
  150. package/dist/lib/structures/VoiceState.js.map +0 -1
  151. package/dist/lib/structures/Webhook.d.ts +0 -82
  152. package/dist/lib/structures/Webhook.js +0 -223
  153. package/dist/lib/structures/Webhook.js.map +0 -1
  154. package/dist/lib/structures/index.d.ts +0 -28
  155. package/dist/lib/structures/index.js +0 -45
  156. package/dist/lib/structures/index.js.map +0 -1
  157. package/dist/lib/types/application-command.js.map +0 -1
  158. package/dist/lib/types/application-role-connection-metadata.js.map +0 -1
  159. package/dist/lib/types/application.js.map +0 -1
  160. package/dist/lib/types/audit-log.js.map +0 -1
  161. package/dist/lib/types/auto-moderation.js.map +0 -1
  162. package/dist/lib/types/channel.js.map +0 -1
  163. package/dist/lib/types/emoji.js.map +0 -1
  164. package/dist/lib/types/entitlements.js.map +0 -1
  165. package/dist/lib/types/gateway-events.js.map +0 -1
  166. package/dist/lib/types/guild-scheduled-event.js.map +0 -1
  167. package/dist/lib/types/guild-template.js.map +0 -1
  168. package/dist/lib/types/guild.js.map +0 -1
  169. package/dist/lib/types/index.js.map +0 -1
  170. package/dist/lib/types/interaction.js.map +0 -1
  171. package/dist/lib/types/invite.js.map +0 -1
  172. package/dist/lib/types/message-components.js.map +0 -1
  173. package/dist/lib/types/role.js.map +0 -1
  174. package/dist/lib/types/sku.js.map +0 -1
  175. package/dist/lib/types/stage-instance.js.map +0 -1
  176. package/dist/lib/types/sticker.js.map +0 -1
  177. package/dist/lib/types/team.js.map +0 -1
  178. package/dist/lib/types/user.js.map +0 -1
  179. package/dist/lib/types/voice.js.map +0 -1
  180. package/dist/lib/types/webhook.js.map +0 -1
  181. package/dist/lib/utils/Collection.d.ts +0 -24
  182. package/dist/lib/utils/Collection.js +0 -65
  183. package/dist/lib/utils/Collection.js.map +0 -1
  184. package/dist/lib/utils/Util.js.map +0 -1
  185. package/dist/lib/utils/errors.js.map +0 -1
  186. package/dist/lib/utils/index.js.map +0 -1
@@ -311,6 +311,12 @@ class Shard {
311
311
  case "WEBHOOKS_UPDATE":
312
312
  this.client.emit(constants_1.GatewayEvents.WebhooksUpdate, packet.d.channel_id, packet.d.guild_id);
313
313
  break;
314
+ case "MESSAGE_POLL_VOTE_ADD":
315
+ this.client.emit(constants_1.GatewayEvents.MessagePollVoteAdd, this.client.util.toCamelCase(packet.d));
316
+ break;
317
+ case "MESSAGE_POLL_VOTE_REMOVE":
318
+ this.client.emit(constants_1.GatewayEvents.MessagePollVoteRemove, this.client.util.toCamelCase(packet.d));
319
+ break;
314
320
  }
315
321
  }
316
322
  onWebSocketError(err) {
@@ -323,4 +329,3 @@ class Shard {
323
329
  }
324
330
  }
325
331
  exports.Shard = Shard;
326
- //# sourceMappingURL=Shard.js.map
@@ -10,4 +10,3 @@ class ShardManager extends Map {
10
10
  }
11
11
  }
12
12
  exports.ShardManager = ShardManager;
13
- //# sourceMappingURL=ShardManager.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("./Shard"), exports);
18
18
  __exportStar(require("./ShardManager"), exports);
19
- //# sourceMappingURL=index.js.map
package/dist/lib/index.js CHANGED
@@ -20,4 +20,3 @@ __exportStar(require("./types"), exports);
20
20
  __exportStar(require("./utils"), exports);
21
21
  __exportStar(require("./Client"), exports);
22
22
  __exportStar(require("./constants"), exports);
23
- //# sourceMappingURL=index.js.map
@@ -43,4 +43,3 @@ const userAvatarDecoration = (userId, avatarDecoration) => `https://cdn.discorda
43
43
  exports.userAvatarDecoration = userAvatarDecoration;
44
44
  const userBanner = (userId, banner) => `https://cdn.discordapp.com/banners/${userId}/${banner}.png`;
45
45
  exports.userBanner = userBanner;
46
- //# sourceMappingURL=CDN.js.map
@@ -37,7 +37,7 @@ export declare const guildVoiceState: (guildId: string, userId?: string | "@me")
37
37
  export declare const guildWebhooks: (guildId: string) => `guilds/${string}/webhooks`;
38
38
  export declare const guildWelcomeScreen: (guildId: string) => `guilds/${string}/welcome-screen`;
39
39
  export declare const guildWidgetImage: (guildId: string) => `guilds/${string}/widget.png`;
40
- export declare const guildWidgetJson: (guildId: string) => `guilds/${string}/widget.json`;
40
+ export declare const guildWidgetJSON: (guildId: string) => `guilds/${string}/widget.json`;
41
41
  export declare const guildWidgetSettings: (guildId: string) => `guilds/${string}/widget`;
42
42
  export declare const template: (code: string) => `guilds/templates/${string}`;
43
43
  export declare const channel: (channelId: string) => `channels/${string}`;
@@ -53,11 +53,13 @@ export declare const channelPermission: (channelId: string, overwriteId: string)
53
53
  export declare const channelPin: (channelId: string, messageId: string) => `channels/${string}/pins/${string}`;
54
54
  export declare const channelPins: (channelId: string) => `channels/${string}/pins`;
55
55
  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`;
56
+ export declare const channelThreads: (channelId: string, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/private` | `channels/${string}/threads/archived/public`;
57
57
  export declare const channelTyping: (channelId: string) => `channels/${string}/typing`;
58
58
  export declare const channelWebhooks: (channelId: string) => `channels/${string}/webhooks`;
59
59
  export declare const threads: (channelId: string, messageId?: string) => `channels/${string}/threads`;
60
60
  export declare const threadMembers: (threadId: string, userId?: string | "@me") => `channels/${string}/thread-members` | `channels/${string}/thread-members/${string}`;
61
+ export declare const pollAnswerVoters: (channelId: string, messageId: string, answerId: string) => `channels/${string}/polls/${string}/answers/${string}`;
62
+ export declare const pollExpire: (channelId: string, messageId: string) => `channels/${string}/polls/${string}/expire`;
61
63
  export declare const user: (userId?: string | "@me") => `users/${string}`;
62
64
  export declare const userApplicationRoleConnection: (applicationId: string) => `users/@me/applications/${string}/role-connection`;
63
65
  export declare const userChannels: () => "users/@me/channels";
@@ -1,7 +1,7 @@
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.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.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = void 0;
5
5
  // Guilds
6
6
  const guild = (guildId) => `guilds/${guildId}`;
7
7
  exports.guild = guild;
@@ -81,8 +81,8 @@ const guildWelcomeScreen = (guildId) => `guilds/${guildId}/welcome-screen`;
81
81
  exports.guildWelcomeScreen = guildWelcomeScreen;
82
82
  const guildWidgetImage = (guildId) => `guilds/${guildId}/widget.png`;
83
83
  exports.guildWidgetImage = guildWidgetImage;
84
- const guildWidgetJson = (guildId) => `guilds/${guildId}/widget.json`;
85
- exports.guildWidgetJson = guildWidgetJson;
84
+ const guildWidgetJSON = (guildId) => `guilds/${guildId}/widget.json`;
85
+ exports.guildWidgetJSON = guildWidgetJSON;
86
86
  const guildWidgetSettings = (guildId) => `guilds/${guildId}/widget`;
87
87
  exports.guildWidgetSettings = guildWidgetSettings;
88
88
  const template = (code) => `guilds/templates/${code}`;
@@ -132,6 +132,10 @@ const threadMembers = (threadId, userId) => userId
132
132
  ? `channels/${threadId}/thread-members`
133
133
  : `channels/${threadId}/thread-members/${userId}`;
134
134
  exports.threadMembers = threadMembers;
135
+ const pollAnswerVoters = (channelId, messageId, answerId) => `channels/${channelId}/polls/${messageId}/answers/${answerId}`;
136
+ exports.pollAnswerVoters = pollAnswerVoters;
137
+ const pollExpire = (channelId, messageId) => `channels/${channelId}/polls/${messageId}/expire`;
138
+ exports.pollExpire = pollExpire;
135
139
  // Users
136
140
  const user = (userId = "@me") => `users/${userId}`;
137
141
  exports.user = user;
@@ -208,4 +212,3 @@ const stickerPacks = () => "sticker-packs";
208
212
  exports.stickerPacks = stickerPacks;
209
213
  const voiceRegions = () => "voice/regions";
210
214
  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,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,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,6 +1,7 @@
1
1
  import type { AllowedMentionTypes, AttachmentFlags, ChannelFlags, ChannelTypes, ForumLayoutTypes, InviteTargetTypes, MessageActivityTypes, MessageFlags, MessageTypes, SortOrderTypes, VideoQualityModes } from "../constants";
2
2
  import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData } from ".";
3
3
  import type { File } from "../rest";
4
+ import type { Poll, RawPoll } from "./poll";
4
5
  /** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
5
6
  export interface RawChannel {
6
7
  id: string;
@@ -73,6 +74,7 @@ export interface RawMessage {
73
74
  position?: number;
74
75
  role_subscription_data?: RawRoleSubscriptionData;
75
76
  resolved?: RawResolvedData;
77
+ poll?: RawPoll;
76
78
  }
77
79
  /** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
78
80
  export interface RawMessageActivity {
@@ -310,6 +312,7 @@ export interface Message {
310
312
  position?: number;
311
313
  roleSubscriptionData?: RoleSubscriptionData;
312
314
  resolved?: ResolvedData;
315
+ poll?: Poll;
313
316
  }
314
317
  export interface MessageActivity {
315
318
  type: MessageActivityTypes;
@@ -495,6 +498,7 @@ export interface CreateMessageParams {
495
498
  attachments?: Array<Attachment>;
496
499
  flags?: MessageFlags;
497
500
  enforceNonce?: boolean;
501
+ poll?: Poll;
498
502
  }
499
503
  export interface EditMessageParams {
500
504
  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
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=guild.js.map
@@ -37,4 +37,3 @@ __exportStar(require("./team"), exports);
37
37
  __exportStar(require("./user"), exports);
38
38
  __exportStar(require("./voice"), exports);
39
39
  __exportStar(require("./webhook"), exports);
40
- //# sourceMappingURL=index.js.map
@@ -1,6 +1,7 @@
1
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 ".";
2
2
  import type { ApplicationCommandOptionType, ApplicationCommandTypes, ComponentTypes, InteractionCallbackType, InteractionType, MessageFlags } from "../constants";
3
3
  import type { File } from "../rest";
4
+ import type { Poll, RawPoll } from "./poll";
4
5
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */
5
6
  export interface RawInteraction {
6
7
  id: string;
@@ -84,6 +85,7 @@ export interface RawInteractionCallbackData {
84
85
  flags?: MessageFlags;
85
86
  components?: Array<RawActionRow>;
86
87
  attachments?: Array<RawAttachment>;
88
+ poll?: RawPoll;
87
89
  files?: Array<File>;
88
90
  choices?: Array<RawApplicationCommandOptionChoice>;
89
91
  custom_id?: string;
@@ -163,6 +165,7 @@ export interface InteractionCallbackData {
163
165
  flags?: MessageFlags;
164
166
  components?: Array<ActionRow>;
165
167
  attachments?: Array<Attachment>;
168
+ poll?: Poll;
166
169
  files?: Array<File>;
167
170
  choices?: Array<ApplicationCommandOptionChoice>;
168
171
  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,52 @@
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 Poll {
29
+ question: PollMedia;
30
+ answers: Array<PollAnswer>;
31
+ expiry: string;
32
+ allowMultiselect: boolean;
33
+ layoutType: LayoutType;
34
+ results: PollResults;
35
+ }
36
+ export interface PollMedia {
37
+ text?: string;
38
+ emoji?: Pick<Emoji, "id" | "name">;
39
+ }
40
+ export interface PollAnswer {
41
+ answerId: number;
42
+ pollMedia: PollMedia;
43
+ }
44
+ export interface PollResults {
45
+ isFinalized: boolean;
46
+ answerCounts: Array<PollAnswerCount>;
47
+ }
48
+ export interface PollAnswerCount {
49
+ id: number;
50
+ count: number;
51
+ meVoted: boolean;
52
+ }
@@ -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,6 +1,7 @@
1
1
  import type { MessageFlags, WebhookTypes } from "../constants";
2
2
  import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser } from ".";
3
3
  import type { File } from "../rest";
4
+ import type { Poll } from "./poll";
4
5
  /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
5
6
  export interface RawWebhook {
6
7
  id: string;
@@ -51,6 +52,8 @@ export interface ExecuteWebhookParams {
51
52
  attachments?: Array<Attachment> | null;
52
53
  flags?: MessageFlags | null;
53
54
  threadName?: string;
55
+ appliedTags?: Array<string>;
56
+ poll?: Poll;
54
57
  }
55
58
  export interface EditWebhookMessageParams {
56
59
  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.c430b6f",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -25,6 +25,9 @@
25
25
  "@types/node": "^20.11.25",
26
26
  "@types/ws": "^8.5.10",
27
27
  "node": "^21.7.1",
28
+ "typescript": "^5.4.2"
29
+ },
30
+ "dependencies": {
28
31
  "ws": "^8.16.0"
29
32
  }
30
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.0.0",
3
+ "version": "2.1.0-dev.c430b6f",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -25,6 +25,9 @@
25
25
  "@types/node": "^20.11.25",
26
26
  "@types/ws": "^8.5.10",
27
27
  "node": "^21.7.1",
28
+ "typescript": "^5.4.2"
29
+ },
30
+ "dependencies": {
28
31
  "ws": "^8.16.0"
29
32
  }
30
33
  }