oceanic.js 1.10.1-dev.97cef9c → 1.10.1-dev.9b37972

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 (204) hide show
  1. package/dist/package.json +5 -5
  2. package/esm.mjs +2 -0
  3. package/package.json +5 -5
  4. package/dist/lib/Client.d.ts +0 -91
  5. package/dist/lib/Client.js +0 -254
  6. package/dist/lib/Constants.d.ts +0 -1121
  7. package/dist/lib/Constants.js +0 -1401
  8. package/dist/lib/gateway/Shard.d.ts +0 -77
  9. package/dist/lib/gateway/Shard.js +0 -1582
  10. package/dist/lib/gateway/ShardManager.d.ts +0 -26
  11. package/dist/lib/gateway/ShardManager.js +0 -304
  12. package/dist/lib/index.d.ts +0 -83
  13. package/dist/lib/index.js +0 -166
  14. package/dist/lib/rest/Bucket.d.ts +0 -33
  15. package/dist/lib/rest/Bucket.js +0 -78
  16. package/dist/lib/rest/DiscordHTTPError.d.ts +0 -16
  17. package/dist/lib/rest/DiscordHTTPError.js +0 -65
  18. package/dist/lib/rest/DiscordRESTError.d.ts +0 -19
  19. package/dist/lib/rest/DiscordRESTError.js +0 -89
  20. package/dist/lib/rest/OAuthHelper.d.ts +0 -60
  21. package/dist/lib/rest/OAuthHelper.js +0 -180
  22. package/dist/lib/rest/RESTManager.d.ts +0 -42
  23. package/dist/lib/rest/RESTManager.js +0 -82
  24. package/dist/lib/rest/RequestHandler.d.ts +0 -28
  25. package/dist/lib/rest/RequestHandler.js +0 -313
  26. package/dist/lib/rest/SequentialBucket.d.ts +0 -25
  27. package/dist/lib/rest/SequentialBucket.js +0 -76
  28. package/dist/lib/routes/Applications.d.ts +0 -171
  29. package/dist/lib/routes/Applications.js +0 -447
  30. package/dist/lib/routes/Channels.d.ts +0 -391
  31. package/dist/lib/routes/Channels.js +0 -1107
  32. package/dist/lib/routes/Guilds.d.ts +0 -606
  33. package/dist/lib/routes/Guilds.js +0 -1669
  34. package/dist/lib/routes/Interactions.d.ts +0 -74
  35. package/dist/lib/routes/Interactions.js +0 -141
  36. package/dist/lib/routes/Miscellaneous.d.ts +0 -25
  37. package/dist/lib/routes/Miscellaneous.js +0 -54
  38. package/dist/lib/routes/OAuth.d.ts +0 -105
  39. package/dist/lib/routes/OAuth.js +0 -309
  40. package/dist/lib/routes/Users.d.ts +0 -32
  41. package/dist/lib/routes/Users.js +0 -59
  42. package/dist/lib/routes/Webhooks.d.ts +0 -128
  43. package/dist/lib/routes/Webhooks.js +0 -264
  44. package/dist/lib/structures/AnnouncementChannel.d.ts +0 -36
  45. package/dist/lib/structures/AnnouncementChannel.js +0 -47
  46. package/dist/lib/structures/AnnouncementThreadChannel.d.ts +0 -18
  47. package/dist/lib/structures/AnnouncementThreadChannel.js +0 -27
  48. package/dist/lib/structures/Application.d.ts +0 -68
  49. package/dist/lib/structures/Application.js +0 -178
  50. package/dist/lib/structures/ApplicationCommand.d.ts +0 -74
  51. package/dist/lib/structures/ApplicationCommand.js +0 -141
  52. package/dist/lib/structures/Attachment.d.ts +0 -34
  53. package/dist/lib/structures/Attachment.js +0 -64
  54. package/dist/lib/structures/AuditLogEntry.d.ts +0 -25
  55. package/dist/lib/structures/AuditLogEntry.js +0 -53
  56. package/dist/lib/structures/AutoModerationRule.d.ts +0 -49
  57. package/dist/lib/structures/AutoModerationRule.js +0 -139
  58. package/dist/lib/structures/AutocompleteInteraction.d.ts +0 -62
  59. package/dist/lib/structures/AutocompleteInteraction.js +0 -115
  60. package/dist/lib/structures/Base.d.ts +0 -20
  61. package/dist/lib/structures/Base.js +0 -58
  62. package/dist/lib/structures/BaseEntitlement.d.ts +0 -19
  63. package/dist/lib/structures/BaseEntitlement.js +0 -44
  64. package/dist/lib/structures/CategoryChannel.d.ts +0 -41
  65. package/dist/lib/structures/CategoryChannel.js +0 -105
  66. package/dist/lib/structures/Channel.d.ts +0 -20
  67. package/dist/lib/structures/Channel.js +0 -91
  68. package/dist/lib/structures/ClientApplication.d.ts +0 -153
  69. package/dist/lib/structures/ClientApplication.js +0 -220
  70. package/dist/lib/structures/CommandInteraction.d.ts +0 -127
  71. package/dist/lib/structures/CommandInteraction.js +0 -297
  72. package/dist/lib/structures/ComponentInteraction.d.ts +0 -137
  73. package/dist/lib/structures/ComponentInteraction.js +0 -311
  74. package/dist/lib/structures/Entitlement.d.ts +0 -12
  75. package/dist/lib/structures/Entitlement.js +0 -26
  76. package/dist/lib/structures/ExtendedUser.d.ts +0 -26
  77. package/dist/lib/structures/ExtendedUser.js +0 -57
  78. package/dist/lib/structures/ForumChannel.d.ts +0 -11
  79. package/dist/lib/structures/ForumChannel.js +0 -19
  80. package/dist/lib/structures/GroupChannel.d.ts +0 -62
  81. package/dist/lib/structures/GroupChannel.js +0 -133
  82. package/dist/lib/structures/Guild.d.ts +0 -654
  83. package/dist/lib/structures/Guild.js +0 -1319
  84. package/dist/lib/structures/GuildChannel.d.ts +0 -34
  85. package/dist/lib/structures/GuildChannel.js +0 -75
  86. package/dist/lib/structures/GuildPreview.d.ts +0 -50
  87. package/dist/lib/structures/GuildPreview.js +0 -119
  88. package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -60
  89. package/dist/lib/structures/GuildScheduledEvent.js +0 -154
  90. package/dist/lib/structures/GuildTemplate.d.ts +0 -55
  91. package/dist/lib/structures/GuildTemplate.js +0 -126
  92. package/dist/lib/structures/Integration.d.ts +0 -54
  93. package/dist/lib/structures/Integration.js +0 -156
  94. package/dist/lib/structures/Interaction.d.ts +0 -40
  95. package/dist/lib/structures/Interaction.js +0 -91
  96. package/dist/lib/structures/InteractionResolvedChannel.d.ts +0 -28
  97. package/dist/lib/structures/InteractionResolvedChannel.js +0 -45
  98. package/dist/lib/structures/Invite.d.ts +0 -64
  99. package/dist/lib/structures/Invite.js +0 -193
  100. package/dist/lib/structures/InviteGuild.d.ts +0 -52
  101. package/dist/lib/structures/InviteGuild.js +0 -88
  102. package/dist/lib/structures/MediaChannel.d.ts +0 -11
  103. package/dist/lib/structures/MediaChannel.js +0 -19
  104. package/dist/lib/structures/Member.d.ts +0 -122
  105. package/dist/lib/structures/Member.js +0 -255
  106. package/dist/lib/structures/Message.d.ts +0 -183
  107. package/dist/lib/structures/Message.js +0 -455
  108. package/dist/lib/structures/ModalSubmitInteraction.d.ts +0 -128
  109. package/dist/lib/structures/ModalSubmitInteraction.js +0 -240
  110. package/dist/lib/structures/OAuthApplication.d.ts +0 -79
  111. package/dist/lib/structures/OAuthApplication.js +0 -210
  112. package/dist/lib/structures/OAuthGuild.d.ts +0 -35
  113. package/dist/lib/structures/OAuthGuild.js +0 -61
  114. package/dist/lib/structures/PartialApplication.d.ts +0 -30
  115. package/dist/lib/structures/PartialApplication.js +0 -67
  116. package/dist/lib/structures/Permission.d.ts +0 -21
  117. package/dist/lib/structures/Permission.js +0 -68
  118. package/dist/lib/structures/PermissionOverwrite.d.ts +0 -26
  119. package/dist/lib/structures/PermissionOverwrite.js +0 -49
  120. package/dist/lib/structures/PingInteraction.d.ts +0 -16
  121. package/dist/lib/structures/PingInteraction.js +0 -26
  122. package/dist/lib/structures/PrivateChannel.d.ts +0 -90
  123. package/dist/lib/structures/PrivateChannel.js +0 -131
  124. package/dist/lib/structures/PrivateThreadChannel.d.ts +0 -18
  125. package/dist/lib/structures/PrivateThreadChannel.js +0 -27
  126. package/dist/lib/structures/PublicThreadChannel.d.ts +0 -21
  127. package/dist/lib/structures/PublicThreadChannel.js +0 -37
  128. package/dist/lib/structures/Role.d.ts +0 -50
  129. package/dist/lib/structures/Role.js +0 -131
  130. package/dist/lib/structures/SKU.d.ts +0 -32
  131. package/dist/lib/structures/SKU.js +0 -53
  132. package/dist/lib/structures/StageChannel.d.ts +0 -33
  133. package/dist/lib/structures/StageChannel.js +0 -44
  134. package/dist/lib/structures/StageInstance.d.ts +0 -36
  135. package/dist/lib/structures/StageInstance.js +0 -94
  136. package/dist/lib/structures/Team.d.ts +0 -22
  137. package/dist/lib/structures/Team.js +0 -67
  138. package/dist/lib/structures/TestEntitlement.d.ts +0 -10
  139. package/dist/lib/structures/TestEntitlement.js +0 -21
  140. package/dist/lib/structures/TextChannel.d.ts +0 -34
  141. package/dist/lib/structures/TextChannel.js +0 -46
  142. package/dist/lib/structures/TextableChannel.d.ts +0 -158
  143. package/dist/lib/structures/TextableChannel.js +0 -276
  144. package/dist/lib/structures/TextableVoiceChannel.d.ts +0 -39
  145. package/dist/lib/structures/TextableVoiceChannel.js +0 -81
  146. package/dist/lib/structures/ThreadChannel.d.ts +0 -159
  147. package/dist/lib/structures/ThreadChannel.js +0 -295
  148. package/dist/lib/structures/ThreadOnlyChannel.d.ts +0 -99
  149. package/dist/lib/structures/ThreadOnlyChannel.js +0 -233
  150. package/dist/lib/structures/ThreadableChannel.d.ts +0 -36
  151. package/dist/lib/structures/ThreadableChannel.js +0 -58
  152. package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
  153. package/dist/lib/structures/UnavailableGuild.js +0 -21
  154. package/dist/lib/structures/User.d.ts +0 -82
  155. package/dist/lib/structures/User.js +0 -168
  156. package/dist/lib/structures/VoiceChannel.d.ts +0 -20
  157. package/dist/lib/structures/VoiceChannel.js +0 -35
  158. package/dist/lib/structures/VoiceState.d.ts +0 -51
  159. package/dist/lib/structures/VoiceState.js +0 -140
  160. package/dist/lib/structures/Webhook.d.ts +0 -129
  161. package/dist/lib/structures/Webhook.js +0 -206
  162. package/dist/lib/types/applications.d.ts +0 -448
  163. package/dist/lib/types/audit-log.d.ts +0 -121
  164. package/dist/lib/types/auto-moderation.d.ts +0 -99
  165. package/dist/lib/types/channels.d.ts +0 -1150
  166. package/dist/lib/types/client.d.ts +0 -228
  167. package/dist/lib/types/events.d.ts +0 -260
  168. package/dist/lib/types/gateway-raw.d.ts +0 -567
  169. package/dist/lib/types/gateway.d.ts +0 -338
  170. package/dist/lib/types/guild-template.d.ts +0 -33
  171. package/dist/lib/types/guilds.d.ts +0 -854
  172. package/dist/lib/types/index.d.ts +0 -18
  173. package/dist/lib/types/interactions.d.ts +0 -376
  174. package/dist/lib/types/json.d.ts +0 -709
  175. package/dist/lib/types/misc.d.ts +0 -13
  176. package/dist/lib/types/oauth.d.ts +0 -201
  177. package/dist/lib/types/request-handler.d.ts +0 -52
  178. package/dist/lib/types/scheduled-events.d.ts +0 -88
  179. package/dist/lib/types/shared.d.ts +0 -9
  180. package/dist/lib/types/users.d.ts +0 -45
  181. package/dist/lib/types/voice.d.ts +0 -45
  182. package/dist/lib/types/webhooks.d.ts +0 -73
  183. package/dist/lib/util/Collection.d.ts +0 -47
  184. package/dist/lib/util/Collection.js +0 -78
  185. package/dist/lib/util/Errors.d.ts +0 -29
  186. package/dist/lib/util/Errors.js +0 -56
  187. package/dist/lib/util/Routes.d.ts +0 -124
  188. package/dist/lib/util/Routes.js +0 -243
  189. package/dist/lib/util/SimpleCollection.d.ts +0 -12
  190. package/dist/lib/util/SimpleCollection.js +0 -81
  191. package/dist/lib/util/TypedCollection.d.ts +0 -24
  192. package/dist/lib/util/TypedCollection.js +0 -76
  193. package/dist/lib/util/TypedEmitter.d.ts +0 -19
  194. package/dist/lib/util/TypedEmitter.js +0 -19
  195. package/dist/lib/util/Util.d.ts +0 -52
  196. package/dist/lib/util/Util.js +0 -469
  197. package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +0 -170
  198. package/dist/lib/util/interactions/InteractionOptionsWrapper.js +0 -213
  199. package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +0 -24
  200. package/dist/lib/util/interactions/MessageInteractionResponse.js +0 -28
  201. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +0 -24
  202. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +0 -34
  203. package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +0 -60
  204. package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +0 -124
@@ -1,74 +0,0 @@
1
- /** @module REST/Interactions */
2
- import type { InteractionContent, InteractionResponse } from "../types/interactions";
3
- import type RESTManager from "../rest/RESTManager";
4
- import type Message from "../structures/Message";
5
- import type { AnyTextableChannel } from "../types/channels";
6
- import type { Uncached } from "../types/shared";
7
- /** Various methods for interacting with interactions. Located at {@link Client#rest | Client#rest}{@link RESTManager#interactions | .interactions}. */
8
- export default class Interactions {
9
- #private;
10
- constructor(manager: RESTManager);
11
- /**
12
- * Create a followup message.
13
- * @param applicationID The ID of the application.
14
- * @param interactionToken The token of the interaction.
15
- * @param options The options for creating the followup message.
16
- * @caching This method **does not** cache its result.
17
- */
18
- createFollowupMessage<T extends AnyTextableChannel | Uncached>(applicationID: string, interactionToken: string, options: InteractionContent): Promise<Message<T>>;
19
- /**
20
- * Create an initial interaction response.
21
- * @param interactionID The ID of the interaction.
22
- * @param interactionToken The token of the interaction.
23
- * @param options The options for creating the interaction response.
24
- * @caching This method **does not** cache its result.
25
- */
26
- createInteractionResponse(interactionID: string, interactionToken: string, options: InteractionResponse): Promise<void>;
27
- /**
28
- * Delete a follow-up message.
29
- * @param applicationID The ID of the application.
30
- * @param interactionToken The token of the interaction.
31
- * @param messageID The ID of the message.
32
- * @caching This method **does not** cache its result.
33
- */
34
- deleteFollowupMessage(applicationID: string, interactionToken: string, messageID: string): Promise<void>;
35
- /**
36
- * Delete the original interaction response.
37
- * @param applicationID The ID of the application.
38
- * @param interactionToken The token of the interaction.
39
- * @caching This method **does not** cache its result.
40
- */
41
- deleteOriginalMessage(applicationID: string, interactionToken: string): Promise<void>;
42
- /**
43
- * Edit a followup message.
44
- * @param applicationID The ID of the application.
45
- * @param interactionToken The token of the interaction.
46
- * @param messageID The ID of the message.
47
- * @param options The options for editing the followup message.
48
- * @caching This method **does not** cache its result.
49
- */
50
- editFollowupMessage<T extends AnyTextableChannel | Uncached>(applicationID: string, interactionToken: string, messageID: string, options: InteractionContent): Promise<Message<T>>;
51
- /**
52
- * Edit an original interaction response.
53
- * @param applicationID The ID of the application.
54
- * @param interactionToken The token of the interaction.
55
- * @param options The options for editing the original message.
56
- * @caching This method **does not** cache its result.
57
- */
58
- editOriginalMessage<T extends AnyTextableChannel | Uncached>(applicationID: string, interactionToken: string, options: InteractionContent): Promise<Message<T>>;
59
- /**
60
- * Get a followup message.
61
- * @param applicationID The ID of the application.
62
- * @param interactionToken The token of the interaction.
63
- * @param messageID The ID of the message.
64
- * @caching This method **does not** cache its result.
65
- */
66
- getFollowupMessage<T extends AnyTextableChannel | Uncached>(applicationID: string, interactionToken: string, messageID: string): Promise<Message<T>>;
67
- /**
68
- * Get an original interaction response.
69
- * @param applicationID The ID of the application.
70
- * @param interactionToken The token of the interaction.
71
- * @caching This method **does not** cache its result.
72
- */
73
- getOriginalMessage<T extends AnyTextableChannel | Uncached>(applicationID: string, interactionToken: string): Promise<Message<T>>;
74
- }
@@ -1,141 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const Routes = tslib_1.__importStar(require("../util/Routes"));
5
- const Constants_1 = require("../Constants");
6
- /** Various methods for interacting with interactions. Located at {@link Client#rest | Client#rest}{@link RESTManager#interactions | .interactions}. */
7
- class Interactions {
8
- #manager;
9
- constructor(manager) {
10
- this.#manager = manager;
11
- }
12
- /**
13
- * Create a followup message.
14
- * @param applicationID The ID of the application.
15
- * @param interactionToken The token of the interaction.
16
- * @param options The options for creating the followup message.
17
- * @caching This method **does not** cache its result.
18
- */
19
- async createFollowupMessage(applicationID, interactionToken, options) {
20
- return this.#manager.webhooks.execute(applicationID, interactionToken, options);
21
- }
22
- /**
23
- * Create an initial interaction response.
24
- * @param interactionID The ID of the interaction.
25
- * @param interactionToken The token of the interaction.
26
- * @param options The options for creating the interaction response.
27
- * @caching This method **does not** cache its result.
28
- */
29
- async createInteractionResponse(interactionID, interactionToken, options) {
30
- let data;
31
- switch (options.type) {
32
- case Constants_1.InteractionResponseTypes.PONG: {
33
- break;
34
- }
35
- case Constants_1.InteractionResponseTypes.CHANNEL_MESSAGE_WITH_SOURCE:
36
- case Constants_1.InteractionResponseTypes.UPDATE_MESSAGE: {
37
- data = {
38
- allowed_mentions: this.#manager.client.util.formatAllowedMentions(options.data.allowedMentions),
39
- attachments: options.data.attachments,
40
- content: options.data.content,
41
- components: options.data.components ? this.#manager.client.util.componentsToRaw(options.data.components) : undefined,
42
- embeds: options.data.embeds ? this.#manager.client.util.embedsToRaw(options.data.embeds) : undefined,
43
- flags: options.data.flags
44
- };
45
- break;
46
- }
47
- case Constants_1.InteractionResponseTypes.APPLICATION_COMMAND_AUTOCOMPLETE_RESULT: {
48
- data = {
49
- choices: options.data.choices.map(d => ({
50
- name: d.name,
51
- name_localizations: d.nameLocalizations,
52
- value: d.value
53
- }))
54
- };
55
- break;
56
- }
57
- case Constants_1.InteractionResponseTypes.MODAL: {
58
- data = {
59
- custom_id: options.data.customID,
60
- components: this.#manager.client.util.componentsToRaw(options.data.components),
61
- title: options.data.title
62
- };
63
- break;
64
- }
65
- default: {
66
- data = options.data;
67
- break;
68
- }
69
- }
70
- await this.#manager.authRequest({
71
- method: "POST",
72
- path: Routes.INTERACTION_CALLBACK(interactionID, interactionToken),
73
- route: "/interactions/:id/:token/callback",
74
- json: {
75
- data,
76
- type: options.type
77
- }
78
- });
79
- }
80
- /**
81
- * Delete a follow-up message.
82
- * @param applicationID The ID of the application.
83
- * @param interactionToken The token of the interaction.
84
- * @param messageID The ID of the message.
85
- * @caching This method **does not** cache its result.
86
- */
87
- async deleteFollowupMessage(applicationID, interactionToken, messageID) {
88
- await this.#manager.webhooks.deleteMessage(applicationID, interactionToken, messageID);
89
- }
90
- /**
91
- * Delete the original interaction response.
92
- * @param applicationID The ID of the application.
93
- * @param interactionToken The token of the interaction.
94
- * @caching This method **does not** cache its result.
95
- */
96
- async deleteOriginalMessage(applicationID, interactionToken) {
97
- await this.deleteFollowupMessage(applicationID, interactionToken, "@original");
98
- }
99
- /**
100
- * Edit a followup message.
101
- * @param applicationID The ID of the application.
102
- * @param interactionToken The token of the interaction.
103
- * @param messageID The ID of the message.
104
- * @param options The options for editing the followup message.
105
- * @caching This method **does not** cache its result.
106
- */
107
- async editFollowupMessage(applicationID, interactionToken, messageID, options) {
108
- return this.#manager.webhooks.editMessage(applicationID, interactionToken, messageID, options);
109
- }
110
- /**
111
- * Edit an original interaction response.
112
- * @param applicationID The ID of the application.
113
- * @param interactionToken The token of the interaction.
114
- * @param options The options for editing the original message.
115
- * @caching This method **does not** cache its result.
116
- */
117
- async editOriginalMessage(applicationID, interactionToken, options) {
118
- return this.editFollowupMessage(applicationID, interactionToken, "@original", options);
119
- }
120
- /**
121
- * Get a followup message.
122
- * @param applicationID The ID of the application.
123
- * @param interactionToken The token of the interaction.
124
- * @param messageID The ID of the message.
125
- * @caching This method **does not** cache its result.
126
- */
127
- async getFollowupMessage(applicationID, interactionToken, messageID) {
128
- return this.#manager.webhooks.getMessage(applicationID, interactionToken, messageID);
129
- }
130
- /**
131
- * Get an original interaction response.
132
- * @param applicationID The ID of the application.
133
- * @param interactionToken The token of the interaction.
134
- * @caching This method **does not** cache its result.
135
- */
136
- async getOriginalMessage(applicationID, interactionToken) {
137
- return this.getFollowupMessage(applicationID, interactionToken, "@original");
138
- }
139
- }
140
- exports.default = Interactions;
141
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW50ZXJhY3Rpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3JvdXRlcy9JbnRlcmFjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBR0EsK0RBQXlDO0FBQ3pDLDRDQUF3RDtBQU14RCx1SkFBdUo7QUFDdkosTUFBcUIsWUFBWTtJQUM3QixRQUFRLENBQWM7SUFDdEIsWUFBWSxPQUFvQjtRQUM1QixJQUFJLENBQUMsUUFBUSxHQUFHLE9BQU8sQ0FBQztJQUM1QixDQUFDO0lBRUQ7Ozs7OztPQU1HO0lBQ0gsS0FBSyxDQUFDLHFCQUFxQixDQUEwQyxhQUFxQixFQUFFLGdCQUF3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QztJQUN0RyxDQUFDO0lBRUQ7Ozs7OztPQU1HO0lBQ0gsS0FBSyxDQUFDLG1CQUFtQixDQUEwQyxhQUFxQixFQUFFLGdCQUF3QixFQUFFLE9BQTJCO1FBQzNJLE9BQU8sSUFBSSxDQUFDLG1CQUFtQixDQUFJLGFBQWEsRUFBRSxnQkFBZ0IsRUFBRSxXQUFXLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDOUYsQ0FBQztJQUVEOzs7Ozs7T0FNRztJQUNILEtBQUssQ0FBQyxrQkFBa0IsQ0FBMEMsYUFBcUIsRUFBRSxnQkFBd0IsRUFBRSxTQUFpQjtRQUNoSSxPQUFPLElBQUksQ0FBQyxRQUFRLENBQUMsUUFBUSxDQUFDLFVBQVUsQ0FBSSxhQUFhLEVBQUUsZ0JBQWdCLEVBQUUsU0FBUyxDQUFDLENBQUM7SUFDNUYsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0gsS0FBSyxDQUFDLGtCQUFrQixDQUEwQyxhQUFxQixFQUFFLGdCQUF3QjtRQUM3RyxPQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxhQUFhLEVBQUUsZ0JBQWdCLEVBQUUsV0FBVyxDQUFDLENBQUM7SUFDakYsQ0FBQztDQUNKO0FBL0lELCtCQStJQyJ9
@@ -1,25 +0,0 @@
1
- import type RESTManager from "../rest/RESTManager";
2
- import type { Sticker, StickerPack } from "../types/guilds";
3
- import type { VoiceRegion } from "../types/voice";
4
- /** Methods that don't fit anywhere else. Located at {@link Client#rest | Client#rest}{@link RESTManager#misc | .misc}. */
5
- export default class Miscellaneous {
6
- #private;
7
- constructor(manager: RESTManager);
8
- /**
9
- * Get a sticker.
10
- * @param stickerID The ID of the sticker to get.
11
- * @caching This method **may** cache its result. The result will not be cached if the guild is not cached, or if the sticker is not a guild sticker.
12
- * @caches {@link Guild#stickers | Guild#stickers}
13
- */
14
- getSticker(stickerID: string): Promise<Sticker>;
15
- /**
16
- * Get the default sticker packs.
17
- * @caching This method **does not** cache its result.
18
- */
19
- getStickerPacks(): Promise<Array<StickerPack>>;
20
- /**
21
- * Get the list of usable voice regions.
22
- * @caching This method **does not** cache its result.
23
- */
24
- getVoiceRegions(): Promise<Array<VoiceRegion>>;
25
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /** @module REST/Miscellaneous */
5
- const Routes = tslib_1.__importStar(require("../util/Routes"));
6
- /** Methods that don't fit anywhere else. Located at {@link Client#rest | Client#rest}{@link RESTManager#misc | .misc}. */
7
- class Miscellaneous {
8
- #manager;
9
- constructor(manager) {
10
- this.#manager = manager;
11
- }
12
- /**
13
- * Get a sticker.
14
- * @param stickerID The ID of the sticker to get.
15
- * @caching This method **may** cache its result. The result will not be cached if the guild is not cached, or if the sticker is not a guild sticker.
16
- * @caches {@link Guild#stickers | Guild#stickers}
17
- */
18
- async getSticker(stickerID) {
19
- return this.#manager.authRequest({
20
- method: "GET",
21
- path: Routes.STICKER(stickerID)
22
- }).then(data => data.guild_id === undefined ? this.#manager.client.util.convertSticker(data) : this.#manager.client.guilds.get(data.guild_id)?.stickers.update(data) ?? this.#manager.client.util.convertSticker(data));
23
- }
24
- /**
25
- * Get the default sticker packs.
26
- * @caching This method **does not** cache its result.
27
- */
28
- async getStickerPacks() {
29
- return this.#manager.authRequest({
30
- method: "GET",
31
- path: Routes.STICKER_PACKS
32
- }).then(data => data.sticker_packs.map(pack => ({
33
- bannerAssetID: pack.banner_asset_id,
34
- coverStickerID: pack.cover_sticker_id,
35
- description: pack.description,
36
- id: pack.id,
37
- name: pack.name,
38
- skuID: pack.sku_id,
39
- stickers: pack.stickers.map(sticker => this.#manager.client.util.convertSticker(sticker))
40
- })));
41
- }
42
- /**
43
- * Get the list of usable voice regions.
44
- * @caching This method **does not** cache its result.
45
- */
46
- async getVoiceRegions() {
47
- return this.#manager.authRequest({
48
- method: "GET",
49
- path: Routes.VOICE_REGIONS
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,105 +0,0 @@
1
- /** @module REST/OAuth */
2
- import type { AuthorizationInformation, ClientCredentialsTokenOptions, ClientCredentialsTokenResponse, Connection, ExchangeCodeOptions, ExchangeCodeResponse, RefreshTokenOptions, RefreshTokenResponse, RevokeTokenOptions, GetCurrentGuildsOptions, RoleConnectionMetadata, RoleConnection } from "../types/oauth";
3
- import OAuthApplication from "../structures/OAuthApplication";
4
- import Member from "../structures/Member";
5
- import type RESTManager from "../rest/RESTManager";
6
- import OAuthHelper from "../rest/OAuthHelper";
7
- import OAuthGuild from "../structures/OAuthGuild";
8
- import ExtendedUser from "../structures/ExtendedUser";
9
- import type { UpdateUserApplicationRoleConnectionOptions } from "../types";
10
- /** Various methods for interacting with oauth. Located at {@link Client#rest | Client#rest}{@link RESTManager#oauth | .oauth}. */
11
- export default class OAuth {
12
- #private;
13
- constructor(manager: RESTManager);
14
- /**
15
- * Get an access token for the application owner. If the application is owned by a team, this is restricted to `identify` & `applications.commands.update`.
16
- * @param options The options to for the client credentials grant.
17
- * @caching This method **does not** cache its result.
18
- */
19
- clientCredentialsGrant(options: ClientCredentialsTokenOptions): Promise<ClientCredentialsTokenResponse>;
20
- /**
21
- * Exchange a code for an access token.
22
- * @param options The options for exchanging the code.
23
- * @caching This method **does not** cache its result.
24
- */
25
- exchangeCode(options: ExchangeCodeOptions): Promise<ExchangeCodeResponse>;
26
- /**
27
- * Get the current OAuth2 application's information.
28
- * @caching This method **does not** cache its result.
29
- */
30
- getApplication(): Promise<OAuthApplication>;
31
- /**
32
- * Get information about the current authorization.
33
- *
34
- * Note: OAuth only. Bots cannot use this.
35
- * @caching This method **does** cache part its result.
36
- * @caches {@link Client#users | Client#users}
37
- */
38
- getCurrentAuthorizationInformation(): Promise<AuthorizationInformation>;
39
- /**
40
- * Get the connections of the currently authenticated user.
41
- *
42
- * Note: Requires the `connections` scope when using oauth.
43
- * @caching This method **does not** cache its result.
44
- */
45
- getCurrentConnections(): Promise<Array<Connection>>;
46
- /**
47
- * Get the guild member information about the currently authenticated user.
48
- *
49
- * Note: OAuth only. Requires the `guilds.members.read` scope. Bots cannot use this.
50
- * @param guild the ID of the guild
51
- * @caching This method **does not** cache its result.
52
- */
53
- getCurrentGuildMember(guild: string): Promise<Member>;
54
- /**
55
- * Get the currently authenticated user's guilds. Note these are missing several properties gateway guilds have.
56
- * @param options The options for getting the current user's guilds.
57
- * @caching This method **does not** cache its result.
58
- */
59
- getCurrentGuilds(options?: GetCurrentGuildsOptions): Promise<Array<OAuthGuild>>;
60
- /**
61
- * Get the currently authenticated user's information.
62
- * @caching This method **does not** cache its result.
63
- */
64
- getCurrentUser(): Promise<ExtendedUser>;
65
- /** Get a helper instance that can be used with a specific bearer token. */
66
- getHelper(token: string): OAuthHelper;
67
- /**
68
- * Get an application's role connection metadata records.
69
- * @param applicationID The ID of the application.
70
- * @caching This method **does not** cache its result.
71
- */
72
- getRoleConnectionsMetadata(applicationID: string): Promise<Array<RoleConnectionMetadata>>;
73
- /**
74
- * Get the authenticated user's role connection object for an application. This requires the `role_connections.write` scope.
75
- * @param applicationID The ID of the application.
76
- * @caching This method **does not** cache its result.
77
- */
78
- getUserRoleConnection(applicationID: string): Promise<RoleConnection>;
79
- /**
80
- * Refresh an existing access token.
81
- * @param options The options for refreshing the token.
82
- * @caching This method **does not** cache its result.
83
- */
84
- refreshToken(options: RefreshTokenOptions): Promise<RefreshTokenResponse>;
85
- /**
86
- * Revoke an access token.
87
- * @param options The options for revoking the token.
88
- * @caching This method **does not** cache its result.
89
- */
90
- revokeToken(options: RevokeTokenOptions): Promise<void>;
91
- /**
92
- * Update an application's role connections metadata.
93
- * @param applicationID The ID of the application.
94
- * @param metadata The metadata records.
95
- * @caching This method **does not** cache its result.
96
- */
97
- updateRoleConnectionsMetadata(applicationID: string, metadata: Array<RoleConnectionMetadata>): Promise<Array<RoleConnectionMetadata>>;
98
- /**
99
- * Update the authenticated user's role connection object for an application. This requires the `role_connections.write` scope.
100
- * @param applicationID The ID of the application.
101
- * @param data The metadata to update.
102
- * @caching This method **does not** cache its result.
103
- */
104
- updateUserRoleConnection(applicationID: string, data: UpdateUserApplicationRoleConnectionOptions): Promise<RoleConnection>;
105
- }