chapterjs 0.1.2 → 0.1.4

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 (320) hide show
  1. package/dist/assets/asset.d.ts +46 -0
  2. package/dist/assets/asset.js +86 -0
  3. package/dist/assets/public.d.ts +19 -0
  4. package/dist/assets/public.js +120 -0
  5. package/dist/cache/cache.d.ts +62 -0
  6. package/dist/cache/cache.js +80 -0
  7. package/dist/cache/store.d.ts +45 -0
  8. package/dist/cache/store.js +53 -0
  9. package/dist/cli/build.d.ts +41 -0
  10. package/dist/cli/build.js +206 -0
  11. package/dist/cli/cli.js +108 -25
  12. package/dist/cli/cluster.d.ts +70 -0
  13. package/dist/cli/cluster.js +213 -0
  14. package/dist/cli/dev.d.ts +18 -1
  15. package/dist/cli/dev.js +252 -198
  16. package/dist/cli/env.d.ts +31 -0
  17. package/dist/cli/env.js +93 -0
  18. package/dist/cli/log.d.ts +13 -0
  19. package/dist/cli/log.js +17 -0
  20. package/dist/cli/node-version.d.ts +8 -0
  21. package/dist/cli/node-version.js +13 -0
  22. package/dist/cli/preflight.d.ts +36 -0
  23. package/dist/cli/preflight.js +122 -0
  24. package/dist/cli/project.d.ts +122 -0
  25. package/dist/cli/project.js +452 -0
  26. package/dist/cli/start.d.ts +25 -0
  27. package/dist/cli/start.js +225 -0
  28. package/dist/commands/autocomplete.d.ts +13 -0
  29. package/dist/commands/autocomplete.js +159 -0
  30. package/dist/commands/command.d.ts +346 -0
  31. package/dist/commands/command.js +28 -0
  32. package/dist/commands/convention.d.ts +64 -0
  33. package/dist/commands/convention.js +464 -0
  34. package/dist/commands/register.d.ts +18 -0
  35. package/dist/commands/register.js +42 -0
  36. package/dist/commands/router.d.ts +20 -0
  37. package/dist/commands/router.js +228 -0
  38. package/dist/commands/tree.d.ts +43 -0
  39. package/dist/commands/tree.js +206 -0
  40. package/dist/commands/twins.d.ts +15 -0
  41. package/dist/commands/twins.js +78 -0
  42. package/dist/components/button.d.ts +79 -0
  43. package/dist/components/button.js +108 -0
  44. package/dist/components/component.d.ts +140 -0
  45. package/dist/components/component.js +39 -0
  46. package/dist/components/convention.d.ts +35 -0
  47. package/dist/components/convention.js +339 -0
  48. package/dist/components/custom-id.d.ts +72 -0
  49. package/dist/components/custom-id.js +128 -0
  50. package/dist/components/embed.d.ts +28 -0
  51. package/dist/components/embed.js +11 -0
  52. package/dist/components/file.d.ts +30 -0
  53. package/dist/components/file.js +52 -0
  54. package/dist/components/instance.d.ts +100 -0
  55. package/dist/components/instance.js +86 -0
  56. package/dist/components/layout.d.ts +103 -0
  57. package/dist/components/layout.js +279 -0
  58. package/dist/components/modal.d.ts +244 -0
  59. package/dist/components/modal.js +399 -0
  60. package/dist/components/options.d.ts +41 -0
  61. package/dist/components/options.js +101 -0
  62. package/dist/components/render.d.ts +12 -0
  63. package/dist/components/render.js +58 -0
  64. package/dist/components/router.d.ts +18 -0
  65. package/dist/components/router.js +256 -0
  66. package/dist/components/select.d.ts +144 -0
  67. package/dist/components/select.js +179 -0
  68. package/dist/core/bot.d.ts +99 -0
  69. package/dist/core/bot.js +174 -0
  70. package/dist/core/memory.d.ts +66 -0
  71. package/dist/core/memory.js +115 -0
  72. package/dist/discord/api.d.ts +112 -0
  73. package/dist/discord/api.js +115 -0
  74. package/dist/discord/cdn.d.ts +67 -0
  75. package/dist/discord/cdn.js +100 -0
  76. package/dist/discord/codes.d.ts +171 -0
  77. package/dist/discord/codes.js +421 -0
  78. package/dist/discord/endpoint.d.ts +56 -0
  79. package/dist/discord/endpoint.js +53 -0
  80. package/dist/discord/endpoints.d.ts +1529 -0
  81. package/dist/discord/endpoints.js +1139 -0
  82. package/dist/discord/formatting.d.ts +67 -0
  83. package/dist/discord/formatting.js +87 -0
  84. package/dist/discord/index.d.ts +10 -0
  85. package/dist/discord/index.js +13 -0
  86. package/dist/discord/intents.d.ts +48 -0
  87. package/dist/discord/intents.js +128 -0
  88. package/dist/discord/permissions.d.ts +94 -0
  89. package/dist/discord/permissions.js +185 -0
  90. package/dist/discord/snowflake.d.ts +21 -0
  91. package/dist/discord/snowflake.js +36 -0
  92. package/dist/discord/types/application-command.d.ts +332 -0
  93. package/dist/discord/types/application-command.js +48 -0
  94. package/dist/discord/types/application-role-connection-metadata.d.ts +42 -0
  95. package/dist/discord/types/application-role-connection-metadata.js +22 -0
  96. package/dist/discord/types/application.d.ts +208 -0
  97. package/dist/discord/types/application.js +48 -0
  98. package/dist/discord/types/audit-log.d.ts +255 -0
  99. package/dist/discord/types/audit-log.js +144 -0
  100. package/dist/discord/types/auto-moderation.d.ts +167 -0
  101. package/dist/discord/types/auto-moderation.js +52 -0
  102. package/dist/discord/types/channel.d.ts +557 -0
  103. package/dist/discord/types/channel.js +88 -0
  104. package/dist/discord/types/common.d.ts +54 -0
  105. package/dist/discord/types/common.js +38 -0
  106. package/dist/discord/types/component.d.ts +775 -0
  107. package/dist/discord/types/component.js +76 -0
  108. package/dist/discord/types/emoji.d.ts +74 -0
  109. package/dist/discord/types/emoji.js +1 -0
  110. package/dist/discord/types/entitlement.d.ts +84 -0
  111. package/dist/discord/types/entitlement.js +22 -0
  112. package/dist/discord/types/gateway-events.d.ts +1148 -0
  113. package/dist/discord/types/gateway-events.js +54 -0
  114. package/dist/discord/types/gateway.d.ts +38 -0
  115. package/dist/discord/types/gateway.js +1 -0
  116. package/dist/discord/types/guild-scheduled-event.d.ts +257 -0
  117. package/dist/discord/types/guild-scheduled-event.js +68 -0
  118. package/dist/discord/types/guild-template.d.ts +51 -0
  119. package/dist/discord/types/guild-template.js +1 -0
  120. package/dist/discord/types/guild.d.ts +910 -0
  121. package/dist/discord/types/guild.js +153 -0
  122. package/dist/discord/types/index.d.ts +31 -0
  123. package/dist/discord/types/index.js +31 -0
  124. package/dist/discord/types/interaction.d.ts +321 -0
  125. package/dist/discord/types/interaction.js +47 -0
  126. package/dist/discord/types/invite.d.ts +158 -0
  127. package/dist/discord/types/invite.js +39 -0
  128. package/dist/discord/types/message.d.ts +834 -0
  129. package/dist/discord/types/message.js +159 -0
  130. package/dist/discord/types/oauth2.d.ts +22 -0
  131. package/dist/discord/types/oauth2.js +1 -0
  132. package/dist/discord/types/permissions.d.ts +183 -0
  133. package/dist/discord/types/permissions.js +118 -0
  134. package/dist/discord/types/poll.d.ts +106 -0
  135. package/dist/discord/types/poll.js +8 -0
  136. package/dist/discord/types/sku.d.ts +47 -0
  137. package/dist/discord/types/sku.js +26 -0
  138. package/dist/discord/types/soundboard.d.ts +71 -0
  139. package/dist/discord/types/soundboard.js +1 -0
  140. package/dist/discord/types/stage-instance.d.ts +58 -0
  141. package/dist/discord/types/stage-instance.js +10 -0
  142. package/dist/discord/types/sticker.d.ts +115 -0
  143. package/dist/discord/types/sticker.js +20 -0
  144. package/dist/discord/types/subscription.d.ts +54 -0
  145. package/dist/discord/types/subscription.js +12 -0
  146. package/dist/discord/types/team.d.ts +55 -0
  147. package/dist/discord/types/team.js +21 -0
  148. package/dist/discord/types/user.d.ts +273 -0
  149. package/dist/discord/types/user.js +83 -0
  150. package/dist/discord/types/voice.d.ts +72 -0
  151. package/dist/discord/types/voice.js +1 -0
  152. package/dist/discord/types/webhook.d.ts +184 -0
  153. package/dist/discord/types/webhook.js +12 -0
  154. package/dist/events/convention.d.ts +25 -0
  155. package/dist/events/convention.js +97 -0
  156. package/dist/events/event.d.ts +8 -0
  157. package/dist/events/event.js +20 -0
  158. package/dist/events/registry.d.ts +706 -0
  159. package/dist/events/registry.js +839 -0
  160. package/dist/events/router.d.ts +45 -0
  161. package/dist/events/router.js +133 -0
  162. package/dist/events/types.d.ts +7 -0
  163. package/dist/events/types.js +48 -0
  164. package/dist/gateway/errors.d.ts +18 -0
  165. package/dist/gateway/errors.js +47 -0
  166. package/dist/gateway/gateway.d.ts +64 -0
  167. package/dist/gateway/gateway.js +117 -0
  168. package/dist/gateway/identify-queue.d.ts +25 -0
  169. package/dist/gateway/identify-queue.js +29 -0
  170. package/dist/gateway/shard.d.ts +94 -0
  171. package/dist/gateway/shard.js +414 -0
  172. package/dist/gateway/state.d.ts +11 -0
  173. package/dist/gateway/state.js +184 -0
  174. package/dist/index.d.ts +55 -18
  175. package/dist/index.js +38 -12
  176. package/dist/interactions/cooldown.d.ts +33 -0
  177. package/dist/interactions/cooldown.js +74 -0
  178. package/dist/interactions/dispatch.d.ts +91 -0
  179. package/dist/interactions/dispatch.js +110 -0
  180. package/dist/loader/generated.d.ts +37 -0
  181. package/dist/loader/generated.js +114 -0
  182. package/dist/loader/hot.d.ts +13 -0
  183. package/dist/loader/hot.js +85 -0
  184. package/dist/loader/loader.d.ts +72 -0
  185. package/dist/loader/loader.js +135 -0
  186. package/dist/loader/locate.d.ts +10 -0
  187. package/dist/loader/locate.js +36 -0
  188. package/dist/loader/watch.d.ts +17 -0
  189. package/dist/loader/watch.js +66 -0
  190. package/dist/main.d.ts +3 -0
  191. package/dist/main.js +6 -0
  192. package/dist/messages/commands.d.ts +23 -0
  193. package/dist/messages/commands.js +123 -0
  194. package/dist/messages/convention.d.ts +89 -0
  195. package/dist/messages/convention.js +347 -0
  196. package/dist/messages/messages.d.ts +219 -0
  197. package/dist/messages/messages.js +30 -0
  198. package/dist/messages/phrases.d.ts +23 -0
  199. package/dist/messages/phrases.js +44 -0
  200. package/dist/messages/translate.d.ts +100 -0
  201. package/dist/messages/translate.js +249 -0
  202. package/dist/presence/convention.d.ts +26 -0
  203. package/dist/presence/convention.js +133 -0
  204. package/dist/presence/presence.d.ts +57 -0
  205. package/dist/presence/presence.js +27 -0
  206. package/dist/rest/errors.d.ts +55 -0
  207. package/dist/rest/errors.js +92 -0
  208. package/dist/rest/rate-limiter.d.ts +46 -0
  209. package/dist/rest/rate-limiter.js +153 -0
  210. package/dist/rest/rest.d.ts +63 -0
  211. package/dist/rest/rest.js +194 -0
  212. package/dist/structures/base.d.ts +48 -0
  213. package/dist/structures/base.js +84 -0
  214. package/dist/structures/channel.d.ts +380 -0
  215. package/dist/structures/channel.js +627 -0
  216. package/dist/structures/context.d.ts +30 -0
  217. package/dist/structures/context.js +7 -0
  218. package/dist/structures/emoji.d.ts +46 -0
  219. package/dist/structures/emoji.js +65 -0
  220. package/dist/structures/entities.d.ts +62 -0
  221. package/dist/structures/entities.js +226 -0
  222. package/dist/structures/guild.d.ts +348 -0
  223. package/dist/structures/guild.js +466 -0
  224. package/dist/structures/interaction.d.ts +197 -0
  225. package/dist/structures/interaction.js +396 -0
  226. package/dist/structures/invite.d.ts +38 -0
  227. package/dist/structures/invite.js +57 -0
  228. package/dist/structures/known.d.ts +28 -0
  229. package/dist/structures/known.js +58 -0
  230. package/dist/structures/member.d.ts +140 -0
  231. package/dist/structures/member.js +260 -0
  232. package/dist/structures/message.d.ts +197 -0
  233. package/dist/structures/message.js +268 -0
  234. package/dist/structures/payload.d.ts +91 -0
  235. package/dist/structures/payload.js +184 -0
  236. package/dist/structures/role.d.ts +69 -0
  237. package/dist/structures/role.js +112 -0
  238. package/dist/structures/user.d.ts +59 -0
  239. package/dist/structures/user.js +94 -0
  240. package/dist/structures/webhook.d.ts +46 -0
  241. package/dist/structures/webhook.js +79 -0
  242. package/dist/tasks/convention.d.ts +26 -0
  243. package/dist/tasks/convention.js +78 -0
  244. package/dist/tasks/schedule.d.ts +54 -0
  245. package/dist/tasks/schedule.js +236 -0
  246. package/dist/tasks/scheduler.d.ts +33 -0
  247. package/dist/tasks/scheduler.js +107 -0
  248. package/dist/tasks/task.d.ts +76 -0
  249. package/dist/tasks/task.js +28 -0
  250. package/dist/util/case.d.ts +13 -0
  251. package/dist/util/case.js +54 -0
  252. package/dist/util/duration.d.ts +8 -0
  253. package/dist/util/duration.js +29 -0
  254. package/dist/util/websocket.d.ts +9 -0
  255. package/dist/util/websocket.js +31 -0
  256. package/dist/voice/connection.d.ts +90 -0
  257. package/dist/voice/connection.js +494 -0
  258. package/dist/voice/dave.d.ts +109 -0
  259. package/dist/voice/dave.js +245 -0
  260. package/dist/voice/opus.d.ts +19 -0
  261. package/dist/voice/opus.js +273 -0
  262. package/dist/voice/session.d.ts +55 -0
  263. package/dist/voice/session.js +405 -0
  264. package/dist/voice/source.d.ts +22 -0
  265. package/dist/voice/source.js +195 -0
  266. package/dist/voice/transport.d.ts +43 -0
  267. package/dist/voice/transport.js +140 -0
  268. package/dist/voice/usage.d.ts +4 -0
  269. package/dist/voice/usage.js +33 -0
  270. package/package.json +26 -7
  271. package/vendor/dave/LICENSE +231 -0
  272. package/vendor/dave/libdave.d.mts +99 -0
  273. package/vendor/dave/libdave.mjs +2 -0
  274. package/vendor/dave/libdave.wasm +0 -0
  275. package/dist/components.d.ts +0 -97
  276. package/dist/components.js +0 -260
  277. package/dist/context.d.ts +0 -72
  278. package/dist/context.js +0 -273
  279. package/dist/discord/client.d.ts +0 -35
  280. package/dist/discord/client.js +0 -66
  281. package/dist/discord/constants.d.ts +0 -49
  282. package/dist/discord/constants.js +0 -61
  283. package/dist/discord/events.d.ts +0 -129
  284. package/dist/discord/events.js +0 -102
  285. package/dist/discord/gateway.d.ts +0 -61
  286. package/dist/discord/gateway.js +0 -320
  287. package/dist/discord/payloads.d.ts +0 -275
  288. package/dist/discord/payloads.js +0 -3
  289. package/dist/discord/presence.d.ts +0 -42
  290. package/dist/discord/presence.js +0 -51
  291. package/dist/discord/rest.d.ts +0 -49
  292. package/dist/discord/rest.js +0 -271
  293. package/dist/discord/types.d.ts +0 -334
  294. package/dist/discord/types.js +0 -4
  295. package/dist/events.d.ts +0 -94
  296. package/dist/events.js +0 -255
  297. package/dist/presence.d.ts +0 -92
  298. package/dist/presence.js +0 -250
  299. package/dist/structures/Channel.d.ts +0 -110
  300. package/dist/structures/Channel.js +0 -171
  301. package/dist/structures/Guild.d.ts +0 -70
  302. package/dist/structures/Guild.js +0 -105
  303. package/dist/structures/Interaction.d.ts +0 -113
  304. package/dist/structures/Interaction.js +0 -274
  305. package/dist/structures/Member.d.ts +0 -70
  306. package/dist/structures/Member.js +0 -124
  307. package/dist/structures/Message.d.ts +0 -87
  308. package/dist/structures/Message.js +0 -182
  309. package/dist/structures/Reaction.d.ts +0 -38
  310. package/dist/structures/Reaction.js +0 -64
  311. package/dist/structures/Role.d.ts +0 -43
  312. package/dist/structures/Role.js +0 -77
  313. package/dist/structures/User.d.ts +0 -41
  314. package/dist/structures/User.js +0 -79
  315. package/dist/structures/utils.d.ts +0 -72
  316. package/dist/structures/utils.js +0 -59
  317. package/dist/utils/errors.d.ts +0 -5
  318. package/dist/utils/errors.js +0 -28
  319. package/dist/utils/modules.d.ts +0 -39
  320. package/dist/utils/modules.js +0 -156
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Message Types
3
+ * @see https://docs.discord.com/developers/resources/message#message-object-message-types
4
+ */
5
+ export const MessageType = {
6
+ Default: 0,
7
+ RecipientAdd: 1,
8
+ RecipientRemove: 2,
9
+ Call: 3,
10
+ ChannelNameChange: 4,
11
+ ChannelIconChange: 5,
12
+ ChannelPinnedMessage: 6,
13
+ UserJoin: 7,
14
+ GuildBoost: 8,
15
+ GuildBoostTier1: 9,
16
+ GuildBoostTier2: 10,
17
+ GuildBoostTier3: 11,
18
+ ChannelFollowAdd: 12,
19
+ GuildDiscoveryDisqualified: 14,
20
+ GuildDiscoveryRequalified: 15,
21
+ GuildDiscoveryGracePeriodInitialWarning: 16,
22
+ GuildDiscoveryGracePeriodFinalWarning: 17,
23
+ ThreadCreated: 18,
24
+ Reply: 19,
25
+ ChatInputCommand: 20,
26
+ ThreadStarterMessage: 21,
27
+ GuildInviteReminder: 22,
28
+ ContextMenuCommand: 23,
29
+ AutoModerationAction: 24,
30
+ RoleSubscriptionPurchase: 25,
31
+ InteractionPremiumUpsell: 26,
32
+ StageStart: 27,
33
+ StageEnd: 28,
34
+ StageSpeaker: 29,
35
+ StageTopic: 31,
36
+ GuildApplicationPremiumSubscription: 32,
37
+ GuildIncidentAlertModeEnabled: 36,
38
+ GuildIncidentAlertModeDisabled: 37,
39
+ GuildIncidentReportRaid: 38,
40
+ GuildIncidentReportFalseAlarm: 39,
41
+ PurchaseNotification: 44,
42
+ PollResult: 46,
43
+ };
44
+ /**
45
+ * Message Activity Types
46
+ * @see https://docs.discord.com/developers/resources/message#message-object-message-activity-types
47
+ */
48
+ export const MessageActivityType = {
49
+ Join: 1,
50
+ Spectate: 2,
51
+ Listen: 3,
52
+ JoinRequest: 5,
53
+ StreamRequest: 6,
54
+ };
55
+ /**
56
+ * Message Flags
57
+ * @see https://docs.discord.com/developers/resources/message#message-object-message-flags
58
+ */
59
+ export const MessageFlags = {
60
+ /** this message has been published to subscribed channels (via Channel Following) */
61
+ Crossposted: 1 << 0,
62
+ /** this message originated from a message in another channel (via Channel Following) */
63
+ IsCrosspost: 1 << 1,
64
+ /** do not include any embeds when serializing this message */
65
+ SuppressEmbeds: 1 << 2,
66
+ /** the source message for this crosspost has been deleted (via Channel Following) */
67
+ SourceMessageDeleted: 1 << 3,
68
+ /** this message came from the urgent message system */
69
+ Urgent: 1 << 4,
70
+ /** this message has an associated thread, with the same id as the message */
71
+ HasThread: 1 << 5,
72
+ /** this message is only visible to the user who invoked the Interaction */
73
+ Ephemeral: 1 << 6,
74
+ /** this message is an Interaction Response and the bot is "thinking" */
75
+ Loading: 1 << 7,
76
+ /** this message failed to mention some roles and add their members to the thread */
77
+ FailedToMentionSomeRolesInThread: 1 << 8,
78
+ /** this message will not trigger push and desktop notifications */
79
+ SuppressNotifications: 1 << 12,
80
+ /** this message is a voice message */
81
+ IsVoiceMessage: 1 << 13,
82
+ /** this message has a snapshot (via Message Forwarding) */
83
+ HasSnapshot: 1 << 14,
84
+ /** allows you to create fully component-driven messages */
85
+ IsComponentsV2: 1 << 15,
86
+ };
87
+ /**
88
+ * Message Reference Types
89
+ * @see https://docs.discord.com/developers/resources/message#message-reference-types
90
+ */
91
+ export const MessageReferenceType = {
92
+ /** A standard reference used by replies. */
93
+ Default: 0,
94
+ /** Reference used to point to a message at a point in time. */
95
+ Forward: 1,
96
+ };
97
+ /**
98
+ * Embed Flags
99
+ * @see https://docs.discord.com/developers/resources/message#embed-object-embed-flags
100
+ */
101
+ export const EmbedFlags = {
102
+ /** this embed is a fallback for a reply to an activity card */
103
+ IsContentInventoryEntry: 1 << 5,
104
+ };
105
+ /**
106
+ * Embed Media Flags
107
+ * @see https://docs.discord.com/developers/resources/message#embed-object-embed-media-flags
108
+ */
109
+ export const EmbedMediaFlags = {
110
+ /** this image is animated */
111
+ IsAnimated: 1 << 5,
112
+ };
113
+ /**
114
+ * Attachment Flags
115
+ * @see https://docs.discord.com/developers/resources/message#attachment-object-attachment-flags
116
+ */
117
+ export const AttachmentFlags = {
118
+ /** this attachment is a Clip from a stream */
119
+ IsClip: 1 << 0,
120
+ /** this attachment is the thumbnail of a thread in a media channel, displayed in the grid but not on the message */
121
+ IsThumbnail: 1 << 1,
122
+ /** this attachment has been edited using the remix feature on mobile (deprecated) */
123
+ IsRemix: 1 << 2,
124
+ /** this attachment was marked as a spoiler and is blurred until clicked */
125
+ IsSpoiler: 1 << 3,
126
+ /** this attachment is an animated image */
127
+ IsAnimated: 1 << 5,
128
+ };
129
+ /**
130
+ * Allowed Mention Types
131
+ * @see https://docs.discord.com/developers/resources/message#allowed-mentions-object-allowed-mention-types
132
+ */
133
+ export const AllowedMentionType = {
134
+ /** Controls role mentions */
135
+ Roles: 'roles',
136
+ /** Controls user mentions */
137
+ Users: 'users',
138
+ /** Controls @everyone and @here mentions */
139
+ Everyone: 'everyone',
140
+ };
141
+ /**
142
+ * Base Theme Types
143
+ * @see https://docs.discord.com/developers/resources/message#base-theme-types
144
+ */
145
+ export const SharedClientThemeBaseType = {
146
+ Unset: 0,
147
+ Dark: 1,
148
+ Light: 2,
149
+ Darker: 3,
150
+ Midnight: 4,
151
+ };
152
+ /**
153
+ * Reaction Types
154
+ * @see https://docs.discord.com/developers/resources/message#get-reactions-reaction-types
155
+ */
156
+ export const ReactionType = {
157
+ Normal: 0,
158
+ Burst: 1,
159
+ };
@@ -0,0 +1,22 @@
1
+ import type { RawApplication } from './application.js';
2
+ import type { ISO8601Timestamp } from './common.js';
3
+ import type { RawUser } from './user.js';
4
+ /**
5
+ * Response Structure
6
+ * @see https://docs.discord.com/developers/topics/oauth2#get-current-authorization-information-response-structure
7
+ */
8
+ export interface GetCurrentAuthorizationInformationResponse {
9
+ /** the current application */
10
+ application: Partial<RawApplication>;
11
+ /** the scopes the user has authorized the application for */
12
+ scopes: string[];
13
+ /** when the access token expires */
14
+ expires: ISO8601Timestamp;
15
+ /** the user who has authorized, if the user has authorized with the `identify` scope */
16
+ user?: RawUser;
17
+ }
18
+ /**
19
+ * OAuth2 Scopes
20
+ * @see https://docs.discord.com/developers/topics/oauth2#shared-resources-oauth2-scopes
21
+ */
22
+ export type OAuth2Scope = 'activities.read' | 'activities.write' | 'applications.builds.read' | 'applications.builds.upload' | 'applications.commands' | 'applications.commands.update' | 'applications.commands.permissions.update' | 'applications.entitlements' | 'applications.store.update' | 'bot' | 'connections' | 'dm_channels.read' | 'email' | 'gdm.join' | 'guilds' | 'guilds.join' | 'guilds.members.read' | 'identify' | 'identify.premium' | 'messages.read' | 'relationships.read' | 'role_connections.write' | 'rpc' | 'rpc.activities.write' | 'rpc.notifications.read' | 'rpc.voice.read' | 'rpc.voice.write' | 'voice' | 'webhook.incoming';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,183 @@
1
+ import type { Snowflake } from './common.js';
2
+ /**
3
+ * Bitwise Permission Flags
4
+ * @see https://docs.discord.com/developers/topics/permissions#permissions-bitwise-permission-flags
5
+ */
6
+ export declare const PermissionFlags: {
7
+ /** Allows creation of instant invites */
8
+ readonly CreateInstantInvite: bigint;
9
+ /** Allows kicking members */
10
+ readonly KickMembers: bigint;
11
+ /** Allows banning members */
12
+ readonly BanMembers: bigint;
13
+ /** Allows all permissions and bypasses channel permission overwrites */
14
+ readonly Administrator: bigint;
15
+ /** Allows management and editing of channels */
16
+ readonly ManageChannels: bigint;
17
+ /** Allows management and editing of the guild */
18
+ readonly ManageGuild: bigint;
19
+ /** Allows for adding new reactions to messages. This permission does not apply to reacting with an existing reaction on a message. */
20
+ readonly AddReactions: bigint;
21
+ /** Allows for viewing of audit logs */
22
+ readonly ViewAuditLog: bigint;
23
+ /** Allows for using priority speaker in a voice channel */
24
+ readonly PrioritySpeaker: bigint;
25
+ /** Allows the user to go live */
26
+ readonly Stream: bigint;
27
+ /** Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels */
28
+ readonly ViewChannel: bigint;
29
+ /** Allows for sending messages in a channel and creating threads in a forum (does not allow sending messages in threads) */
30
+ readonly SendMessages: bigint;
31
+ /** Allows for sending of `/tts` messages */
32
+ readonly SendTtsMessages: bigint;
33
+ /** Allows for deletion of other users messages */
34
+ readonly ManageMessages: bigint;
35
+ /** Links sent by users with this permission will be auto-embedded */
36
+ readonly EmbedLinks: bigint;
37
+ /** Allows for uploading images and files */
38
+ readonly AttachFiles: bigint;
39
+ /** Allows for reading of message history */
40
+ readonly ReadMessageHistory: bigint;
41
+ /** Allows for using the `@everyone` tag to notify all users in a channel, and the `@here` tag to notify all online users in a channel */
42
+ readonly MentionEveryone: bigint;
43
+ /** Allows the usage of custom emojis from other servers */
44
+ readonly UseExternalEmojis: bigint;
45
+ /** Allows for viewing guild insights */
46
+ readonly ViewGuildInsights: bigint;
47
+ /** Allows for joining of a voice channel */
48
+ readonly Connect: bigint;
49
+ /** Allows for speaking in a voice channel */
50
+ readonly Speak: bigint;
51
+ /** Allows for muting members in a voice channel */
52
+ readonly MuteMembers: bigint;
53
+ /** Allows for deafening of members in a voice channel */
54
+ readonly DeafenMembers: bigint;
55
+ /** Allows for moving of members between voice channels */
56
+ readonly MoveMembers: bigint;
57
+ /** Allows for using voice-activity-detection in a voice channel */
58
+ readonly UseVad: bigint;
59
+ /** Allows for modification of own nickname */
60
+ readonly ChangeNickname: bigint;
61
+ /** Allows for modification of other users nicknames */
62
+ readonly ManageNicknames: bigint;
63
+ /** Allows management and editing of roles */
64
+ readonly ManageRoles: bigint;
65
+ /** Allows management and editing of webhooks */
66
+ readonly ManageWebhooks: bigint;
67
+ /** Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users */
68
+ readonly ManageGuildExpressions: bigint;
69
+ /** Allows members to use application commands, including slash commands and context menu commands. */
70
+ readonly UseApplicationCommands: bigint;
71
+ /** Allows for requesting to speak in stage channels */
72
+ readonly RequestToSpeak: bigint;
73
+ /** Allows for editing and deleting scheduled events created by all users */
74
+ readonly ManageEvents: bigint;
75
+ /** Allows for deleting and archiving threads, and viewing all private threads */
76
+ readonly ManageThreads: bigint;
77
+ /** Allows for creating public and announcement threads */
78
+ readonly CreatePublicThreads: bigint;
79
+ /** Allows for creating private threads */
80
+ readonly CreatePrivateThreads: bigint;
81
+ /** Allows the usage of custom stickers from other servers */
82
+ readonly UseExternalStickers: bigint;
83
+ /** Allows for sending messages in threads */
84
+ readonly SendMessagesInThreads: bigint;
85
+ /** Allows for using Activities (applications with the `EMBEDDED` flag) */
86
+ readonly UseEmbeddedActivities: bigint;
87
+ /** Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels */
88
+ readonly ModerateMembers: bigint;
89
+ /** Allows for viewing role subscription insights */
90
+ readonly ViewCreatorMonetizationAnalytics: bigint;
91
+ /** Allows for using soundboard in a voice channel */
92
+ readonly UseSoundboard: bigint;
93
+ /** Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user. */
94
+ readonly CreateGuildExpressions: bigint;
95
+ /** Allows for creating scheduled events, and editing and deleting those created by the current user. */
96
+ readonly CreateEvents: bigint;
97
+ /** Allows the usage of custom soundboard sounds from other servers */
98
+ readonly UseExternalSounds: bigint;
99
+ /** Allows sending voice messages */
100
+ readonly SendVoiceMessages: bigint;
101
+ /** Allows setting voice channel status */
102
+ readonly SetVoiceChannelStatus: bigint;
103
+ /** Allows sending polls */
104
+ readonly SendPolls: bigint;
105
+ /** Allows user-installed apps to send public responses. When disabled, users will still be allowed to use their apps but the responses will be ephemeral. This only applies to apps not also installed to the server. */
106
+ readonly UseExternalApps: bigint;
107
+ /** Allows pinning and unpinning messages */
108
+ readonly PinMessages: bigint;
109
+ /** Allows bypassing slowmode restrictions */
110
+ readonly BypassSlowmode: bigint;
111
+ };
112
+ export type PermissionFlags = (typeof PermissionFlags)[keyof typeof PermissionFlags];
113
+ /**
114
+ * Role Structure
115
+ * @see https://docs.discord.com/developers/topics/permissions#role-object-role-structure
116
+ */
117
+ export interface RawRole {
118
+ /** role id */
119
+ id: Snowflake;
120
+ /** role name */
121
+ name: string;
122
+ /** **Deprecated** integer representation of hexadecimal color code */
123
+ color: number;
124
+ /** the role's colors */
125
+ colors: RawRoleColors;
126
+ /** if this role is pinned in the user listing */
127
+ hoist: boolean;
128
+ /** role icon hash */
129
+ icon?: string | null;
130
+ /** role unicode emoji */
131
+ unicode_emoji?: string | null;
132
+ /** position of this role (roles with the same position are sorted by id) */
133
+ position: number;
134
+ /** permission bit set */
135
+ permissions: string;
136
+ /** whether this role is managed by an integration */
137
+ managed: boolean;
138
+ /** whether this role is mentionable */
139
+ mentionable: boolean;
140
+ /** the tags this role has */
141
+ tags?: RawRoleTags;
142
+ /** role flags combined as a bitfield */
143
+ flags: number;
144
+ }
145
+ /**
146
+ * Role Tags Structure
147
+ * @see https://docs.discord.com/developers/topics/permissions#role-object-role-tags-structure
148
+ */
149
+ export interface RawRoleTags {
150
+ /** the id of the bot this role belongs to */
151
+ bot_id?: Snowflake;
152
+ /** the id of the integration this role belongs to */
153
+ integration_id?: Snowflake;
154
+ /** whether this is the guild's Booster role */
155
+ premium_subscriber?: null;
156
+ /** the id of this role's subscription sku and listing */
157
+ subscription_listing_id?: Snowflake;
158
+ /** whether this role is available for purchase */
159
+ available_for_purchase?: null;
160
+ /** whether this role is a guild's linked role */
161
+ guild_connections?: null;
162
+ }
163
+ /**
164
+ * Role Colors Object
165
+ * @see https://docs.discord.com/developers/topics/permissions#role-object-role-colors-object
166
+ */
167
+ export interface RawRoleColors {
168
+ /** the primary color for the role */
169
+ primary_color: number;
170
+ /** the secondary color for the role, this will make the role a gradient between the other provided colors */
171
+ secondary_color: number | null;
172
+ /** the tertiary color for the role, this will turn the gradient into a holographic style */
173
+ tertiary_color: number | null;
174
+ }
175
+ /**
176
+ * Role Flags
177
+ * @see https://docs.discord.com/developers/topics/permissions#role-object-role-flags
178
+ */
179
+ export declare const RoleFlags: {
180
+ /** role can be selected by members in an onboarding prompt */
181
+ readonly InPrompt: number;
182
+ };
183
+ export type RoleFlags = (typeof RoleFlags)[keyof typeof RoleFlags];
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Bitwise Permission Flags
3
+ * @see https://docs.discord.com/developers/topics/permissions#permissions-bitwise-permission-flags
4
+ */
5
+ export const PermissionFlags = {
6
+ /** Allows creation of instant invites */
7
+ CreateInstantInvite: 1n << 0n,
8
+ /** Allows kicking members */
9
+ KickMembers: 1n << 1n,
10
+ /** Allows banning members */
11
+ BanMembers: 1n << 2n,
12
+ /** Allows all permissions and bypasses channel permission overwrites */
13
+ Administrator: 1n << 3n,
14
+ /** Allows management and editing of channels */
15
+ ManageChannels: 1n << 4n,
16
+ /** Allows management and editing of the guild */
17
+ ManageGuild: 1n << 5n,
18
+ /** Allows for adding new reactions to messages. This permission does not apply to reacting with an existing reaction on a message. */
19
+ AddReactions: 1n << 6n,
20
+ /** Allows for viewing of audit logs */
21
+ ViewAuditLog: 1n << 7n,
22
+ /** Allows for using priority speaker in a voice channel */
23
+ PrioritySpeaker: 1n << 8n,
24
+ /** Allows the user to go live */
25
+ Stream: 1n << 9n,
26
+ /** Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels */
27
+ ViewChannel: 1n << 10n,
28
+ /** Allows for sending messages in a channel and creating threads in a forum (does not allow sending messages in threads) */
29
+ SendMessages: 1n << 11n,
30
+ /** Allows for sending of `/tts` messages */
31
+ SendTtsMessages: 1n << 12n,
32
+ /** Allows for deletion of other users messages */
33
+ ManageMessages: 1n << 13n,
34
+ /** Links sent by users with this permission will be auto-embedded */
35
+ EmbedLinks: 1n << 14n,
36
+ /** Allows for uploading images and files */
37
+ AttachFiles: 1n << 15n,
38
+ /** Allows for reading of message history */
39
+ ReadMessageHistory: 1n << 16n,
40
+ /** Allows for using the `@everyone` tag to notify all users in a channel, and the `@here` tag to notify all online users in a channel */
41
+ MentionEveryone: 1n << 17n,
42
+ /** Allows the usage of custom emojis from other servers */
43
+ UseExternalEmojis: 1n << 18n,
44
+ /** Allows for viewing guild insights */
45
+ ViewGuildInsights: 1n << 19n,
46
+ /** Allows for joining of a voice channel */
47
+ Connect: 1n << 20n,
48
+ /** Allows for speaking in a voice channel */
49
+ Speak: 1n << 21n,
50
+ /** Allows for muting members in a voice channel */
51
+ MuteMembers: 1n << 22n,
52
+ /** Allows for deafening of members in a voice channel */
53
+ DeafenMembers: 1n << 23n,
54
+ /** Allows for moving of members between voice channels */
55
+ MoveMembers: 1n << 24n,
56
+ /** Allows for using voice-activity-detection in a voice channel */
57
+ UseVad: 1n << 25n,
58
+ /** Allows for modification of own nickname */
59
+ ChangeNickname: 1n << 26n,
60
+ /** Allows for modification of other users nicknames */
61
+ ManageNicknames: 1n << 27n,
62
+ /** Allows management and editing of roles */
63
+ ManageRoles: 1n << 28n,
64
+ /** Allows management and editing of webhooks */
65
+ ManageWebhooks: 1n << 29n,
66
+ /** Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users */
67
+ ManageGuildExpressions: 1n << 30n,
68
+ /** Allows members to use application commands, including slash commands and context menu commands. */
69
+ UseApplicationCommands: 1n << 31n,
70
+ /** Allows for requesting to speak in stage channels */
71
+ RequestToSpeak: 1n << 32n,
72
+ /** Allows for editing and deleting scheduled events created by all users */
73
+ ManageEvents: 1n << 33n,
74
+ /** Allows for deleting and archiving threads, and viewing all private threads */
75
+ ManageThreads: 1n << 34n,
76
+ /** Allows for creating public and announcement threads */
77
+ CreatePublicThreads: 1n << 35n,
78
+ /** Allows for creating private threads */
79
+ CreatePrivateThreads: 1n << 36n,
80
+ /** Allows the usage of custom stickers from other servers */
81
+ UseExternalStickers: 1n << 37n,
82
+ /** Allows for sending messages in threads */
83
+ SendMessagesInThreads: 1n << 38n,
84
+ /** Allows for using Activities (applications with the `EMBEDDED` flag) */
85
+ UseEmbeddedActivities: 1n << 39n,
86
+ /** Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels */
87
+ ModerateMembers: 1n << 40n,
88
+ /** Allows for viewing role subscription insights */
89
+ ViewCreatorMonetizationAnalytics: 1n << 41n,
90
+ /** Allows for using soundboard in a voice channel */
91
+ UseSoundboard: 1n << 42n,
92
+ /** Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user. */
93
+ CreateGuildExpressions: 1n << 43n,
94
+ /** Allows for creating scheduled events, and editing and deleting those created by the current user. */
95
+ CreateEvents: 1n << 44n,
96
+ /** Allows the usage of custom soundboard sounds from other servers */
97
+ UseExternalSounds: 1n << 45n,
98
+ /** Allows sending voice messages */
99
+ SendVoiceMessages: 1n << 46n,
100
+ /** Allows setting voice channel status */
101
+ SetVoiceChannelStatus: 1n << 48n,
102
+ /** Allows sending polls */
103
+ SendPolls: 1n << 49n,
104
+ /** Allows user-installed apps to send public responses. When disabled, users will still be allowed to use their apps but the responses will be ephemeral. This only applies to apps not also installed to the server. */
105
+ UseExternalApps: 1n << 50n,
106
+ /** Allows pinning and unpinning messages */
107
+ PinMessages: 1n << 51n,
108
+ /** Allows bypassing slowmode restrictions */
109
+ BypassSlowmode: 1n << 52n,
110
+ };
111
+ /**
112
+ * Role Flags
113
+ * @see https://docs.discord.com/developers/topics/permissions#role-object-role-flags
114
+ */
115
+ export const RoleFlags = {
116
+ /** role can be selected by members in an onboarding prompt */
117
+ InPrompt: 1 << 0,
118
+ };
@@ -0,0 +1,106 @@
1
+ import type { ISO8601Timestamp, Snowflake } from './common.js';
2
+ import type { RawEmoji } from './emoji.js';
3
+ import type { RawUser } from './user.js';
4
+ /**
5
+ * Poll Object Structure
6
+ * @see https://docs.discord.com/developers/resources/poll#poll-object-poll-object-structure
7
+ */
8
+ export interface RawPoll {
9
+ /** The question of the poll. Only `text` is supported. */
10
+ question: RawPollMedia;
11
+ /** Each of the answers available in the poll. */
12
+ answers: RawPollAnswer[];
13
+ /** The time when the poll ends. */
14
+ expiry: ISO8601Timestamp | null;
15
+ /** Whether a user can select multiple answers */
16
+ allow_multiselect: boolean;
17
+ /** The layout type of the poll */
18
+ layout_type: PollLayoutType;
19
+ /** The results of the poll */
20
+ results?: RawPollResults;
21
+ }
22
+ /**
23
+ * Poll Create Request Object Structure
24
+ * @see https://docs.discord.com/developers/resources/poll#poll-create-request-object-poll-create-request-object-structure
25
+ */
26
+ export interface RawPollCreateRequest {
27
+ /** The question of the poll. Only `text` is supported. */
28
+ question: RawPollMedia;
29
+ /** Each of the answers available in the poll, up to 10 */
30
+ answers: RawPollAnswer[];
31
+ /** Number of hours the poll should be open for, up to 32 days. Defaults to 24 */
32
+ duration?: number;
33
+ /** Whether a user can select multiple answers. Defaults to false */
34
+ allow_multiselect?: boolean;
35
+ /** The layout type of the poll. Defaults to... DEFAULT! */
36
+ layout_type?: PollLayoutType;
37
+ }
38
+ /**
39
+ * Layout Type
40
+ * @see https://docs.discord.com/developers/resources/poll#layout-type
41
+ */
42
+ export declare const PollLayoutType: {
43
+ /** The, uhm, default layout type. */
44
+ readonly Default: 1;
45
+ };
46
+ export type PollLayoutType = (typeof PollLayoutType)[keyof typeof PollLayoutType];
47
+ /**
48
+ * Poll Media Object Structure
49
+ * @see https://docs.discord.com/developers/resources/poll#poll-media-object-poll-media-object-structure
50
+ */
51
+ export interface RawPollMedia {
52
+ /** The text of the field */
53
+ text?: string;
54
+ /** The emoji of the field */
55
+ emoji?: Partial<RawEmoji>;
56
+ }
57
+ /**
58
+ * Poll Answer Object Structure
59
+ * @see https://docs.discord.com/developers/resources/poll#poll-answer-object-poll-answer-object-structure
60
+ */
61
+ export interface RawPollAnswer {
62
+ /** The ID of the answer */
63
+ answer_id: number;
64
+ /** The data of the answer */
65
+ poll_media: RawPollMedia;
66
+ }
67
+ /**
68
+ * Poll Results Object Structure
69
+ * @see https://docs.discord.com/developers/resources/poll#poll-results-object-poll-results-object-structure
70
+ */
71
+ export interface RawPollResults {
72
+ /** Whether the votes have been precisely counted */
73
+ is_finalized: boolean;
74
+ /** The counts for each answer */
75
+ answer_counts: RawPollAnswerCount[];
76
+ }
77
+ /**
78
+ * Poll Answer Count Object Structure
79
+ * @see https://docs.discord.com/developers/resources/poll#poll-results-object-poll-answer-count-object-structure
80
+ */
81
+ export interface RawPollAnswerCount {
82
+ /** The `answer_id` */
83
+ id: number;
84
+ /** The number of votes for this answer */
85
+ count: number;
86
+ /** Whether the current user voted for this answer */
87
+ me_voted: boolean;
88
+ }
89
+ /**
90
+ * Query String Params
91
+ * @see https://docs.discord.com/developers/resources/poll#get-answer-voters-query-string-params
92
+ */
93
+ export interface GetAnswerVotersQuery {
94
+ /** Get users after this user ID */
95
+ after?: Snowflake;
96
+ /** Max number of users to return (1-100) */
97
+ limit?: number;
98
+ }
99
+ /**
100
+ * Response Body
101
+ * @see https://docs.discord.com/developers/resources/poll#get-answer-voters-response-body
102
+ */
103
+ export interface GetAnswerVotersResponse {
104
+ /** Users who voted for this answer */
105
+ users: RawUser[];
106
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Layout Type
3
+ * @see https://docs.discord.com/developers/resources/poll#layout-type
4
+ */
5
+ export const PollLayoutType = {
6
+ /** The, uhm, default layout type. */
7
+ Default: 1,
8
+ };
@@ -0,0 +1,47 @@
1
+ import type { Snowflake } from './common.js';
2
+ /**
3
+ * SKU Structure
4
+ * @see https://docs.discord.com/developers/resources/sku#sku-object-sku-structure
5
+ */
6
+ export interface RawSku {
7
+ /** ID of SKU */
8
+ id: Snowflake;
9
+ /** Type of SKU */
10
+ type: SkuType;
11
+ /** ID of the parent application */
12
+ application_id: Snowflake;
13
+ /** Customer-facing name of your premium offering */
14
+ name: string;
15
+ /** System-generated URL slug based on the SKU's name */
16
+ slug: string;
17
+ /** SKU flags combined as a bitfield */
18
+ flags: number;
19
+ }
20
+ /**
21
+ * SKU Types
22
+ * @see https://docs.discord.com/developers/resources/sku#sku-object-sku-types
23
+ */
24
+ export declare const SkuType: {
25
+ /** Durable one-time purchase */
26
+ readonly Durable: 2;
27
+ /** Consumable one-time purchase */
28
+ readonly Consumable: 3;
29
+ /** Represents a recurring subscription */
30
+ readonly Subscription: 5;
31
+ /** System-generated group for each SUBSCRIPTION SKU created */
32
+ readonly SubscriptionGroup: 6;
33
+ };
34
+ export type SkuType = (typeof SkuType)[keyof typeof SkuType];
35
+ /**
36
+ * SKU Flags
37
+ * @see https://docs.discord.com/developers/resources/sku#sku-object-sku-flags
38
+ */
39
+ export declare const SkuFlags: {
40
+ /** SKU is available for purchase */
41
+ readonly Available: number;
42
+ /** Recurring SKU that can be purchased by a user and applied to a single server. Grants access to every user in that server. */
43
+ readonly GuildSubscription: number;
44
+ /** Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server. */
45
+ readonly UserSubscription: number;
46
+ };
47
+ export type SkuFlags = (typeof SkuFlags)[keyof typeof SkuFlags];
@@ -0,0 +1,26 @@
1
+ /**
2
+ * SKU Types
3
+ * @see https://docs.discord.com/developers/resources/sku#sku-object-sku-types
4
+ */
5
+ export const SkuType = {
6
+ /** Durable one-time purchase */
7
+ Durable: 2,
8
+ /** Consumable one-time purchase */
9
+ Consumable: 3,
10
+ /** Represents a recurring subscription */
11
+ Subscription: 5,
12
+ /** System-generated group for each SUBSCRIPTION SKU created */
13
+ SubscriptionGroup: 6,
14
+ };
15
+ /**
16
+ * SKU Flags
17
+ * @see https://docs.discord.com/developers/resources/sku#sku-object-sku-flags
18
+ */
19
+ export const SkuFlags = {
20
+ /** SKU is available for purchase */
21
+ Available: 1 << 2,
22
+ /** Recurring SKU that can be purchased by a user and applied to a single server. Grants access to every user in that server. */
23
+ GuildSubscription: 1 << 7,
24
+ /** Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server. */
25
+ UserSubscription: 1 << 8,
26
+ };