disgroove 1.3.3-dev.2 → 1.3.3-dev.3

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 (277) hide show
  1. package/dist/package.json +1 -1
  2. package/package.json +1 -1
  3. package/dist/lib/Client.d.ts +0 -234
  4. package/dist/lib/Client.js +0 -256
  5. package/dist/lib/Client.js.map +0 -1
  6. package/dist/lib/constants.d.ts +0 -1084
  7. package/dist/lib/constants.js +0 -1163
  8. package/dist/lib/constants.js.map +0 -1
  9. package/dist/lib/gateway/Shard.d.ts +0 -25
  10. package/dist/lib/gateway/Shard.js +0 -522
  11. package/dist/lib/gateway/Shard.js.map +0 -1
  12. package/dist/lib/gateway/ShardsManager.d.ts +0 -5
  13. package/dist/lib/gateway/ShardsManager.js +0 -13
  14. package/dist/lib/gateway/ShardsManager.js.map +0 -1
  15. package/dist/lib/gateway/index.d.ts +0 -2
  16. package/dist/lib/gateway/index.js +0 -19
  17. package/dist/lib/gateway/index.js.map +0 -1
  18. package/dist/lib/index.d.ts +0 -7
  19. package/dist/lib/index.js +0 -24
  20. package/dist/lib/index.js.map +0 -1
  21. package/dist/lib/rest/CDN.d.ts +0 -21
  22. package/dist/lib/rest/CDN.js +0 -46
  23. package/dist/lib/rest/CDN.js.map +0 -1
  24. package/dist/lib/rest/Endpoints.d.ts +0 -94
  25. package/dist/lib/rest/Endpoints.js +0 -211
  26. package/dist/lib/rest/Endpoints.js.map +0 -1
  27. package/dist/lib/rest/REST.d.ts +0 -22
  28. package/dist/lib/rest/REST.js +0 -35
  29. package/dist/lib/rest/REST.js.map +0 -1
  30. package/dist/lib/rest/RequestsManager.d.ts +0 -17
  31. package/dist/lib/rest/RequestsManager.js +0 -124
  32. package/dist/lib/rest/RequestsManager.js.map +0 -1
  33. package/dist/lib/rest/index.d.ts +0 -4
  34. package/dist/lib/rest/index.js +0 -34
  35. package/dist/lib/rest/index.js.map +0 -1
  36. package/dist/lib/structures/Application.d.ts +0 -174
  37. package/dist/lib/structures/Application.js +0 -328
  38. package/dist/lib/structures/Application.js.map +0 -1
  39. package/dist/lib/structures/ApplicationCommand.d.ts +0 -45
  40. package/dist/lib/structures/ApplicationCommand.js +0 -127
  41. package/dist/lib/structures/ApplicationCommand.js.map +0 -1
  42. package/dist/lib/structures/AuditLog.d.ts +0 -20
  43. package/dist/lib/structures/AuditLog.js +0 -76
  44. package/dist/lib/structures/AuditLog.js.map +0 -1
  45. package/dist/lib/structures/AutoModerationRule.d.ts +0 -34
  46. package/dist/lib/structures/AutoModerationRule.js +0 -96
  47. package/dist/lib/structures/AutoModerationRule.js.map +0 -1
  48. package/dist/lib/structures/Base.d.ts +0 -17
  49. package/dist/lib/structures/Base.js +0 -31
  50. package/dist/lib/structures/Base.js.map +0 -1
  51. package/dist/lib/structures/Channel.d.ts +0 -253
  52. package/dist/lib/structures/Channel.js +0 -591
  53. package/dist/lib/structures/Channel.js.map +0 -1
  54. package/dist/lib/structures/ClientApplication.d.ts +0 -150
  55. package/dist/lib/structures/ClientApplication.js +0 -241
  56. package/dist/lib/structures/ClientApplication.js.map +0 -1
  57. package/dist/lib/structures/Emoji.d.ts +0 -28
  58. package/dist/lib/structures/Emoji.js +0 -79
  59. package/dist/lib/structures/Emoji.js.map +0 -1
  60. package/dist/lib/structures/Entitlement.d.ts +0 -24
  61. package/dist/lib/structures/Entitlement.js +0 -68
  62. package/dist/lib/structures/Entitlement.js.map +0 -1
  63. package/dist/lib/structures/Guild.d.ts +0 -462
  64. package/dist/lib/structures/Guild.js +0 -1095
  65. package/dist/lib/structures/Guild.js.map +0 -1
  66. package/dist/lib/structures/GuildMember.d.ts +0 -50
  67. package/dist/lib/structures/GuildMember.js +0 -149
  68. package/dist/lib/structures/GuildMember.js.map +0 -1
  69. package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -49
  70. package/dist/lib/structures/GuildScheduledEvent.js +0 -118
  71. package/dist/lib/structures/GuildScheduledEvent.js.map +0 -1
  72. package/dist/lib/structures/GuildTemplate.d.ts +0 -32
  73. package/dist/lib/structures/GuildTemplate.js +0 -76
  74. package/dist/lib/structures/GuildTemplate.js.map +0 -1
  75. package/dist/lib/structures/Integration.d.ts +0 -30
  76. package/dist/lib/structures/Integration.js +0 -102
  77. package/dist/lib/structures/Integration.js.map +0 -1
  78. package/dist/lib/structures/Interaction.d.ts +0 -76
  79. package/dist/lib/structures/Interaction.js +0 -345
  80. package/dist/lib/structures/Interaction.js.map +0 -1
  81. package/dist/lib/structures/Invite.d.ts +0 -28
  82. package/dist/lib/structures/Invite.js +0 -86
  83. package/dist/lib/structures/Invite.js.map +0 -1
  84. package/dist/lib/structures/Message.d.ts +0 -84
  85. package/dist/lib/structures/Message.js +0 -300
  86. package/dist/lib/structures/Message.js.map +0 -1
  87. package/dist/lib/structures/Role.d.ts +0 -37
  88. package/dist/lib/structures/Role.js +0 -90
  89. package/dist/lib/structures/Role.js.map +0 -1
  90. package/dist/lib/structures/SKU.d.ts +0 -23
  91. package/dist/lib/structures/SKU.js +0 -63
  92. package/dist/lib/structures/SKU.js.map +0 -1
  93. package/dist/lib/structures/StageInstance.d.ts +0 -24
  94. package/dist/lib/structures/StageInstance.js +0 -57
  95. package/dist/lib/structures/StageInstance.js.map +0 -1
  96. package/dist/lib/structures/Sticker.d.ts +0 -31
  97. package/dist/lib/structures/Sticker.js +0 -86
  98. package/dist/lib/structures/Sticker.js.map +0 -1
  99. package/dist/lib/structures/Team.d.ts +0 -14
  100. package/dist/lib/structures/Team.js +0 -39
  101. package/dist/lib/structures/Team.js.map +0 -1
  102. package/dist/lib/structures/TestEntitlement.d.ts +0 -23
  103. package/dist/lib/structures/TestEntitlement.js +0 -61
  104. package/dist/lib/structures/TestEntitlement.js.map +0 -1
  105. package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
  106. package/dist/lib/structures/UnavailableGuild.js +0 -25
  107. package/dist/lib/structures/UnavailableGuild.js.map +0 -1
  108. package/dist/lib/structures/User.d.ts +0 -63
  109. package/dist/lib/structures/User.js +0 -177
  110. package/dist/lib/structures/User.js.map +0 -1
  111. package/dist/lib/structures/VoiceState.d.ts +0 -26
  112. package/dist/lib/structures/VoiceState.js +0 -70
  113. package/dist/lib/structures/VoiceState.js.map +0 -1
  114. package/dist/lib/structures/Webhook.d.ts +0 -84
  115. package/dist/lib/structures/Webhook.js +0 -239
  116. package/dist/lib/structures/Webhook.js.map +0 -1
  117. package/dist/lib/structures/index.d.ts +0 -27
  118. package/dist/lib/structures/index.js +0 -44
  119. package/dist/lib/structures/index.js.map +0 -1
  120. package/dist/lib/types/application-command.d.ts +0 -102
  121. package/dist/lib/types/application-command.js +0 -3
  122. package/dist/lib/types/application-command.js.map +0 -1
  123. package/dist/lib/types/application-role-connection-metadata.d.ts +0 -18
  124. package/dist/lib/types/application-role-connection-metadata.js +0 -3
  125. package/dist/lib/types/application-role-connection-metadata.js.map +0 -1
  126. package/dist/lib/types/application.d.ts +0 -66
  127. package/dist/lib/types/application.js +0 -3
  128. package/dist/lib/types/application.js.map +0 -1
  129. package/dist/lib/types/audit-log.d.ts +0 -82
  130. package/dist/lib/types/audit-log.js +0 -3
  131. package/dist/lib/types/audit-log.js.map +0 -1
  132. package/dist/lib/types/auto-moderation.d.ts +0 -65
  133. package/dist/lib/types/auto-moderation.js +0 -3
  134. package/dist/lib/types/auto-moderation.js.map +0 -1
  135. package/dist/lib/types/channel.d.ts +0 -456
  136. package/dist/lib/types/channel.js +0 -3
  137. package/dist/lib/types/channel.js.map +0 -1
  138. package/dist/lib/types/emoji.d.ts +0 -22
  139. package/dist/lib/types/emoji.js +0 -3
  140. package/dist/lib/types/emoji.js.map +0 -1
  141. package/dist/lib/types/entitlements.d.ts +0 -32
  142. package/dist/lib/types/entitlements.js +0 -3
  143. package/dist/lib/types/entitlements.js.map +0 -1
  144. package/dist/lib/types/gateway-events.d.ts +0 -805
  145. package/dist/lib/types/gateway-events.js +0 -3
  146. package/dist/lib/types/gateway-events.js.map +0 -1
  147. package/dist/lib/types/guild-scheduled-event.d.ts +0 -57
  148. package/dist/lib/types/guild-scheduled-event.js +0 -3
  149. package/dist/lib/types/guild-scheduled-event.js.map +0 -1
  150. package/dist/lib/types/guild-template.d.ts +0 -28
  151. package/dist/lib/types/guild-template.js +0 -3
  152. package/dist/lib/types/guild-template.js.map +0 -1
  153. package/dist/lib/types/guild.d.ts +0 -333
  154. package/dist/lib/types/guild.js +0 -3
  155. package/dist/lib/types/guild.js.map +0 -1
  156. package/dist/lib/types/index.d.ts +0 -23
  157. package/dist/lib/types/index.js +0 -40
  158. package/dist/lib/types/index.js.map +0 -1
  159. package/dist/lib/types/interaction.d.ts +0 -170
  160. package/dist/lib/types/interaction.js +0 -3
  161. package/dist/lib/types/interaction.js.map +0 -1
  162. package/dist/lib/types/invite.d.ts +0 -59
  163. package/dist/lib/types/invite.js +0 -3
  164. package/dist/lib/types/invite.js.map +0 -1
  165. package/dist/lib/types/message-components.d.ts +0 -100
  166. package/dist/lib/types/message-components.js +0 -3
  167. package/dist/lib/types/message-components.js.map +0 -1
  168. package/dist/lib/types/role.d.ts +0 -47
  169. package/dist/lib/types/role.js +0 -3
  170. package/dist/lib/types/role.js.map +0 -1
  171. package/dist/lib/types/sku.d.ts +0 -30
  172. package/dist/lib/types/sku.js +0 -3
  173. package/dist/lib/types/sku.js.map +0 -1
  174. package/dist/lib/types/stage-instance.d.ts +0 -20
  175. package/dist/lib/types/stage-instance.js +0 -3
  176. package/dist/lib/types/stage-instance.js.map +0 -1
  177. package/dist/lib/types/sticker.d.ts +0 -61
  178. package/dist/lib/types/sticker.js +0 -3
  179. package/dist/lib/types/sticker.js.map +0 -1
  180. package/dist/lib/types/team.d.ts +0 -30
  181. package/dist/lib/types/team.js +0 -3
  182. package/dist/lib/types/team.js.map +0 -1
  183. package/dist/lib/types/user.d.ts +0 -77
  184. package/dist/lib/types/user.js +0 -3
  185. package/dist/lib/types/user.js.map +0 -1
  186. package/dist/lib/types/voice.d.ts +0 -47
  187. package/dist/lib/types/voice.js +0 -3
  188. package/dist/lib/types/voice.js.map +0 -1
  189. package/dist/lib/types/webhook.d.ts +0 -31
  190. package/dist/lib/types/webhook.js +0 -3
  191. package/dist/lib/types/webhook.js.map +0 -1
  192. package/dist/lib/utils/Util.d.ts +0 -15
  193. package/dist/lib/utils/Util.js +0 -543
  194. package/dist/lib/utils/Util.js.map +0 -1
  195. package/dist/lib/utils/errors.d.ts +0 -12
  196. package/dist/lib/utils/errors.js +0 -25
  197. package/dist/lib/utils/errors.js.map +0 -1
  198. package/dist/lib/utils/index.d.ts +0 -2
  199. package/dist/lib/utils/index.js +0 -19
  200. package/dist/lib/utils/index.js.map +0 -1
  201. package/examples/applicationCommands.js +0 -43
  202. package/examples/buttons.js +0 -70
  203. package/examples/embeds.js +0 -36
  204. package/examples/ephemeralMessages.js +0 -32
  205. package/examples/files.js +0 -36
  206. package/examples/modalSubmit.js +0 -62
  207. package/examples/permissions.js +0 -41
  208. package/examples/selectMenus.js +0 -160
  209. package/examples/text.txt +0 -1
  210. package/lib/Client.ts +0 -616
  211. package/lib/constants.ts +0 -1173
  212. package/lib/gateway/Shard.ts +0 -704
  213. package/lib/gateway/ShardsManager.ts +0 -11
  214. package/lib/gateway/index.ts +0 -2
  215. package/lib/index.ts +0 -7
  216. package/lib/rest/CDN.ts +0 -56
  217. package/lib/rest/Endpoints.ts +0 -241
  218. package/lib/rest/REST.ts +0 -45
  219. package/lib/rest/RequestsManager.ts +0 -134
  220. package/lib/rest/index.ts +0 -4
  221. package/lib/structures/Application.ts +0 -599
  222. package/lib/structures/ApplicationCommand.ts +0 -187
  223. package/lib/structures/AuditLog.ts +0 -112
  224. package/lib/structures/AutoModerationRule.ts +0 -127
  225. package/lib/structures/Base.ts +0 -39
  226. package/lib/structures/Channel.ts +0 -921
  227. package/lib/structures/ClientApplication.ts +0 -515
  228. package/lib/structures/Emoji.ts +0 -95
  229. package/lib/structures/Entitlement.ts +0 -65
  230. package/lib/structures/Guild.ts +0 -1842
  231. package/lib/structures/GuildMember.ts +0 -193
  232. package/lib/structures/GuildScheduledEvent.ts +0 -164
  233. package/lib/structures/GuildTemplate.ts +0 -103
  234. package/lib/structures/Integration.ts +0 -136
  235. package/lib/structures/Interaction.ts +0 -506
  236. package/lib/structures/Invite.ts +0 -108
  237. package/lib/structures/Message.ts +0 -421
  238. package/lib/structures/Role.ts +0 -116
  239. package/lib/structures/SKU.ts +0 -63
  240. package/lib/structures/StageInstance.ts +0 -74
  241. package/lib/structures/Sticker.ts +0 -100
  242. package/lib/structures/Team.ts +0 -41
  243. package/lib/structures/TestEntitlement.ts +0 -78
  244. package/lib/structures/UnavailableGuild.ts +0 -27
  245. package/lib/structures/User.ts +0 -233
  246. package/lib/structures/VoiceState.ts +0 -72
  247. package/lib/structures/Webhook.ts +0 -341
  248. package/lib/structures/index.ts +0 -27
  249. package/lib/types/application-command.ts +0 -118
  250. package/lib/types/application-role-connection-metadata.ts +0 -23
  251. package/lib/types/application.ts +0 -77
  252. package/lib/types/audit-log.ts +0 -105
  253. package/lib/types/auto-moderation.ts +0 -78
  254. package/lib/types/channel.ts +0 -534
  255. package/lib/types/emoji.ts +0 -24
  256. package/lib/types/entitlements.ts +0 -34
  257. package/lib/types/gateway-events.ts +0 -970
  258. package/lib/types/guild-scheduled-event.ts +0 -67
  259. package/lib/types/guild-template.ts +0 -30
  260. package/lib/types/guild.ts +0 -388
  261. package/lib/types/index.ts +0 -23
  262. package/lib/types/interaction.ts +0 -224
  263. package/lib/types/invite.ts +0 -78
  264. package/lib/types/message-components.ts +0 -127
  265. package/lib/types/role.ts +0 -51
  266. package/lib/types/sku.ts +0 -32
  267. package/lib/types/stage-instance.ts +0 -22
  268. package/lib/types/sticker.ts +0 -67
  269. package/lib/types/team.ts +0 -34
  270. package/lib/types/user.ts +0 -93
  271. package/lib/types/voice.ts +0 -51
  272. package/lib/types/webhook.ts +0 -40
  273. package/lib/utils/Util.ts +0 -600
  274. package/lib/utils/errors.ts +0 -23
  275. package/lib/utils/index.ts +0 -2
  276. package/test/basic.js +0 -8
  277. package/tsconfig.json +0 -107
@@ -1,47 +0,0 @@
1
- import type { JSONGuildMember, RawGuildMember } from ".";
2
- /** https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure */
3
- export interface RawVoiceState {
4
- guild_id?: string;
5
- channel_id: string | null;
6
- user_id: string;
7
- member?: RawGuildMember;
8
- session_id: string;
9
- deaf: boolean;
10
- mute: boolean;
11
- self_deaf: boolean;
12
- self_mute: boolean;
13
- self_stream?: boolean;
14
- self_video: boolean;
15
- suppress: boolean;
16
- request_to_speak_timestamp: string | null;
17
- }
18
- /** https://discord.com/developers/docs/resources/voice#voice-region-object-voice-region-structure */
19
- export interface RawVoiceRegion {
20
- id: string;
21
- name: string;
22
- optimal: boolean;
23
- deprecated: boolean;
24
- custom: boolean;
25
- }
26
- export interface JSONVoiceState {
27
- guildId?: string;
28
- channelId: string | null;
29
- userId: string;
30
- member?: JSONGuildMember;
31
- sessionId: string;
32
- deaf: boolean;
33
- mute: boolean;
34
- selfDeaf: boolean;
35
- selfMute: boolean;
36
- selfStream?: boolean;
37
- selfVideo: boolean;
38
- suppress: boolean;
39
- requestToSpeakTimestamp: string | null;
40
- }
41
- export interface JSONVoiceRegion {
42
- id: string;
43
- name: string;
44
- optimal: boolean;
45
- deprecated: boolean;
46
- custom: boolean;
47
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=voice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"voice.js","sourceRoot":"","sources":["../../../lib/types/voice.ts"],"names":[],"mappings":""}
@@ -1,31 +0,0 @@
1
- import type { WebhookTypes } from "../constants";
2
- import type { JSONChannel, JSONGuild, JSONUser, RawChannel, RawGuild, RawUser } from ".";
3
- /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
4
- export interface RawWebhook {
5
- id: string;
6
- type: WebhookTypes;
7
- guild_id?: string | null;
8
- channel_id: string | null;
9
- user?: RawUser;
10
- name: string | null;
11
- avatar: string | null;
12
- token?: string;
13
- application_id: string | null;
14
- source_guild?: RawGuild;
15
- source_channel?: RawChannel;
16
- url?: string;
17
- }
18
- export interface JSONWebhook {
19
- id: string;
20
- type: WebhookTypes;
21
- guildId?: string | null;
22
- channelId: string | null;
23
- user?: JSONUser;
24
- name: string | null;
25
- avatar: string | null;
26
- token?: string;
27
- applicationId: string | null;
28
- sourceGuild?: JSONGuild;
29
- sourceChannel?: JSONChannel;
30
- url?: string;
31
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=webhook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../../lib/types/webhook.ts"],"names":[],"mappings":""}
@@ -1,15 +0,0 @@
1
- import type { JSONActionRow, JSONApplicationCommand, JSONAttachment, JSONChannel, JSONEmbed, JSONEmoji, JSONRole, JSONUser, PresenceUpdateEventFields, RawActionRow, RawApplicationCommand, RawAttachment, RawChannel, RawEmbed, RawEmoji, RawPresenceUpdateEventFields, RawRole, RawUser } from "../types";
2
- import type { Client } from "../Client";
3
- export declare class Util {
4
- applicationCommandToRaw(command: Partial<JSONApplicationCommand>): Partial<RawApplicationCommand>;
5
- attachmentToJSON(attachment: RawAttachment): JSONAttachment;
6
- channelToRaw(channel: JSONChannel): RawChannel;
7
- embedsToJSON(embeds: Array<RawEmbed>): Array<JSONEmbed>;
8
- embedsToRaw(embeds: Array<JSONEmbed>): Array<RawEmbed>;
9
- emojiToRaw(emoji: JSONEmoji): RawEmoji;
10
- messageComponentsToJSON(components: Array<RawActionRow>): Array<JSONActionRow>;
11
- messageComponentsToRaw(components: Array<JSONActionRow>): Array<RawActionRow>;
12
- presenceToREST(presence: RawPresenceUpdateEventFields, client: Client): PresenceUpdateEventFields;
13
- roleToRaw(role: JSONRole | Partial<JSONRole>): RawRole | Partial<RawRole>;
14
- userToRaw(user: JSONUser): RawUser;
15
- }
@@ -1,543 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Util = void 0;
4
- const constants_1 = require("../constants");
5
- const structures_1 = require("../structures");
6
- class Util {
7
- applicationCommandToRaw(command) {
8
- return {
9
- id: command.id,
10
- type: command.type,
11
- application_id: command.applicationId,
12
- guild_id: command.guildId,
13
- name: command.name,
14
- name_localizations: command.nameLocalizations,
15
- description: command.description,
16
- description_localizations: command.descriptionLocalizations,
17
- options: command.options?.map((option) => ({
18
- type: option.type,
19
- name: option.name,
20
- name_localizations: option.nameLocalizations,
21
- description: option.description,
22
- description_localizations: option.descriptionLocalizations,
23
- required: option.required,
24
- choices: option.choices?.map((choice) => ({
25
- name: choice.name,
26
- name_localizations: choice.nameLocalizations,
27
- value: choice.value,
28
- })),
29
- options: option.options?.map((o) => ({
30
- type: o.type,
31
- name: o.name,
32
- name_localizations: o.nameLocalizations,
33
- description: o.description,
34
- description_localizations: o.descriptionLocalizations,
35
- required: o.required,
36
- choices: o.choices?.map((choice) => ({
37
- name: choice.name,
38
- name_localizations: choice.nameLocalizations,
39
- value: choice.value,
40
- })),
41
- channel_types: o.channelTypes,
42
- min_value: o.minValue,
43
- max_value: o.maxValue,
44
- min_length: o.minLength,
45
- max_length: o.maxLength,
46
- autocomplete: o.autocomplete,
47
- })),
48
- channel_types: option.channelTypes,
49
- min_value: option.minValue,
50
- max_value: option.maxValue,
51
- min_length: option.minLength,
52
- max_length: option.maxLength,
53
- autocomplete: option.autocomplete,
54
- })),
55
- default_member_permissions: command.defaultMemberPermissions,
56
- dm_permission: command.dmPermission,
57
- default_permission: command.defaultPermission,
58
- nsfw: command.nsfw,
59
- version: command.version,
60
- };
61
- }
62
- attachmentToJSON(attachment) {
63
- return {
64
- id: attachment.id,
65
- filename: attachment.filename,
66
- description: attachment.description,
67
- contentType: attachment.content_type,
68
- size: attachment.size,
69
- url: attachment.url,
70
- proxyURL: attachment.proxy_url,
71
- height: attachment.height,
72
- width: attachment.width,
73
- ephemeral: attachment.ephemeral,
74
- durationSecs: attachment.duration_secs,
75
- waveform: attachment.waveform,
76
- flags: attachment.flags,
77
- };
78
- }
79
- channelToRaw(channel) {
80
- return {
81
- id: channel.id,
82
- type: channel.type,
83
- guild_id: channel.guildId,
84
- position: channel.position,
85
- permission_overwrites: channel.permissionOverwrites?.map((overwrite) => ({
86
- id: overwrite.id,
87
- type: overwrite.type,
88
- allow: overwrite.allow,
89
- deny: overwrite.deny,
90
- })),
91
- name: channel.name,
92
- topic: channel.topic,
93
- nsfw: channel.nsfw,
94
- last_message_id: channel.lastMessageId,
95
- bitrate: channel.bitrate,
96
- user_limit: channel.userLimit,
97
- rate_limit_per_user: channel.rateLimitPerUser,
98
- recipients: channel.recipients?.map((recipient) => this.userToRaw(recipient)),
99
- icon: channel.icon,
100
- owner_id: channel.ownerId,
101
- application_id: channel.applicationId,
102
- managed: channel.managed,
103
- parent_id: channel.parentId,
104
- last_pin_timestamp: channel.lastPinTimestamp,
105
- rtc_region: channel.rtcRegion,
106
- video_quality_mode: channel.videoQualityMode,
107
- message_count: channel.messageCount,
108
- member_count: channel.memberCount,
109
- thread_metadata: channel.threadMetadata !== undefined
110
- ? {
111
- archived: channel.threadMetadata?.archived,
112
- auto_archive_duration: channel.threadMetadata?.autoArchiveDuration,
113
- archive_timestamp: channel.threadMetadata?.archiveTimestamp,
114
- locked: channel.threadMetadata?.locked,
115
- invitable: channel.threadMetadata?.invitable,
116
- create_timestamp: channel.threadMetadata?.createTimestamp,
117
- }
118
- : undefined,
119
- member: channel.member !== undefined
120
- ? {
121
- id: channel.member.id,
122
- user_id: channel.member.userId,
123
- join_timestamp: channel.member.joinTimestamp,
124
- flags: channel.member.flags,
125
- member: channel.member.member !== undefined
126
- ? {
127
- user: channel.member.member.user !== undefined
128
- ? this.userToRaw(channel.member.member.user)
129
- : undefined,
130
- nick: channel.member.member.nick,
131
- avatar: channel.member.member.avatar,
132
- roles: channel.member.member.roles,
133
- joined_at: channel.member.member.joinedAt,
134
- premium_since: channel.member.member.premiumSince,
135
- deaf: channel.member.member.deaf,
136
- mute: channel.member.member.mute,
137
- flags: channel.member.member.flags,
138
- pending: channel.member.member.pending,
139
- permissions: channel.member.member.permissions,
140
- communication_disabled_until: channel.member.member.communicationDisabledUntil,
141
- }
142
- : undefined,
143
- }
144
- : undefined,
145
- default_auto_archive_duration: channel.defaultAutoArchiveDuration,
146
- permissions: channel.permissions,
147
- flags: channel.flags,
148
- total_message_sent: channel.totalMessageSent,
149
- available_tags: channel.availableTags?.map((availableTag) => ({
150
- id: availableTag.id,
151
- name: availableTag.name,
152
- moderated: availableTag.moderated,
153
- emoji_id: availableTag.emojiId,
154
- emoji_name: availableTag.emojiName,
155
- })),
156
- applied_tags: channel.appliedTags,
157
- default_reaction_emoji: channel.defaultReactionEmoji !== undefined
158
- ? channel.defaultReactionEmoji !== null
159
- ? {
160
- emoji_id: channel.defaultReactionEmoji.emojiId,
161
- emoji_name: channel.defaultReactionEmoji.emojiName,
162
- }
163
- : null
164
- : undefined,
165
- default_thread_rate_limit_per_user: channel.defaultThreadRateLimitPerUser,
166
- default_sort_order: channel.defaultSortOrder,
167
- default_forum_layout: channel.defaultForumLayout,
168
- };
169
- }
170
- embedsToJSON(embeds) {
171
- return embeds.map((embed) => ({
172
- title: embed.title,
173
- type: embed.type,
174
- description: embed.description,
175
- url: embed.url,
176
- timestamp: embed.timestamp,
177
- color: embed.color,
178
- footer: embed.footer !== undefined
179
- ? {
180
- text: embed.footer.text,
181
- iconURL: embed.footer.icon_url,
182
- proxyIconURL: embed.footer.proxy_icon_url,
183
- }
184
- : undefined,
185
- image: embed.image !== undefined
186
- ? {
187
- url: embed.image.url,
188
- proxyURL: embed.image.proxy_url,
189
- height: embed.image.height,
190
- width: embed.image.width,
191
- }
192
- : undefined,
193
- thumbnail: embed.thumbnail !== undefined
194
- ? {
195
- url: embed.thumbnail.url,
196
- proxyURL: embed.thumbnail.proxy_url,
197
- height: embed.thumbnail.height,
198
- width: embed.thumbnail.width,
199
- }
200
- : undefined,
201
- video: {
202
- url: embed.video?.url,
203
- proxyURL: embed.video?.proxy_url,
204
- height: embed.video?.height,
205
- width: embed.video?.width,
206
- },
207
- provider: {
208
- name: embed.provider?.name,
209
- url: embed.provider?.url,
210
- },
211
- author: embed.author !== undefined
212
- ? {
213
- name: embed.author.name,
214
- url: embed.author.url,
215
- iconURL: embed.author.icon_url,
216
- proxyIconURL: embed.author.proxy_icon_url,
217
- }
218
- : undefined,
219
- fields: embed.fields?.map((field) => ({
220
- name: field.name,
221
- value: field.value,
222
- inline: field.inline,
223
- })),
224
- }));
225
- }
226
- embedsToRaw(embeds) {
227
- return embeds.map((embed) => ({
228
- title: embed.title,
229
- type: embed.type,
230
- description: embed.description,
231
- url: embed.url,
232
- timestamp: embed.timestamp,
233
- color: embed.color,
234
- footer: embed.footer !== undefined
235
- ? {
236
- text: embed.footer.text,
237
- icon_url: embed.footer.iconURL,
238
- proxy_icon_url: embed.footer.proxyIconURL,
239
- }
240
- : undefined,
241
- image: embed.image !== undefined
242
- ? {
243
- url: embed.image.url,
244
- proxy_url: embed.image.proxyURL,
245
- height: embed.image.height,
246
- width: embed.image.width,
247
- }
248
- : undefined,
249
- thumbnail: embed.thumbnail !== undefined
250
- ? {
251
- url: embed.thumbnail.url,
252
- proxy_url: embed.thumbnail.proxyURL,
253
- height: embed.thumbnail.height,
254
- width: embed.thumbnail.width,
255
- }
256
- : undefined,
257
- video: {
258
- url: embed.video?.url,
259
- proxy_url: embed.video?.proxyURL,
260
- height: embed.video?.height,
261
- width: embed.video?.width,
262
- },
263
- provider: {
264
- name: embed.provider?.name,
265
- url: embed.provider?.url,
266
- },
267
- author: embed.author !== undefined
268
- ? {
269
- name: embed.author.name,
270
- url: embed.author.url,
271
- icon_url: embed.author.iconURL,
272
- proxy_icon_url: embed.author.proxyIconURL,
273
- }
274
- : undefined,
275
- fields: embed.fields?.map((field) => ({
276
- name: field.name,
277
- value: field.value,
278
- inline: field.inline,
279
- })),
280
- }));
281
- }
282
- emojiToRaw(emoji) {
283
- return {
284
- id: emoji.id,
285
- name: emoji.name,
286
- roles: emoji.roles,
287
- user: emoji.user !== undefined ? this.userToRaw(emoji.user) : undefined,
288
- require_colons: emoji.requireColons,
289
- managed: emoji.managed,
290
- animated: emoji.animated,
291
- available: emoji.available,
292
- };
293
- }
294
- messageComponentsToJSON(components) {
295
- return components.map((component) => ({
296
- type: component.type,
297
- components: component.components.map((c) => {
298
- switch (c.type) {
299
- case constants_1.ComponentTypes.Button: {
300
- return {
301
- type: c.type,
302
- style: c.style,
303
- label: c.label,
304
- emoji: c.emoji !== undefined
305
- ? {
306
- name: c.emoji.name,
307
- id: c.emoji.id,
308
- animated: c.emoji.animated,
309
- }
310
- : undefined,
311
- customId: c.custom_id,
312
- url: c.url,
313
- disabled: c.disabled,
314
- };
315
- }
316
- case constants_1.ComponentTypes.TextInput: {
317
- return {
318
- type: c.type,
319
- customId: c.custom_id,
320
- style: c.style,
321
- label: c.label,
322
- minLength: c.min_length,
323
- maxLength: c.max_length,
324
- required: c.required,
325
- value: c.value,
326
- placeholder: c.placeholder,
327
- };
328
- }
329
- case constants_1.ComponentTypes.ChannelSelect: {
330
- return {
331
- type: c.type,
332
- customId: c.custom_id,
333
- channelTypes: c.channel_types,
334
- placeholder: c.placeholder,
335
- defaultValues: c.default_values,
336
- minValues: c.min_values,
337
- maxValues: c.max_values,
338
- disabled: c.disabled,
339
- };
340
- }
341
- case constants_1.ComponentTypes.StringSelect: {
342
- return {
343
- type: c.type,
344
- customId: c.custom_id,
345
- placeholder: c.placeholder,
346
- options: c.options?.map((option) => ({
347
- label: option.label,
348
- value: option.value,
349
- description: option.description,
350
- emoji: option.emoji !== undefined
351
- ? {
352
- name: option.emoji.name,
353
- id: option.emoji.id,
354
- animated: option.emoji.animated,
355
- }
356
- : undefined,
357
- default: option.default,
358
- })),
359
- minValues: c.min_values,
360
- maxValues: c.max_values,
361
- disabled: c.disabled,
362
- };
363
- }
364
- case constants_1.ComponentTypes.MentionableSelect:
365
- case constants_1.ComponentTypes.RoleSelect:
366
- case constants_1.ComponentTypes.UserSelect: {
367
- return {
368
- type: c.type,
369
- customId: c.custom_id,
370
- placeholder: c.placeholder,
371
- defaultValues: c.default_values,
372
- minValues: c.min_values,
373
- maxValues: c.max_values,
374
- disabled: c.disabled,
375
- };
376
- }
377
- }
378
- }),
379
- }));
380
- }
381
- messageComponentsToRaw(components) {
382
- return components.map((component) => ({
383
- type: component.type,
384
- components: component.components.map((c) => {
385
- switch (c.type) {
386
- case constants_1.ComponentTypes.Button: {
387
- return {
388
- type: c.type,
389
- style: c.style,
390
- label: c.label,
391
- emoji: c.emoji !== undefined
392
- ? {
393
- name: c.emoji.name,
394
- id: c.emoji.id,
395
- animated: c.emoji.animated,
396
- }
397
- : undefined,
398
- custom_id: c.customId,
399
- url: c.url,
400
- disabled: c.disabled,
401
- };
402
- }
403
- case constants_1.ComponentTypes.TextInput: {
404
- return {
405
- type: c.type,
406
- custom_id: c.customId,
407
- style: c.style,
408
- label: c.label,
409
- min_length: c.minLength,
410
- max_length: c.maxLength,
411
- required: c.required,
412
- value: c.value,
413
- placeholder: c.placeholder,
414
- };
415
- }
416
- case constants_1.ComponentTypes.ChannelSelect: {
417
- return {
418
- type: c.type,
419
- custom_id: c.customId,
420
- channel_types: c.channelTypes,
421
- placeholder: c.placeholder,
422
- default_values: c.defaultValues,
423
- min_values: c.minValues,
424
- max_values: c.maxValues,
425
- disabled: c.disabled,
426
- };
427
- }
428
- case constants_1.ComponentTypes.StringSelect: {
429
- return {
430
- type: c.type,
431
- custom_id: c.customId,
432
- placeholder: c.placeholder,
433
- options: c.options?.map((option) => ({
434
- label: option.label,
435
- value: option.value,
436
- description: option.description,
437
- emoji: option.emoji !== undefined
438
- ? {
439
- name: option.emoji.name,
440
- id: option.emoji.id,
441
- animated: option.emoji.animated,
442
- }
443
- : undefined,
444
- default: option.default,
445
- })),
446
- min_values: c.minValues,
447
- max_values: c.maxValues,
448
- disabled: c.disabled,
449
- };
450
- }
451
- case constants_1.ComponentTypes.MentionableSelect:
452
- case constants_1.ComponentTypes.RoleSelect:
453
- case constants_1.ComponentTypes.UserSelect: {
454
- return {
455
- type: c.type,
456
- custom_id: c.customId,
457
- placeholder: c.placeholder,
458
- default_values: c.defaultValues,
459
- min_values: c.minValues,
460
- max_values: c.maxValues,
461
- disabled: c.disabled,
462
- };
463
- }
464
- }
465
- }),
466
- }));
467
- }
468
- presenceToREST(presence, client) {
469
- return {
470
- user: new structures_1.User(presence.user, client),
471
- guildId: presence.guild_id,
472
- status: presence.status,
473
- activities: presence.activities.map((activity) => ({
474
- name: activity.name,
475
- type: activity.type,
476
- url: activity.url,
477
- createdAt: activity.created_at,
478
- timestamps: activity.timestamps,
479
- applicationId: activity.application_id,
480
- details: activity.details,
481
- state: activity.state,
482
- party: activity.party,
483
- assets: {
484
- largeImage: activity.assets?.large_image,
485
- largeText: activity.assets?.large_text,
486
- smallImage: activity.assets?.small_image,
487
- smallText: activity.assets?.small_text,
488
- },
489
- secrets: activity.secrets,
490
- instance: activity.instance,
491
- flags: activity.flags,
492
- buttons: activity.buttons,
493
- })),
494
- clientStatus: presence.client_status,
495
- };
496
- }
497
- roleToRaw(role) {
498
- return {
499
- id: role.id,
500
- name: role.name,
501
- color: role.color,
502
- hoist: role.hoist,
503
- icon: role.icon,
504
- unicode_emoji: role.unicodeEmoji,
505
- position: role.position,
506
- permissions: role.permissions,
507
- managed: role.managed,
508
- mentionable: role.mentionable,
509
- tags: {
510
- bot_id: role.tags?.botId,
511
- integration_id: role.tags?.integrationId,
512
- premium_subscriber: role.tags?.premiumSubscriber,
513
- subscription_listing_id: role.tags?.subscriptionListingId,
514
- available_for_purchase: role.tags?.availableForPurchase,
515
- guild_connections: role.tags?.guildConnections,
516
- },
517
- flags: role.flags,
518
- };
519
- }
520
- userToRaw(user) {
521
- return {
522
- id: user.id,
523
- username: user.username,
524
- discriminator: user.discriminator,
525
- global_name: user.globalName,
526
- avatar: user.avatar,
527
- bot: user.bot,
528
- system: user.system,
529
- mfa_enabled: user.mfaEnabled,
530
- banner: user.banner,
531
- accent_color: user.accentColor,
532
- locale: user.locale,
533
- verified: user.verified,
534
- email: user.email,
535
- flags: user.flags,
536
- premium_type: user.premiumType,
537
- public_flags: user.publicFlags,
538
- avatar_decoration: user.avatarDecoration,
539
- };
540
- }
541
- }
542
- exports.Util = Util;
543
- //# sourceMappingURL=Util.js.map