seyfert 1.5.0 → 2.0.0

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 (427) hide show
  1. package/LICENSE +21 -190
  2. package/README.md +18 -10
  3. package/lib/api/Router.js +2 -2
  4. package/lib/api/Routes/applications.d.ts +23 -1
  5. package/lib/api/Routes/channels.d.ts +1 -1
  6. package/lib/api/Routes/gateway.d.ts +1 -1
  7. package/lib/api/Routes/guilds.d.ts +5 -2
  8. package/lib/api/Routes/interactions.d.ts +1 -1
  9. package/lib/api/Routes/invites.d.ts +1 -1
  10. package/lib/api/Routes/stage-instances.d.ts +1 -1
  11. package/lib/api/Routes/stickers.d.ts +2 -2
  12. package/lib/api/Routes/users.d.ts +1 -1
  13. package/lib/api/Routes/voice.d.ts +1 -1
  14. package/lib/api/Routes/webhooks.d.ts +2 -2
  15. package/lib/api/api.d.ts +2 -2
  16. package/lib/api/api.js +2 -14
  17. package/lib/api/bucket.d.ts +0 -1
  18. package/lib/api/shared.d.ts +0 -1
  19. package/lib/api/utils/constants.d.ts +2 -5
  20. package/lib/api/utils/constants.js +3 -7
  21. package/lib/api/utils/utils.d.ts +1 -2
  22. package/lib/api/utils/utils.js +2 -3
  23. package/lib/builders/ActionRow.d.ts +1 -1
  24. package/lib/builders/ActionRow.js +3 -3
  25. package/lib/builders/Attachment.d.ts +2 -3
  26. package/lib/builders/Attachment.js +12 -13
  27. package/lib/builders/Base.d.ts +2 -2
  28. package/lib/builders/Base.js +1 -1
  29. package/lib/builders/Button.d.ts +7 -7
  30. package/lib/builders/Button.js +11 -9
  31. package/lib/builders/Embed.d.ts +1 -1
  32. package/lib/builders/Modal.d.ts +1 -1
  33. package/lib/builders/Modal.js +2 -2
  34. package/lib/builders/Poll.d.ts +2 -2
  35. package/lib/builders/Poll.js +5 -6
  36. package/lib/builders/SelectMenu.d.ts +1 -1
  37. package/lib/builders/SelectMenu.js +17 -18
  38. package/lib/builders/index.d.ts +1 -1
  39. package/lib/builders/index.js +10 -11
  40. package/lib/cache/adapters/default.d.ts +16 -9
  41. package/lib/cache/adapters/default.js +42 -31
  42. package/lib/cache/adapters/index.d.ts +0 -1
  43. package/lib/cache/adapters/index.js +0 -1
  44. package/lib/cache/adapters/limited.d.ts +17 -12
  45. package/lib/cache/adapters/limited.js +80 -36
  46. package/lib/cache/adapters/types.d.ts +6 -7
  47. package/lib/cache/adapters/workeradapter.d.ts +6 -6
  48. package/lib/cache/adapters/workeradapter.js +13 -0
  49. package/lib/cache/index.d.ts +18 -9
  50. package/lib/cache/index.js +319 -21
  51. package/lib/cache/resources/bans.d.ts +9 -6
  52. package/lib/cache/resources/bans.js +13 -4
  53. package/lib/cache/resources/channels.d.ts +6 -4
  54. package/lib/cache/resources/channels.js +13 -7
  55. package/lib/cache/resources/default/base.d.ts +7 -7
  56. package/lib/cache/resources/default/base.js +2 -2
  57. package/lib/cache/resources/default/guild-based.d.ts +6 -6
  58. package/lib/cache/resources/default/guild-based.js +6 -6
  59. package/lib/cache/resources/default/guild-related.d.ts +7 -7
  60. package/lib/cache/resources/default/guild-related.js +10 -8
  61. package/lib/cache/resources/emojis.d.ts +15 -6
  62. package/lib/cache/resources/emojis.js +13 -4
  63. package/lib/cache/resources/guilds.d.ts +9 -6
  64. package/lib/cache/resources/guilds.js +27 -6
  65. package/lib/cache/resources/members.d.ts +9 -6
  66. package/lib/cache/resources/members.js +22 -6
  67. package/lib/cache/resources/messages.d.ts +11 -7
  68. package/lib/cache/resources/messages.js +19 -7
  69. package/lib/cache/resources/overwrites.d.ts +11 -2
  70. package/lib/cache/resources/overwrites.js +9 -0
  71. package/lib/cache/resources/presence.d.ts +3 -2
  72. package/lib/cache/resources/roles.d.ts +9 -6
  73. package/lib/cache/resources/roles.js +13 -4
  74. package/lib/cache/resources/stage-instances.d.ts +2 -2
  75. package/lib/cache/resources/stickers.d.ts +9 -6
  76. package/lib/cache/resources/stickers.js +13 -4
  77. package/lib/cache/resources/threads.d.ts +9 -6
  78. package/lib/cache/resources/threads.js +13 -4
  79. package/lib/cache/resources/users.d.ts +9 -6
  80. package/lib/cache/resources/users.js +13 -4
  81. package/lib/cache/resources/voice-states.d.ts +11 -8
  82. package/lib/cache/resources/voice-states.js +15 -4
  83. package/lib/client/base.d.ts +28 -20
  84. package/lib/client/base.js +58 -56
  85. package/lib/client/client.d.ts +7 -16
  86. package/lib/client/client.js +29 -31
  87. package/lib/client/collectors.d.ts +10 -10
  88. package/lib/client/collectors.js +26 -1
  89. package/lib/client/httpclient.d.ts +8 -13
  90. package/lib/client/httpclient.js +27 -218
  91. package/lib/client/index.d.ts +1 -0
  92. package/lib/client/index.js +1 -0
  93. package/lib/client/transformers.d.ts +68 -0
  94. package/lib/client/transformers.js +99 -0
  95. package/lib/client/types.d.ts +5 -0
  96. package/lib/client/types.js +2 -0
  97. package/lib/client/workerclient.d.ts +14 -14
  98. package/lib/client/workerclient.js +112 -66
  99. package/lib/commands/applications/chat.d.ts +35 -34
  100. package/lib/commands/applications/chat.js +5 -9
  101. package/lib/commands/applications/chatcontext.d.ts +17 -17
  102. package/lib/commands/applications/chatcontext.js +5 -5
  103. package/lib/commands/applications/menu.d.ts +2 -3
  104. package/lib/commands/applications/menu.js +2 -5
  105. package/lib/commands/applications/menucontext.d.ts +14 -13
  106. package/lib/commands/applications/menucontext.js +9 -9
  107. package/lib/commands/applications/options.d.ts +1 -1
  108. package/lib/commands/applications/options.js +20 -21
  109. package/lib/commands/applications/shared.d.ts +3 -1
  110. package/lib/commands/decorators.d.ts +38 -20
  111. package/lib/commands/decorators.js +17 -18
  112. package/lib/commands/handle.d.ts +64 -0
  113. package/lib/commands/handle.js +685 -0
  114. package/lib/commands/handler.d.ts +27 -18
  115. package/lib/commands/handler.js +290 -164
  116. package/lib/commands/optionresolver.d.ts +13 -13
  117. package/lib/commands/optionresolver.js +23 -28
  118. package/lib/common/bot/watcher.d.ts +4 -33
  119. package/lib/common/bot/watcher.js +0 -109
  120. package/lib/common/index.d.ts +1 -0
  121. package/lib/common/index.js +1 -0
  122. package/lib/common/it/colors.js +48 -49
  123. package/lib/common/it/formatter.d.ts +32 -0
  124. package/lib/common/it/formatter.js +42 -0
  125. package/lib/common/it/logger.d.ts +0 -1
  126. package/lib/common/it/logger.js +3 -3
  127. package/lib/common/it/utils.d.ts +15 -2
  128. package/lib/common/it/utils.js +78 -17
  129. package/lib/common/shorters/application.d.ts +56 -0
  130. package/lib/common/shorters/application.js +81 -0
  131. package/lib/common/shorters/bans.d.ts +4 -5
  132. package/lib/common/shorters/bans.js +3 -3
  133. package/lib/common/shorters/channels.d.ts +7 -6
  134. package/lib/common/shorters/channels.js +19 -15
  135. package/lib/common/shorters/emojis.d.ts +5 -6
  136. package/lib/common/shorters/emojis.js +5 -5
  137. package/lib/common/shorters/guilds.d.ts +18 -16
  138. package/lib/common/shorters/guilds.js +31 -26
  139. package/lib/common/shorters/interaction.d.ts +6 -6
  140. package/lib/common/shorters/interaction.js +3 -2
  141. package/lib/common/shorters/members.d.ts +29 -12
  142. package/lib/common/shorters/members.js +55 -16
  143. package/lib/common/shorters/messages.d.ts +7 -8
  144. package/lib/common/shorters/messages.js +8 -7
  145. package/lib/common/shorters/reactions.d.ts +3 -3
  146. package/lib/common/shorters/reactions.js +11 -11
  147. package/lib/common/shorters/roles.d.ts +9 -7
  148. package/lib/common/shorters/roles.js +26 -7
  149. package/lib/common/shorters/templates.d.ts +7 -8
  150. package/lib/common/shorters/templates.js +7 -7
  151. package/lib/common/shorters/threads.d.ts +6 -7
  152. package/lib/common/shorters/threads.js +6 -9
  153. package/lib/common/shorters/users.d.ts +4 -4
  154. package/lib/common/shorters/users.js +8 -4
  155. package/lib/common/shorters/webhook.d.ts +10 -10
  156. package/lib/common/shorters/webhook.js +10 -9
  157. package/lib/common/types/resolvables.d.ts +2 -2
  158. package/lib/common/types/util.d.ts +3 -1
  159. package/lib/common/types/write.d.ts +1 -1
  160. package/lib/components/ActionRow.d.ts +1 -1
  161. package/lib/components/BaseComponent.d.ts +1 -1
  162. package/lib/components/BaseComponent.js +1 -1
  163. package/lib/components/BaseSelectMenuComponent.d.ts +1 -1
  164. package/lib/components/ButtonComponent.d.ts +17 -7
  165. package/lib/components/ButtonComponent.js +19 -2
  166. package/lib/components/ChannelSelectMenuComponent.d.ts +3 -3
  167. package/lib/components/MentionableSelectMenuComponent.d.ts +2 -2
  168. package/lib/components/RoleSelectMenuComponent.d.ts +2 -2
  169. package/lib/components/StringSelectMenuComponent.d.ts +2 -2
  170. package/lib/components/TextInputComponent.d.ts +2 -2
  171. package/lib/components/UserSelectMenuComponent.d.ts +2 -2
  172. package/lib/components/componentcommand.js +2 -2
  173. package/lib/components/componentcontext.d.ts +10 -9
  174. package/lib/components/componentcontext.js +8 -8
  175. package/lib/components/handler.d.ts +15 -14
  176. package/lib/components/handler.js +89 -93
  177. package/lib/components/index.d.ts +3 -3
  178. package/lib/components/index.js +12 -10
  179. package/lib/components/modalcontext.d.ts +12 -11
  180. package/lib/components/modalcontext.js +2 -2
  181. package/lib/deps/mixer.d.ts +8 -0
  182. package/lib/deps/mixer.js +66 -0
  183. package/lib/events/handler.d.ts +35 -13
  184. package/lib/events/handler.js +58 -25
  185. package/lib/events/hooks/application_command.d.ts +2 -2
  186. package/lib/events/hooks/auto_moderation.d.ts +6 -7
  187. package/lib/events/hooks/auto_moderation.js +4 -4
  188. package/lib/events/hooks/channel.d.ts +2 -2
  189. package/lib/events/hooks/channel.js +4 -7
  190. package/lib/events/hooks/custom.d.ts +3 -3
  191. package/lib/events/hooks/dispatch.d.ts +3 -4
  192. package/lib/events/hooks/dispatch.js +2 -2
  193. package/lib/events/hooks/entitlement.d.ts +5 -37
  194. package/lib/events/hooks/entitlement.js +7 -7
  195. package/lib/events/hooks/guild.d.ts +125 -125
  196. package/lib/events/hooks/guild.js +13 -15
  197. package/lib/events/hooks/integration.d.ts +27 -28
  198. package/lib/events/hooks/integration.js +3 -3
  199. package/lib/events/hooks/interactions.d.ts +2 -2
  200. package/lib/events/hooks/invite.d.ts +18 -17
  201. package/lib/events/hooks/message.d.ts +69 -54
  202. package/lib/events/hooks/message.js +4 -8
  203. package/lib/events/hooks/presence.d.ts +17 -16
  204. package/lib/events/hooks/stage.d.ts +4 -4
  205. package/lib/events/hooks/thread.d.ts +132 -63
  206. package/lib/events/hooks/thread.js +4 -4
  207. package/lib/events/hooks/typing.d.ts +28 -6
  208. package/lib/events/hooks/typing.js +2 -2
  209. package/lib/events/hooks/user.d.ts +3 -3
  210. package/lib/events/hooks/user.js +2 -2
  211. package/lib/events/hooks/voice.d.ts +28 -3
  212. package/lib/events/hooks/voice.js +8 -4
  213. package/lib/events/hooks/webhook.d.ts +1 -1
  214. package/lib/index.d.ts +5 -14
  215. package/lib/index.js +7 -12
  216. package/lib/langs/handler.d.ts +14 -10
  217. package/lib/langs/handler.js +40 -9
  218. package/lib/structures/AutoModerationRule.d.ts +4 -4
  219. package/lib/structures/AutoModerationRule.js +1 -2
  220. package/lib/structures/ClientUser.d.ts +1 -1
  221. package/lib/structures/Entitlement.d.ts +10 -0
  222. package/lib/structures/Entitlement.js +16 -0
  223. package/lib/structures/Guild.d.ts +33 -34
  224. package/lib/structures/Guild.js +5 -2
  225. package/lib/structures/GuildBan.d.ts +6 -6
  226. package/lib/structures/GuildBan.js +2 -1
  227. package/lib/structures/GuildEmoji.d.ts +4 -4
  228. package/lib/structures/GuildEmoji.js +3 -2
  229. package/lib/structures/GuildMember.d.ts +20 -17
  230. package/lib/structures/GuildMember.js +18 -8
  231. package/lib/structures/GuildPreview.d.ts +1 -1
  232. package/lib/structures/GuildRole.d.ts +5 -3
  233. package/lib/structures/GuildRole.js +8 -1
  234. package/lib/structures/GuildTemplate.d.ts +2 -2
  235. package/lib/structures/GuildTemplate.js +1 -1
  236. package/lib/structures/Interaction.d.ts +53 -36
  237. package/lib/structures/Interaction.js +127 -91
  238. package/lib/structures/Message.d.ts +29 -30
  239. package/lib/structures/Message.js +8 -9
  240. package/lib/structures/Poll.d.ts +4 -3
  241. package/lib/structures/Poll.js +6 -2
  242. package/lib/structures/Sticker.d.ts +7 -7
  243. package/lib/structures/Sticker.js +7 -7
  244. package/lib/structures/User.d.ts +5 -4
  245. package/lib/structures/User.js +2 -1
  246. package/lib/structures/VoiceState.d.ts +15 -11
  247. package/lib/structures/VoiceState.js +35 -17
  248. package/lib/structures/Webhook.d.ts +6 -7
  249. package/lib/structures/Webhook.js +6 -7
  250. package/lib/structures/channels.d.ts +11 -10
  251. package/lib/structures/channels.js +70 -65
  252. package/lib/structures/extra/BaseGuild.d.ts +1 -1
  253. package/lib/structures/extra/BaseGuild.js +3 -3
  254. package/lib/structures/extra/BitField.d.ts +1 -1
  255. package/lib/structures/extra/BitField.js +3 -2
  256. package/lib/structures/extra/DiscordBase.js +2 -2
  257. package/lib/structures/extra/Permissions.d.ts +3 -1
  258. package/lib/structures/extra/Permissions.js +8 -3
  259. package/lib/types/gateway.d.ts +1537 -0
  260. package/lib/types/gateway.js +4 -0
  261. package/lib/types/index.d.ts +9 -1
  262. package/lib/types/index.js +28 -1
  263. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/attachment.d.ts +5 -0
  264. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/attachment.js +2 -0
  265. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/base.d.ts +22 -0
  266. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/base.js +2 -0
  267. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/boolean.d.ts +4 -0
  268. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/boolean.js +2 -0
  269. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/channel.d.ts +7 -0
  270. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/channel.js +2 -0
  271. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/integer.d.ts +17 -0
  272. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/integer.js +2 -0
  273. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/mentionable.d.ts +5 -0
  274. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/mentionable.js +2 -0
  275. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/number.d.ts +17 -0
  276. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/number.js +2 -0
  277. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/role.d.ts +5 -0
  278. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/role.js +2 -0
  279. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.d.ts +25 -0
  280. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.js +20 -0
  281. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/string.d.ts +17 -0
  282. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/string.js +2 -0
  283. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommand.d.ts +11 -0
  284. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommand.js +2 -0
  285. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommandGroup.d.ts +11 -0
  286. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommandGroup.js +2 -0
  287. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/user.d.ts +5 -0
  288. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/user.js +2 -0
  289. package/lib/types/payloads/_interactions/_applicationCommands/chatInput.d.ts +60 -0
  290. package/lib/types/payloads/_interactions/_applicationCommands/chatInput.js +29 -0
  291. package/lib/types/payloads/_interactions/_applicationCommands/contextMenu.d.ts +65 -0
  292. package/lib/types/payloads/_interactions/_applicationCommands/contextMenu.js +2 -0
  293. package/lib/types/payloads/_interactions/_applicationCommands/internals.d.ts +8 -0
  294. package/lib/types/payloads/_interactions/_applicationCommands/internals.js +2 -0
  295. package/lib/types/payloads/_interactions/_applicationCommands/permissions.d.ts +54 -0
  296. package/lib/types/payloads/_interactions/_applicationCommands/permissions.js +20 -0
  297. package/lib/types/payloads/_interactions/applicationCommands.d.ts +153 -0
  298. package/lib/types/payloads/_interactions/applicationCommands.js +61 -0
  299. package/lib/types/payloads/_interactions/autocomplete.d.ts +10 -0
  300. package/lib/types/payloads/_interactions/autocomplete.js +2 -0
  301. package/lib/types/payloads/_interactions/base.d.ts +197 -0
  302. package/lib/types/payloads/_interactions/base.js +2 -0
  303. package/lib/types/payloads/_interactions/messageComponents.d.ts +41 -0
  304. package/lib/types/payloads/_interactions/messageComponents.js +2 -0
  305. package/lib/types/payloads/_interactions/modalSubmit.d.ts +35 -0
  306. package/lib/types/payloads/_interactions/modalSubmit.js +2 -0
  307. package/lib/types/payloads/_interactions/ping.d.ts +3 -0
  308. package/lib/types/payloads/_interactions/ping.js +2 -0
  309. package/lib/types/payloads/_interactions/responses.d.ts +112 -0
  310. package/lib/types/payloads/_interactions/responses.js +54 -0
  311. package/lib/types/payloads/application.d.ts +292 -0
  312. package/lib/types/payloads/application.js +117 -0
  313. package/lib/types/payloads/auditLog.d.ts +644 -0
  314. package/lib/types/payloads/auditLog.js +80 -0
  315. package/lib/types/payloads/autoModeration.d.ts +219 -0
  316. package/lib/types/payloads/autoModeration.js +87 -0
  317. package/lib/types/payloads/channel.d.ts +1708 -0
  318. package/lib/types/payloads/channel.js +372 -0
  319. package/lib/types/payloads/emoji.d.ts +48 -0
  320. package/lib/types/payloads/emoji.js +5 -0
  321. package/lib/types/payloads/gateway.d.ts +373 -0
  322. package/lib/types/payloads/gateway.js +82 -0
  323. package/lib/types/payloads/guild.d.ts +1060 -0
  324. package/lib/types/payloads/guild.js +324 -0
  325. package/lib/types/payloads/guildScheduledEvent.d.ts +138 -0
  326. package/lib/types/payloads/guildScheduledEvent.js +32 -0
  327. package/lib/types/payloads/index.d.ts +64 -0
  328. package/lib/types/payloads/index.js +37 -0
  329. package/lib/types/payloads/interactions.d.ts +24 -0
  330. package/lib/types/payloads/interactions.js +23 -0
  331. package/lib/types/payloads/invite.d.ts +121 -0
  332. package/lib/types/payloads/invite.js +23 -0
  333. package/lib/types/payloads/monetization.d.ts +150 -0
  334. package/lib/types/payloads/monetization.js +79 -0
  335. package/lib/types/payloads/oauth2.d.ts +131 -0
  336. package/lib/types/payloads/oauth2.js +135 -0
  337. package/lib/types/payloads/permissions.d.ts +97 -0
  338. package/lib/types/payloads/permissions.js +16 -0
  339. package/lib/types/payloads/poll.d.ts +104 -0
  340. package/lib/types/payloads/poll.js +16 -0
  341. package/lib/types/payloads/stageInstance.d.ts +77 -0
  342. package/lib/types/payloads/stageInstance.js +19 -0
  343. package/lib/types/payloads/sticker.d.ts +123 -0
  344. package/lib/types/payloads/sticker.js +30 -0
  345. package/lib/types/payloads/teams.d.ts +78 -0
  346. package/lib/types/payloads/teams.js +23 -0
  347. package/lib/types/payloads/template.d.ts +62 -0
  348. package/lib/types/payloads/template.js +5 -0
  349. package/lib/types/payloads/user.d.ts +337 -0
  350. package/lib/types/payloads/user.js +167 -0
  351. package/lib/types/payloads/voice.d.ts +89 -0
  352. package/lib/types/payloads/voice.js +5 -0
  353. package/lib/types/payloads/webhook.d.ts +76 -0
  354. package/lib/types/payloads/webhook.js +21 -0
  355. package/lib/types/rest/application.d.ts +57 -0
  356. package/lib/types/rest/application.js +2 -0
  357. package/lib/types/rest/auditLog.d.ts +30 -0
  358. package/lib/types/rest/auditLog.js +2 -0
  359. package/lib/types/rest/autoModeration.d.ts +66 -0
  360. package/lib/types/rest/autoModeration.js +2 -0
  361. package/lib/types/rest/channel.d.ts +712 -0
  362. package/lib/types/rest/channel.js +11 -0
  363. package/lib/types/rest/emoji.d.ts +54 -0
  364. package/lib/types/rest/emoji.js +2 -0
  365. package/lib/types/rest/gateway.d.ts +9 -0
  366. package/lib/types/rest/gateway.js +2 -0
  367. package/lib/types/rest/guild.d.ts +865 -0
  368. package/lib/types/rest/guild.js +2 -0
  369. package/lib/types/rest/guildScheduledEvent.d.ts +126 -0
  370. package/lib/types/rest/guildScheduledEvent.js +2 -0
  371. package/lib/types/rest/index.d.ts +296 -0
  372. package/lib/types/rest/index.js +292 -0
  373. package/lib/types/rest/interactions.d.ts +194 -0
  374. package/lib/types/rest/interactions.js +2 -0
  375. package/lib/types/rest/invite.d.ts +24 -0
  376. package/lib/types/rest/invite.js +2 -0
  377. package/lib/types/rest/monetization.d.ts +82 -0
  378. package/lib/types/rest/monetization.js +11 -0
  379. package/lib/types/rest/oauth2.d.ts +172 -0
  380. package/lib/types/rest/oauth2.js +2 -0
  381. package/lib/types/rest/poll.d.ts +44 -0
  382. package/lib/types/rest/poll.js +2 -0
  383. package/lib/types/rest/stageInstance.d.ts +58 -0
  384. package/lib/types/rest/stageInstance.js +2 -0
  385. package/lib/types/rest/sticker.d.ts +77 -0
  386. package/lib/types/rest/sticker.js +2 -0
  387. package/lib/types/rest/template.d.ts +62 -0
  388. package/lib/types/rest/template.js +2 -0
  389. package/lib/types/rest/user.d.ts +120 -0
  390. package/lib/types/rest/user.js +2 -0
  391. package/lib/types/rest/voice.d.ts +17 -0
  392. package/lib/types/rest/voice.js +2 -0
  393. package/lib/types/rest/webhook.d.ts +250 -0
  394. package/lib/types/rest/webhook.js +2 -0
  395. package/lib/types/utils/index.d.ts +797 -0
  396. package/lib/types/utils/index.js +799 -0
  397. package/lib/websocket/SharedTypes.d.ts +4 -3
  398. package/lib/websocket/SharedTypes.js +1 -1
  399. package/lib/websocket/constants/index.d.ts +0 -1
  400. package/lib/websocket/discord/basesocket.d.ts +7 -7
  401. package/lib/websocket/discord/basesocket.js +34 -22
  402. package/lib/websocket/discord/events/memberUpdate.d.ts +1 -6
  403. package/lib/websocket/discord/events/memberUpdate.js +2 -1
  404. package/lib/websocket/discord/events/presenceUpdate.d.ts +5 -18
  405. package/lib/websocket/discord/events/presenceUpdate.js +5 -6
  406. package/lib/websocket/discord/shard.d.ts +8 -8
  407. package/lib/websocket/discord/shard.js +59 -47
  408. package/lib/websocket/discord/sharder.d.ts +6 -5
  409. package/lib/websocket/discord/sharder.js +11 -10
  410. package/lib/websocket/discord/shared.d.ts +13 -5
  411. package/lib/websocket/discord/socket/custom.d.ts +52 -0
  412. package/lib/websocket/discord/socket/custom.js +283 -0
  413. package/lib/websocket/discord/worker.d.ts +5 -10
  414. package/lib/websocket/discord/workermanager.d.ts +8 -15
  415. package/lib/websocket/discord/workermanager.js +35 -39
  416. package/lib/websocket/structures/index.d.ts +0 -1
  417. package/lib/websocket/structures/index.js +1 -1
  418. package/lib/websocket/structures/timeout.d.ts +0 -1
  419. package/package.json +65 -74
  420. package/lib/cache/adapters/redis.d.ts +0 -37
  421. package/lib/cache/adapters/redis.js +0 -218
  422. package/lib/client/oninteractioncreate.d.ts +0 -4
  423. package/lib/client/oninteractioncreate.js +0 -198
  424. package/lib/client/onmessagecreate.d.ts +0 -13
  425. package/lib/client/onmessagecreate.js +0 -410
  426. package/lib/structures/extra/functions.d.ts +0 -12
  427. package/lib/structures/extra/functions.js +0 -70
@@ -0,0 +1,1708 @@
1
+ /**
2
+ * Types extracted from https://discord.com/developers/docs/resources/channel
3
+ */
4
+ import type { Permissions, Snowflake, ChannelType, OverwriteType, VideoQualityMode } from '../index';
5
+ import type { APIApplication } from './application';
6
+ import type { APIPartialEmoji } from './emoji';
7
+ import type { APIGuildMember } from './guild';
8
+ import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions';
9
+ import type { APIRole } from './permissions';
10
+ import type { APIPoll } from './poll';
11
+ import type { APISticker, APIStickerItem } from './sticker';
12
+ import type { APIUser } from './user';
13
+ /**
14
+ * Not documented, but partial only includes id, name, and type
15
+ */
16
+ export interface APIPartialChannel {
17
+ /**
18
+ * The id of the channel
19
+ */
20
+ id: Snowflake;
21
+ /**
22
+ * The type of the channel
23
+ *
24
+ * See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
25
+ */
26
+ type: ChannelType;
27
+ /**
28
+ * The name of the channel (1-100 characters)
29
+ */
30
+ name?: string | null;
31
+ }
32
+ /**
33
+ * This interface is used to allow easy extension for other channel types. While
34
+ * also allowing `APIPartialChannel` to be used without breaking.
35
+ */
36
+ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
37
+ type: T;
38
+ flags?: ChannelFlags;
39
+ }
40
+ export type TextChannelType = ChannelType.AnnouncementThread | ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildAnnouncement | ChannelType.GuildStageVoice | ChannelType.GuildText | ChannelType.GuildVoice | ChannelType.PrivateThread | ChannelType.PublicThread;
41
+ export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
42
+ export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
43
+ /**
44
+ * The id of the last message sent in this channel (may not point to an existing or valid message)
45
+ */
46
+ last_message_id?: Snowflake | null;
47
+ /**
48
+ * When the last pinned message was pinned.
49
+ * This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
50
+ */
51
+ last_pin_timestamp?: string | null;
52
+ /**
53
+ * Amount of seconds a user has to wait before sending another message (0-21600);
54
+ * bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
55
+ *
56
+ * `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
57
+ *
58
+ * For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
59
+ * The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
60
+ */
61
+ rate_limit_per_user?: number;
62
+ }
63
+ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
64
+ /**
65
+ * The name of the channel (1-100 characters)
66
+ */
67
+ name: string;
68
+ /**
69
+ * The id of the guild (may be missing for some channel objects received over gateway guild dispatches)
70
+ */
71
+ guild_id?: Snowflake;
72
+ /**
73
+ * Explicit permission overwrites for members and roles
74
+ *
75
+ * See https://discord.com/developers/docs/resources/channel#overwrite-object
76
+ */
77
+ permission_overwrites?: APIOverwrite[];
78
+ /**
79
+ * Sorting position of the channel
80
+ */
81
+ position: number;
82
+ /**
83
+ * ID of the parent category for a channel (each parent category can contain up to 50 channels)
84
+ *
85
+ * OR
86
+ *
87
+ * ID of the parent channel for a thread
88
+ */
89
+ parent_id?: Snowflake | null;
90
+ /**
91
+ * Whether the channel is nsfw
92
+ */
93
+ nsfw?: boolean;
94
+ }
95
+ export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
96
+ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType> extends Omit<APITextBasedChannel<T>, 'name'>, APIGuildChannel<T> {
97
+ /**
98
+ * Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
99
+ */
100
+ default_auto_archive_duration?: ThreadAutoArchiveDuration;
101
+ /**
102
+ * The initial `rate_limit_per_user` to set on newly created threads.
103
+ * This field is copied to the thread at creation time and does not live update
104
+ */
105
+ default_thread_rate_limit_per_user?: number;
106
+ /**
107
+ * The channel topic (0-1024 characters)
108
+ */
109
+ topic?: string | null;
110
+ }
111
+ export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
112
+ export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
113
+ export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
114
+ export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T>, Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
115
+ /**
116
+ * The bitrate (in bits) of the voice or stage channel
117
+ */
118
+ bitrate?: number;
119
+ /**
120
+ * The user limit of the voice or stage channel
121
+ */
122
+ user_limit?: number;
123
+ /**
124
+ * Voice region id for the voice or stage channel, automatic when set to `null`
125
+ *
126
+ * See https://discord.com/developers/docs/resources/voice#voice-region-object
127
+ */
128
+ rtc_region?: string | null;
129
+ /**
130
+ * The camera video quality mode of the voice or stage channel, `1` when not present
131
+ *
132
+ * See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
133
+ */
134
+ video_quality_mode?: VideoQualityMode;
135
+ }
136
+ export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
137
+ export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
138
+ export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
139
+ /**
140
+ * The recipients of the DM
141
+ *
142
+ * See https://discord.com/developers/docs/resources/user#user-object
143
+ */
144
+ recipients?: APIUser[];
145
+ }
146
+ export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
147
+ /**
148
+ * The name of the channel (always null for DM channels)
149
+ */
150
+ name: null;
151
+ }
152
+ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
153
+ /**
154
+ * The name of the channel (1-100 characters)
155
+ */
156
+ name: string | null;
157
+ /**
158
+ * Application id of the group DM creator if it is bot-created
159
+ */
160
+ application_id?: Snowflake;
161
+ /**
162
+ * Icon hash
163
+ */
164
+ icon?: string | null;
165
+ /**
166
+ * ID of the DM creator
167
+ */
168
+ owner_id?: Snowflake;
169
+ /**
170
+ * The id of the last message sent in this channel (may not point to an existing or valid message)
171
+ */
172
+ last_message_id?: Snowflake | null;
173
+ /**
174
+ * Whether the channel is managed by an OAuth2 application
175
+ */
176
+ managed?: boolean;
177
+ }
178
+ export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
179
+ export interface APIThreadChannel extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>, APIGuildChannel<ThreadChannelType> {
180
+ /**
181
+ * The client users member for the thread, only included in select endpoints
182
+ */
183
+ member?: APIThreadMember;
184
+ /**
185
+ * The metadata for a thread channel not shared by other channels
186
+ */
187
+ thread_metadata?: APIThreadMetadata;
188
+ /**
189
+ * Number of messages (not including the initial message or deleted messages) in a thread
190
+ *
191
+ * If the thread was created before July 1, 2022, it stops counting at 50 messages
192
+ */
193
+ message_count?: number;
194
+ /**
195
+ * The approximate member count of the thread, does not count above 50 even if there are more members
196
+ */
197
+ member_count?: number;
198
+ /**
199
+ * ID of the thread creator
200
+ */
201
+ owner_id?: Snowflake;
202
+ /**
203
+ * Number of messages ever sent in a thread
204
+ *
205
+ * Similar to `message_count` on message creation, but won't decrement when a message is deleted
206
+ */
207
+ total_message_sent?: number;
208
+ /**
209
+ * The IDs of the set of tags that have been applied to a thread in a thread-only channel
210
+ */
211
+ applied_tags: Snowflake[];
212
+ }
213
+ /**
214
+ * https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure
215
+ */
216
+ export interface APIGuildForumTag {
217
+ /**
218
+ * The id of the tag
219
+ */
220
+ id: Snowflake;
221
+ /**
222
+ * The name of the tag (0-20 characters)
223
+ */
224
+ name: string;
225
+ /**
226
+ * Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission
227
+ */
228
+ moderated: boolean;
229
+ /**
230
+ * The id of a guild's custom emoji
231
+ */
232
+ emoji_id: Snowflake | null;
233
+ /**
234
+ * The unicode character of the emoji
235
+ */
236
+ emoji_name: string | null;
237
+ }
238
+ /**
239
+ * https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure
240
+ */
241
+ export interface APIGuildForumDefaultReactionEmoji {
242
+ /**
243
+ * The id of a guild's custom emoji
244
+ */
245
+ emoji_id: Snowflake | null;
246
+ /**
247
+ * The unicode character of the emoji
248
+ */
249
+ emoji_name: string | null;
250
+ }
251
+ /**
252
+ * https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types
253
+ */
254
+ export declare enum SortOrderType {
255
+ /**
256
+ * Sort forum posts by activity
257
+ */
258
+ LatestActivity = 0,
259
+ /**
260
+ * Sort forum posts by creation time (from most recent to oldest)
261
+ */
262
+ CreationDate = 1
263
+ }
264
+ /**
265
+ * https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
266
+ */
267
+ export declare enum ForumLayoutType {
268
+ /**
269
+ * No default has been set for forum channel
270
+ */
271
+ NotSet = 0,
272
+ /**
273
+ * Display posts as a list
274
+ */
275
+ ListView = 1,
276
+ /**
277
+ * Display posts as a collection of tiles
278
+ */
279
+ GalleryView = 2
280
+ }
281
+ export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia> extends APIGuildChannel<T> {
282
+ /**
283
+ * The channel topic (0-4096 characters)
284
+ */
285
+ topic?: string | null;
286
+ /**
287
+ * The id of the last thread created in this channel (may not point to an existing or valid thread)
288
+ */
289
+ last_message_id?: Snowflake | null;
290
+ /**
291
+ * Amount of seconds a user has to wait before creating another thread (0-21600);
292
+ * bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
293
+ *
294
+ * The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
295
+ */
296
+ rate_limit_per_user?: number;
297
+ /**
298
+ * When the last pinned message was pinned.
299
+ * This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
300
+ */
301
+ last_pin_timestamp?: string | null;
302
+ /**
303
+ * Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
304
+ */
305
+ default_auto_archive_duration?: ThreadAutoArchiveDuration;
306
+ /**
307
+ * The set of tags that can be used in a thread-only channel
308
+ */
309
+ available_tags: APIGuildForumTag[];
310
+ /**
311
+ * The initial `rate_limit_per_user` to set on newly created threads.
312
+ * This field is copied to the thread at creation time and does not live update
313
+ */
314
+ default_thread_rate_limit_per_user?: number;
315
+ /**
316
+ * The emoji to show in the add reaction button on a thread in a thread-only channel
317
+ */
318
+ default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
319
+ /**
320
+ * The default sort order type used to order posts in a thread-only channel
321
+ */
322
+ default_sort_order: SortOrderType | null;
323
+ }
324
+ export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {
325
+ /**
326
+ * The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
327
+ */
328
+ default_forum_layout: ForumLayoutType;
329
+ }
330
+ export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
331
+ /**
332
+ * https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
333
+ */
334
+ export type APIChannel = APIDMChannel | APIGroupDMChannel | APIGuildCategoryChannel | APIGuildForumChannel | APIGuildMediaChannel | APIGuildStageVoiceChannel | APIGuildVoiceChannel | APINewsChannel | APITextChannel | APIThreadChannel;
335
+ /**
336
+ * https://discord.com/developers/docs/resources/channel#message-object-message-structure
337
+ */
338
+ export interface APIMessage {
339
+ /**
340
+ * ID of the message
341
+ */
342
+ id: Snowflake;
343
+ /**
344
+ * ID of the channel the message was sent in
345
+ */
346
+ channel_id: Snowflake;
347
+ /**
348
+ * The author of this message (only a valid user in the case where the message is generated by a user or bot user)
349
+ *
350
+ * If the message is generated by a webhook, the author object corresponds to the webhook's id,
351
+ * username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` property
352
+ *
353
+ * See https://discord.com/developers/docs/resources/user#user-object
354
+ */
355
+ author: APIUser;
356
+ /**
357
+ * Contents of the message
358
+ *
359
+ * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
360
+ *
361
+ * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
362
+ * You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
363
+ *
364
+ * See https://support-dev.discord.com/hc/articles/4404772028055
365
+ */
366
+ content: string;
367
+ /**
368
+ * When this message was sent
369
+ */
370
+ timestamp: string;
371
+ /**
372
+ * When this message was edited (or null if never)
373
+ */
374
+ edited_timestamp: string | null;
375
+ /**
376
+ * Whether this was a TTS message
377
+ */
378
+ tts: boolean;
379
+ /**
380
+ * Whether this message mentions everyone
381
+ */
382
+ mention_everyone: boolean;
383
+ /**
384
+ * Users specifically mentioned in the message
385
+ *
386
+ * The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
387
+ * from text-based guild channels
388
+ *
389
+ * See https://discord.com/developers/docs/resources/user#user-object
390
+ * See https://discord.com/developers/docs/resources/guild#guild-member-object
391
+ */
392
+ mentions: APIUser[];
393
+ /**
394
+ * Roles specifically mentioned in this message
395
+ *
396
+ * See https://discord.com/developers/docs/topics/permissions#role-object
397
+ */
398
+ mention_roles: APIRole['id'][];
399
+ /**
400
+ * Channels specifically mentioned in this message
401
+ *
402
+ * Not all channel mentions in a message will appear in `mention_channels`.
403
+ * - Only textual channels that are visible to everyone in a lurkable guild will ever be included
404
+ * - Only crossposted messages (via Channel Following) currently include `mention_channels` at all
405
+ *
406
+ * If no mentions in the message meet these requirements, this field will not be sent
407
+ *
408
+ * See https://discord.com/developers/docs/resources/channel#channel-mention-object
409
+ */
410
+ mention_channels?: APIChannelMention[];
411
+ /**
412
+ * Any attached files
413
+ *
414
+ * See https://discord.com/developers/docs/resources/channel#attachment-object
415
+ *
416
+ * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
417
+ *
418
+ * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
419
+ * You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
420
+ *
421
+ * See https://support-dev.discord.com/hc/articles/4404772028055
422
+ */
423
+ attachments: APIAttachment[];
424
+ /**
425
+ * Any embedded content
426
+ *
427
+ * See https://discord.com/developers/docs/resources/channel#embed-object
428
+ *
429
+ * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
430
+ *
431
+ * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
432
+ * You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
433
+ *
434
+ * See https://support-dev.discord.com/hc/articles/4404772028055
435
+ */
436
+ embeds: APIEmbed[];
437
+ /**
438
+ * Reactions to the message
439
+ *
440
+ * See https://discord.com/developers/docs/resources/channel#reaction-object
441
+ */
442
+ reactions?: APIReaction[];
443
+ /**
444
+ * A nonce that can be used for optimistic message sending (up to 25 characters)
445
+ *
446
+ * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
447
+ * event to ensure it got sent**
448
+ */
449
+ nonce?: number | string;
450
+ /**
451
+ * Whether this message is pinned
452
+ */
453
+ pinned: boolean;
454
+ /**
455
+ * If the message is generated by a webhook, this is the webhook's id
456
+ */
457
+ webhook_id?: Snowflake;
458
+ /**
459
+ * Type of message
460
+ *
461
+ * See https://discord.com/developers/docs/resources/channel#message-object-message-types
462
+ */
463
+ type: MessageType;
464
+ /**
465
+ * Sent with Rich Presence-related chat embeds
466
+ *
467
+ * See https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
468
+ */
469
+ activity?: APIMessageActivity;
470
+ /**
471
+ * Sent with Rich Presence-related chat embeds
472
+ *
473
+ * See https://discord.com/developers/docs/resources/application#application-object
474
+ */
475
+ application?: Partial<APIApplication>;
476
+ /**
477
+ * If the message is a response to an Interaction, this is the id of the interaction's application
478
+ */
479
+ application_id?: Snowflake;
480
+ /**
481
+ * Reference data sent with crossposted messages, replies, pins, and thread starter messages
482
+ *
483
+ * See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
484
+ */
485
+ message_reference?: APIMessageReference;
486
+ /**
487
+ * Message flags combined as a bitfield
488
+ *
489
+ * See https://discord.com/developers/docs/resources/channel#message-object-message-flags
490
+ *
491
+ * See https://en.wikipedia.org/wiki/Bit_field
492
+ */
493
+ flags?: MessageFlags;
494
+ /**
495
+ * The message associated with the `message_reference`
496
+ *
497
+ * This field is only returned for messages with a `type` of `19` (REPLY).
498
+ *
499
+ * If the message is a reply but the `referenced_message` field is not present,
500
+ * the backend did not attempt to fetch the message that was being replied to,
501
+ * so its state is unknown.
502
+ *
503
+ * If the field exists but is `null`, the referenced message was deleted
504
+ *
505
+ * See https://discord.com/developers/docs/resources/channel#message-object
506
+ */
507
+ referenced_message?: APIMessage | null;
508
+ /**
509
+ * Sent if the message is sent as a result of an interaction
510
+ *
511
+ * @unstable
512
+ */
513
+ interaction_metadata?: APIMessageInteractionMetadata;
514
+ /**
515
+ * Sent if the message is a response to an Interaction
516
+ *
517
+ * @deprecated In favor of `interaction_metadata`
518
+ */
519
+ interaction?: APIMessageInteraction;
520
+ /**
521
+ * Sent if a thread was started from this message
522
+ */
523
+ thread?: APIChannel;
524
+ /**
525
+ * Sent if the message contains components like buttons, action rows, or other interactive components
526
+ *
527
+ * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
528
+ *
529
+ * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
530
+ * You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
531
+ *
532
+ * See https://support-dev.discord.com/hc/articles/4404772028055
533
+ */
534
+ components?: APIActionRowComponent<APIMessageActionRowComponent>[];
535
+ /**
536
+ * Sent if the message contains stickers
537
+ *
538
+ * See https://discord.com/developers/docs/resources/sticker#sticker-item-object
539
+ */
540
+ sticker_items?: APIStickerItem[];
541
+ /**
542
+ * The stickers sent with the message
543
+ *
544
+ * See https://discord.com/developers/docs/resources/sticker#sticker-object
545
+ *
546
+ * @deprecated Use `sticker_items` instead
547
+ */
548
+ stickers?: APISticker[];
549
+ /**
550
+ * A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
551
+ *
552
+ * It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
553
+ */
554
+ position?: number;
555
+ /**
556
+ * Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message
557
+ */
558
+ role_subscription_data?: APIMessageRoleSubscriptionData;
559
+ /**
560
+ * Data for users, members, channels, and roles in the message's auto-populated select menus
561
+ *
562
+ * See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
563
+ */
564
+ resolved?: APIInteractionDataResolved;
565
+ /**
566
+ * A poll!
567
+ *
568
+ * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
569
+ *
570
+ * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
571
+ * You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
572
+ *
573
+ * See https://support-dev.discord.com/hc/articles/4404772028055
574
+ */
575
+ poll?: APIPoll;
576
+ /**
577
+ * The message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.)
578
+ */
579
+ message_snapshots?: APIMessageSnapshot[];
580
+ /**
581
+ * The call associated with the message
582
+ */
583
+ call?: APIMessageCall;
584
+ }
585
+ /**
586
+ * https://discord.com/developers/docs/resources/channel#message-object-message-types
587
+ */
588
+ export declare enum MessageType {
589
+ Default = 0,
590
+ RecipientAdd = 1,
591
+ RecipientRemove = 2,
592
+ Call = 3,
593
+ ChannelNameChange = 4,
594
+ ChannelIconChange = 5,
595
+ ChannelPinnedMessage = 6,
596
+ UserJoin = 7,
597
+ GuildBoost = 8,
598
+ GuildBoostTier1 = 9,
599
+ GuildBoostTier2 = 10,
600
+ GuildBoostTier3 = 11,
601
+ ChannelFollowAdd = 12,
602
+ GuildDiscoveryDisqualified = 14,
603
+ GuildDiscoveryRequalified = 15,
604
+ GuildDiscoveryGracePeriodInitialWarning = 16,
605
+ GuildDiscoveryGracePeriodFinalWarning = 17,
606
+ ThreadCreated = 18,
607
+ Reply = 19,
608
+ ChatInputCommand = 20,
609
+ ThreadStarterMessage = 21,
610
+ GuildInviteReminder = 22,
611
+ ContextMenuCommand = 23,
612
+ AutoModerationAction = 24,
613
+ RoleSubscriptionPurchase = 25,
614
+ InteractionPremiumUpsell = 26,
615
+ StageStart = 27,
616
+ StageEnd = 28,
617
+ StageSpeaker = 29,
618
+ /**
619
+ * @unstable https://github.com/discord/discord-api-docs/pull/5927#discussion_r1107678548
620
+ */
621
+ StageRaiseHand = 30,
622
+ StageTopic = 31,
623
+ GuildApplicationPremiumSubscription = 32,
624
+ GuildIncidentAlertModeEnabled = 36,
625
+ GuildIncidentAlertModeDisabled = 37,
626
+ GuildIncidentReportRaid = 38,
627
+ GuildIncidentReportFalseAlarm = 39,
628
+ PurchaseNotification = 44,
629
+ PollResult = 46
630
+ }
631
+ /**
632
+ * https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
633
+ */
634
+ export interface APIMessageActivity {
635
+ /**
636
+ * Type of message activity
637
+ *
638
+ * See https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
639
+ */
640
+ type: MessageActivityType;
641
+ /**
642
+ * `party_id` from a Rich Presence event
643
+ *
644
+ * See https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields
645
+ */
646
+ party_id?: string;
647
+ }
648
+ /**
649
+ * https://discord.com/developers/docs/resources/channel#message-reference-types
650
+ */
651
+ export declare enum MessageReferenceType {
652
+ /**
653
+ * A standard reference used by replies
654
+ */
655
+ Default = 0,
656
+ /**
657
+ * Reference used to point to a message at a point in time
658
+ */
659
+ Forward = 1
660
+ }
661
+ /**
662
+ * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
663
+ */
664
+ export interface APIMessageReference {
665
+ /**
666
+ * ID of the originating message
667
+ */
668
+ message_id?: Snowflake;
669
+ /**
670
+ * ID of the originating message's channel
671
+ */
672
+ channel_id: Snowflake;
673
+ /**
674
+ * ID of the originating message's guild
675
+ */
676
+ guild_id?: Snowflake;
677
+ /**
678
+ * Type of reference
679
+ */
680
+ type?: MessageReferenceType;
681
+ }
682
+ /**
683
+ * https://discord.com/developers/docs/resources/channel#message-snapshot-object
684
+ */
685
+ export interface APIMessageSnapshot {
686
+ /**
687
+ * Subset of the message object fields
688
+ */
689
+ message: APIMessageSnapshotFields;
690
+ /**
691
+ * Id of the origin message's guild
692
+ */
693
+ guild_id?: Snowflake;
694
+ }
695
+ export type APIMessageSnapshotFields = Pick<APIMessage, 'attachments' | 'content' | 'edited_timestamp' | 'embeds' | 'flags' | 'mention_roles' | 'mentions' | 'timestamp' | 'type'>;
696
+ /**
697
+ * https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
698
+ */
699
+ export declare enum MessageActivityType {
700
+ Join = 1,
701
+ Spectate = 2,
702
+ Listen = 3,
703
+ JoinRequest = 5
704
+ }
705
+ /**
706
+ * https://discord.com/developers/docs/resources/channel#message-object-message-flags
707
+ */
708
+ export declare enum MessageFlags {
709
+ /**
710
+ * This message has been published to subscribed channels (via Channel Following)
711
+ */
712
+ Crossposted = 1,
713
+ /**
714
+ * This message originated from a message in another channel (via Channel Following)
715
+ */
716
+ IsCrosspost = 2,
717
+ /**
718
+ * Do not include any embeds when serializing this message
719
+ */
720
+ SuppressEmbeds = 4,
721
+ /**
722
+ * The source message for this crosspost has been deleted (via Channel Following)
723
+ */
724
+ SourceMessageDeleted = 8,
725
+ /**
726
+ * This message came from the urgent message system
727
+ */
728
+ Urgent = 16,
729
+ /**
730
+ * This message has an associated thread, which shares its id
731
+ */
732
+ HasThread = 32,
733
+ /**
734
+ * This message is only visible to the user who invoked the Interaction
735
+ */
736
+ Ephemeral = 64,
737
+ /**
738
+ * This message is an Interaction Response and the bot is "thinking"
739
+ */
740
+ Loading = 128,
741
+ /**
742
+ * This message failed to mention some roles and add their members to the thread
743
+ */
744
+ FailedToMentionSomeRolesInThread = 256,
745
+ /**
746
+ * @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
747
+ */
748
+ ShouldShowLinkNotDiscordWarning = 1024,
749
+ /**
750
+ * This message will not trigger push and desktop notifications
751
+ */
752
+ SuppressNotifications = 4096,
753
+ /**
754
+ * This message is a voice message
755
+ */
756
+ IsVoiceMessage = 8192
757
+ }
758
+ /**
759
+ * https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
760
+ */
761
+ export interface APIMessageCall {
762
+ /**
763
+ * Array of user ids that participated in the call
764
+ */
765
+ participants: Snowflake[];
766
+ /**
767
+ * ISO8601 timestamp when the call ended
768
+ */
769
+ ended_timestamp?: string | null;
770
+ }
771
+ /**
772
+ * https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
773
+ */
774
+ export interface APIMessageRoleSubscriptionData {
775
+ /**
776
+ * The id of the SKU and listing the user is subscribed to
777
+ */
778
+ role_subscription_listing_id: Snowflake;
779
+ /**
780
+ * The name of the tier the user is subscribed to
781
+ */
782
+ tier_name: string;
783
+ /**
784
+ * The number of months the user has been subscribed for
785
+ */
786
+ total_months_subscribed: number;
787
+ /**
788
+ * Whether this notification is for a renewal
789
+ */
790
+ is_renewal: boolean;
791
+ }
792
+ /**
793
+ * https://discord.com/developers/docs/resources/channel#followed-channel-object
794
+ */
795
+ export interface APIFollowedChannel {
796
+ /**
797
+ * Source channel id
798
+ */
799
+ channel_id: Snowflake;
800
+ /**
801
+ * Created target webhook id
802
+ */
803
+ webhook_id: Snowflake;
804
+ }
805
+ /**
806
+ * https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
807
+ */
808
+ export interface APIReaction {
809
+ /**
810
+ * Total number of times this emoji has been used to react (including super reacts)
811
+ */
812
+ count: number;
813
+ /**
814
+ * An object detailing the individual reaction counts for different types of reactions
815
+ */
816
+ count_details: APIReactionCountDetails;
817
+ /**
818
+ * Whether the current user reacted using this emoji
819
+ */
820
+ me: boolean;
821
+ /**
822
+ * Whether the current user super-reacted using this emoji
823
+ */
824
+ me_burst: boolean;
825
+ /**
826
+ * Emoji information
827
+ *
828
+ * See https://discord.com/developers/docs/resources/emoji#emoji-object
829
+ */
830
+ emoji: APIPartialEmoji;
831
+ /**
832
+ * Hexadecimal colors used for this super reaction
833
+ */
834
+ burst_colors: string[];
835
+ }
836
+ /**
837
+ * https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure
838
+ */
839
+ export interface APIReactionCountDetails {
840
+ /**
841
+ * Count of super reactions
842
+ */
843
+ burst: number;
844
+ /**
845
+ * Count of normal reactions
846
+ */
847
+ normal: number;
848
+ }
849
+ /**
850
+ * https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
851
+ */
852
+ export interface APIOverwrite {
853
+ /**
854
+ * Role or user id
855
+ */
856
+ id: Snowflake;
857
+ /**
858
+ * Either 0 (role) or 1 (member)
859
+ *
860
+ * {@link OverwriteType}
861
+ */
862
+ type: OverwriteType;
863
+ /**
864
+ * Permission bit set
865
+ *
866
+ * See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
867
+ *
868
+ * See https://en.wikipedia.org/wiki/Bit_field
869
+ */
870
+ allow: Permissions;
871
+ /**
872
+ * Permission bit set
873
+ *
874
+ * See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
875
+ *
876
+ * See https://en.wikipedia.org/wiki/Bit_field
877
+ */
878
+ deny: Permissions;
879
+ }
880
+ /**
881
+ * https://discord.com/developers/docs/resources/channel#thread-metadata-object-thread-metadata-structure
882
+ */
883
+ export interface APIThreadMetadata {
884
+ /**
885
+ * Whether the thread is archived
886
+ */
887
+ archived: boolean;
888
+ /**
889
+ * Duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080
890
+ */
891
+ auto_archive_duration: ThreadAutoArchiveDuration;
892
+ /**
893
+ * An ISO8601 timestamp when the thread's archive status was last changed, used for calculating recent activity
894
+ */
895
+ archive_timestamp: string;
896
+ /**
897
+ * Whether the thread is locked; when a thread is locked, only users with `MANAGE_THREADS` can unarchive it
898
+ */
899
+ locked?: boolean;
900
+ /**
901
+ * Whether non-moderators can add other non-moderators to the thread; only available on private threads
902
+ */
903
+ invitable?: boolean;
904
+ /**
905
+ * Timestamp when the thread was created; only populated for threads created after 2022-01-09
906
+ */
907
+ create_timestamp?: string;
908
+ }
909
+ export declare enum ThreadAutoArchiveDuration {
910
+ OneHour = 60,
911
+ OneDay = 1440,
912
+ ThreeDays = 4320,
913
+ OneWeek = 10080
914
+ }
915
+ /**
916
+ * https://discord.com/developers/docs/resources/channel#thread-member-object-thread-member-structure
917
+ */
918
+ export interface APIThreadMember {
919
+ /**
920
+ * The id of the thread
921
+ *
922
+ * **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
923
+ */
924
+ id?: Snowflake;
925
+ /**
926
+ * The id of the member
927
+ *
928
+ * **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
929
+ */
930
+ user_id?: Snowflake;
931
+ /**
932
+ * An ISO8601 timestamp for when the member last joined
933
+ */
934
+ join_timestamp: string;
935
+ /**
936
+ * Member flags combined as a bitfield
937
+ *
938
+ * See https://en.wikipedia.org/wiki/Bit_field
939
+ */
940
+ flags: ThreadMemberFlags;
941
+ /**
942
+ * Additional information about the user
943
+ *
944
+ * **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
945
+ *
946
+ * **This field is only present when `with_member` is set to true when calling `List Thread Members` or `Get Thread Member`**
947
+ */
948
+ member?: APIGuildMember;
949
+ }
950
+ export declare enum ThreadMemberFlags {
951
+ /**
952
+ * @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
953
+ */
954
+ HasInteracted = 1,
955
+ /**
956
+ * @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
957
+ */
958
+ AllMessages = 2,
959
+ /**
960
+ * @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
961
+ */
962
+ OnlyMentions = 4,
963
+ /**
964
+ * @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
965
+ */
966
+ NoMessages = 8
967
+ }
968
+ export interface APIThreadList {
969
+ /**
970
+ * The threads that were fetched
971
+ */
972
+ threads: APIChannel[];
973
+ /**
974
+ * The members for the client user in each of the fetched threads
975
+ */
976
+ members: APIThreadMember[];
977
+ }
978
+ /**
979
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
980
+ *
981
+ * Length limit: 6000 characters
982
+ */
983
+ export interface APIEmbed {
984
+ /**
985
+ * Title of embed
986
+ *
987
+ * Length limit: 256 characters
988
+ */
989
+ title?: string;
990
+ /**
991
+ * Type of embed (always "rich" for webhook embeds)
992
+ *
993
+ * @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
994
+ *
995
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-types
996
+ */
997
+ type?: EmbedType;
998
+ /**
999
+ * Description of embed
1000
+ *
1001
+ * Length limit: 4096 characters
1002
+ */
1003
+ description?: string;
1004
+ /**
1005
+ * URL of embed
1006
+ */
1007
+ url?: string;
1008
+ /**
1009
+ * Timestamp of embed content
1010
+ */
1011
+ timestamp?: string;
1012
+ /**
1013
+ * Color code of the embed
1014
+ */
1015
+ color?: number;
1016
+ /**
1017
+ * Footer information
1018
+ *
1019
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
1020
+ */
1021
+ footer?: APIEmbedFooter;
1022
+ /**
1023
+ * Image information
1024
+ *
1025
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
1026
+ */
1027
+ image?: APIEmbedImage;
1028
+ /**
1029
+ * Thumbnail information
1030
+ *
1031
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
1032
+ */
1033
+ thumbnail?: APIEmbedThumbnail;
1034
+ /**
1035
+ * Video information
1036
+ *
1037
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
1038
+ */
1039
+ video?: APIEmbedVideo;
1040
+ /**
1041
+ * Provider information
1042
+ *
1043
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
1044
+ */
1045
+ provider?: APIEmbedProvider;
1046
+ /**
1047
+ * Author information
1048
+ *
1049
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
1050
+ */
1051
+ author?: APIEmbedAuthor;
1052
+ /**
1053
+ * Fields information
1054
+ *
1055
+ * Length limit: 25 field objects
1056
+ *
1057
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
1058
+ */
1059
+ fields?: APIEmbedField[];
1060
+ }
1061
+ /**
1062
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-types
1063
+ *
1064
+ * @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
1065
+ */
1066
+ export declare enum EmbedType {
1067
+ /**
1068
+ * Generic embed rendered from embed attributes
1069
+ */
1070
+ Rich = "rich",
1071
+ /**
1072
+ * Image embed
1073
+ */
1074
+ Image = "image",
1075
+ /**
1076
+ * Video embed
1077
+ */
1078
+ Video = "video",
1079
+ /**
1080
+ * Animated gif image embed rendered as a video embed
1081
+ */
1082
+ GIFV = "gifv",
1083
+ /**
1084
+ * Article embed
1085
+ */
1086
+ Article = "article",
1087
+ /**
1088
+ * Link embed
1089
+ */
1090
+ Link = "link",
1091
+ /**
1092
+ * Auto moderation alert embed
1093
+ *
1094
+ * @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
1095
+ */
1096
+ AutoModerationMessage = "auto_moderation_message"
1097
+ }
1098
+ /**
1099
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
1100
+ */
1101
+ export interface APIEmbedThumbnail {
1102
+ /**
1103
+ * Source url of thumbnail (only supports http(s) and attachments)
1104
+ */
1105
+ url: string;
1106
+ /**
1107
+ * A proxied url of the thumbnail
1108
+ */
1109
+ proxy_url?: string;
1110
+ /**
1111
+ * Height of thumbnail
1112
+ */
1113
+ height?: number;
1114
+ /**
1115
+ * Width of thumbnail
1116
+ */
1117
+ width?: number;
1118
+ }
1119
+ /**
1120
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
1121
+ */
1122
+ export interface APIEmbedVideo {
1123
+ /**
1124
+ * Source url of video
1125
+ */
1126
+ url?: string;
1127
+ /**
1128
+ * A proxied url of the video
1129
+ */
1130
+ proxy_url?: string;
1131
+ /**
1132
+ * Height of video
1133
+ */
1134
+ height?: number;
1135
+ /**
1136
+ * Width of video
1137
+ */
1138
+ width?: number;
1139
+ }
1140
+ /**
1141
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
1142
+ */
1143
+ export interface APIEmbedImage {
1144
+ /**
1145
+ * Source url of image (only supports http(s) and attachments)
1146
+ */
1147
+ url: string;
1148
+ /**
1149
+ * A proxied url of the image
1150
+ */
1151
+ proxy_url?: string;
1152
+ /**
1153
+ * Height of image
1154
+ */
1155
+ height?: number;
1156
+ /**
1157
+ * Width of image
1158
+ */
1159
+ width?: number;
1160
+ }
1161
+ /**
1162
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
1163
+ */
1164
+ export interface APIEmbedProvider {
1165
+ /**
1166
+ * Name of provider
1167
+ */
1168
+ name?: string;
1169
+ /**
1170
+ * URL of provider
1171
+ */
1172
+ url?: string;
1173
+ }
1174
+ /**
1175
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
1176
+ */
1177
+ export interface APIEmbedAuthor {
1178
+ /**
1179
+ * Name of author
1180
+ *
1181
+ * Length limit: 256 characters
1182
+ */
1183
+ name: string;
1184
+ /**
1185
+ * URL of author
1186
+ */
1187
+ url?: string;
1188
+ /**
1189
+ * URL of author icon (only supports http(s) and attachments)
1190
+ */
1191
+ icon_url?: string;
1192
+ /**
1193
+ * A proxied url of author icon
1194
+ */
1195
+ proxy_icon_url?: string;
1196
+ }
1197
+ /**
1198
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
1199
+ */
1200
+ export interface APIEmbedFooter {
1201
+ /**
1202
+ * Footer text
1203
+ *
1204
+ * Length limit: 2048 characters
1205
+ */
1206
+ text: string;
1207
+ /**
1208
+ * URL of footer icon (only supports http(s) and attachments)
1209
+ */
1210
+ icon_url?: string;
1211
+ /**
1212
+ * A proxied url of footer icon
1213
+ */
1214
+ proxy_icon_url?: string;
1215
+ }
1216
+ /**
1217
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
1218
+ */
1219
+ export interface APIEmbedField {
1220
+ /**
1221
+ * Name of the field
1222
+ *
1223
+ * Length limit: 256 characters
1224
+ */
1225
+ name: string;
1226
+ /**
1227
+ * Value of the field
1228
+ *
1229
+ * Length limit: 1024 characters
1230
+ */
1231
+ value: string;
1232
+ /**
1233
+ * Whether or not this field should display inline
1234
+ */
1235
+ inline?: boolean;
1236
+ }
1237
+ /**
1238
+ * https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
1239
+ */
1240
+ export interface APIAttachment {
1241
+ /**
1242
+ * Attachment id
1243
+ */
1244
+ id: Snowflake;
1245
+ /**
1246
+ * Name of file attached
1247
+ */
1248
+ filename: string;
1249
+ /**
1250
+ * The title of the file
1251
+ */
1252
+ title?: string;
1253
+ /**
1254
+ * Description for the file
1255
+ */
1256
+ description?: string;
1257
+ /**
1258
+ * The attachment's media type
1259
+ *
1260
+ * See https://en.wikipedia.org/wiki/Media_type
1261
+ */
1262
+ content_type?: string;
1263
+ /**
1264
+ * Size of file in bytes
1265
+ */
1266
+ size: number;
1267
+ /**
1268
+ * Source url of file
1269
+ */
1270
+ url: string;
1271
+ /**
1272
+ * A proxied url of file
1273
+ */
1274
+ proxy_url: string;
1275
+ /**
1276
+ * Height of file (if image)
1277
+ */
1278
+ height?: number | null;
1279
+ /**
1280
+ * Width of file (if image)
1281
+ */
1282
+ width?: number | null;
1283
+ /**
1284
+ * Whether this attachment is ephemeral
1285
+ */
1286
+ ephemeral?: boolean;
1287
+ /**
1288
+ * The duration of the audio file (currently for voice messages)
1289
+ */
1290
+ duration_secs?: number;
1291
+ /**
1292
+ * Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
1293
+ */
1294
+ waveform?: string;
1295
+ /**
1296
+ * Attachment flags combined as a bitfield
1297
+ */
1298
+ flags?: AttachmentFlags;
1299
+ }
1300
+ /**
1301
+ * https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
1302
+ */
1303
+ export declare enum AttachmentFlags {
1304
+ /**
1305
+ * This attachment has been edited using the remix feature on mobile
1306
+ */
1307
+ IsRemix = 4
1308
+ }
1309
+ /**
1310
+ * https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
1311
+ */
1312
+ export interface APIChannelMention {
1313
+ /**
1314
+ * ID of the channel
1315
+ */
1316
+ id: Snowflake;
1317
+ /**
1318
+ * ID of the guild containing the channel
1319
+ */
1320
+ guild_id: Snowflake;
1321
+ /**
1322
+ * The type of channel
1323
+ *
1324
+ * See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
1325
+ */
1326
+ type: ChannelType;
1327
+ /**
1328
+ * The name of the channel
1329
+ */
1330
+ name: string;
1331
+ }
1332
+ /**
1333
+ * https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
1334
+ */
1335
+ export declare enum AllowedMentionsTypes {
1336
+ /**
1337
+ * Controls @everyone and @here mentions
1338
+ */
1339
+ Everyone = "everyone",
1340
+ /**
1341
+ * Controls role mentions
1342
+ */
1343
+ Role = "roles",
1344
+ /**
1345
+ * Controls user mentions
1346
+ */
1347
+ User = "users"
1348
+ }
1349
+ /**
1350
+ * https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
1351
+ */
1352
+ export interface APIAllowedMentions {
1353
+ /**
1354
+ * An array of allowed mention types to parse from the content
1355
+ *
1356
+ * See https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
1357
+ */
1358
+ parse?: AllowedMentionsTypes[];
1359
+ /**
1360
+ * Array of role_ids to mention (Max size of 100)
1361
+ */
1362
+ roles?: Snowflake[];
1363
+ /**
1364
+ * Array of user_ids to mention (Max size of 100)
1365
+ */
1366
+ users?: Snowflake[];
1367
+ /**
1368
+ * For replies, whether to mention the author of the message being replied to (default false)
1369
+ *
1370
+ * @default false
1371
+ */
1372
+ replied_user?: boolean;
1373
+ }
1374
+ /**
1375
+ * https://discord.com/developers/docs/interactions/message-components#component-object
1376
+ */
1377
+ export interface APIBaseComponent<T extends ComponentType> {
1378
+ /**
1379
+ * The type of the component
1380
+ */
1381
+ type: T;
1382
+ }
1383
+ /**
1384
+ * https://discord.com/developers/docs/interactions/message-components#component-object-component-types
1385
+ */
1386
+ export declare enum ComponentType {
1387
+ /**
1388
+ * Action Row component
1389
+ */
1390
+ ActionRow = 1,
1391
+ /**
1392
+ * Button component
1393
+ */
1394
+ Button = 2,
1395
+ /**
1396
+ * Select menu for picking from defined text options
1397
+ */
1398
+ StringSelect = 3,
1399
+ /**
1400
+ * Text Input component
1401
+ */
1402
+ TextInput = 4,
1403
+ /**
1404
+ * Select menu for users
1405
+ */
1406
+ UserSelect = 5,
1407
+ /**
1408
+ * Select menu for roles
1409
+ */
1410
+ RoleSelect = 6,
1411
+ /**
1412
+ * Select menu for users and roles
1413
+ */
1414
+ MentionableSelect = 7,
1415
+ /**
1416
+ * Select menu for channels
1417
+ */
1418
+ ChannelSelect = 8,
1419
+ /**
1420
+ * Select menu for picking from defined text options
1421
+ *
1422
+ * @deprecated This is the old name for {@apilink ComponentType#StringSelect}
1423
+ */
1424
+ SelectMenu = 3
1425
+ }
1426
+ /**
1427
+ * https://discord.com/developers/docs/interactions/message-components#action-rows
1428
+ */
1429
+ export interface APIActionRowComponent<T extends APIActionRowComponentTypes> extends APIBaseComponent<ComponentType.ActionRow> {
1430
+ /**
1431
+ * The components in the ActionRow
1432
+ */
1433
+ components: T[];
1434
+ }
1435
+ /**
1436
+ * https://discord.com/developers/docs/interactions/message-components#buttons
1437
+ */
1438
+ export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
1439
+ /**
1440
+ * The label to be displayed on the button
1441
+ */
1442
+ label?: string;
1443
+ /**
1444
+ * The style of the button
1445
+ */
1446
+ style: Style;
1447
+ /**
1448
+ * The emoji to display to the left of the text
1449
+ */
1450
+ emoji?: APIMessageComponentEmoji;
1451
+ /**
1452
+ * The status of the button
1453
+ */
1454
+ disabled?: boolean;
1455
+ }
1456
+ export interface APIMessageComponentEmoji {
1457
+ /**
1458
+ * Emoji id
1459
+ */
1460
+ id?: Snowflake;
1461
+ /**
1462
+ * Emoji name
1463
+ */
1464
+ name?: string;
1465
+ /**
1466
+ * Whether this emoji is animated
1467
+ */
1468
+ animated?: boolean;
1469
+ }
1470
+ export interface APIButtonComponentWithCustomId extends APIButtonComponentBase<ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success> {
1471
+ /**
1472
+ * The custom_id to be sent in the interaction when clicked
1473
+ */
1474
+ custom_id: string;
1475
+ }
1476
+ export interface APIButtonComponentWithURL extends APIButtonComponentBase<ButtonStyle.Link> {
1477
+ /**
1478
+ * The URL to direct users to when clicked for Link buttons
1479
+ */
1480
+ url: string;
1481
+ }
1482
+ export interface APIButtonComponentWithSKUId extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
1483
+ /**
1484
+ * The id for a purchasable SKU
1485
+ */
1486
+ sku_id: Snowflake;
1487
+ }
1488
+ export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithSKUId | APIButtonComponentWithURL;
1489
+ /**
1490
+ * https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
1491
+ */
1492
+ export declare enum ButtonStyle {
1493
+ Primary = 1,
1494
+ Secondary = 2,
1495
+ Success = 3,
1496
+ Danger = 4,
1497
+ Link = 5,
1498
+ Premium = 6
1499
+ }
1500
+ /**
1501
+ * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles
1502
+ */
1503
+ export declare enum TextInputStyle {
1504
+ Short = 1,
1505
+ Paragraph = 2
1506
+ }
1507
+ /**
1508
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1509
+ */
1510
+ export interface APIBaseSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect> extends APIBaseComponent<T> {
1511
+ /**
1512
+ * A developer-defined identifier for the select menu, max 100 characters
1513
+ */
1514
+ custom_id: string;
1515
+ /**
1516
+ * Custom placeholder text if nothing is selected, max 150 characters
1517
+ */
1518
+ placeholder?: string;
1519
+ /**
1520
+ * The minimum number of items that must be chosen; min 0, max 25
1521
+ *
1522
+ * @default 1
1523
+ */
1524
+ min_values?: number;
1525
+ /**
1526
+ * The maximum number of items that can be chosen; max 25
1527
+ *
1528
+ * @default 1
1529
+ */
1530
+ max_values?: number;
1531
+ /**
1532
+ * Disable the select
1533
+ *
1534
+ * @default false
1535
+ */
1536
+ disabled?: boolean;
1537
+ }
1538
+ export interface APIBaseAutoPopulatedSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.UserSelect, D extends SelectMenuDefaultValueType> extends APIBaseSelectMenuComponent<T> {
1539
+ /**
1540
+ * List of default values for auto-populated select menu components
1541
+ */
1542
+ default_values?: APISelectMenuDefaultValue<D>[];
1543
+ }
1544
+ /**
1545
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1546
+ */
1547
+ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
1548
+ /**
1549
+ * Specified choices in a select menu; max 25
1550
+ */
1551
+ options: APISelectMenuOption[];
1552
+ }
1553
+ /**
1554
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1555
+ */
1556
+ export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.UserSelect, SelectMenuDefaultValueType.User>;
1557
+ /**
1558
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1559
+ */
1560
+ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.RoleSelect, SelectMenuDefaultValueType.Role>;
1561
+ /**
1562
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1563
+ */
1564
+ export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.MentionableSelect, SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User>;
1565
+ /**
1566
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1567
+ */
1568
+ export interface APIChannelSelectComponent extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
1569
+ /**
1570
+ * List of channel types to include in the ChannelSelect component
1571
+ */
1572
+ channel_types?: ChannelType[];
1573
+ }
1574
+ /**
1575
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
1576
+ */
1577
+ export declare enum SelectMenuDefaultValueType {
1578
+ Channel = "channel",
1579
+ Role = "role",
1580
+ User = "user"
1581
+ }
1582
+ /**
1583
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
1584
+ */
1585
+ export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
1586
+ type: T;
1587
+ id: Snowflake;
1588
+ }
1589
+ export type APIAutoPopulatedSelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIUserSelectComponent;
1590
+ /**
1591
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1592
+ */
1593
+ export type APISelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIStringSelectComponent | APIUserSelectComponent;
1594
+ /**
1595
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
1596
+ */
1597
+ export interface APISelectMenuOption {
1598
+ /**
1599
+ * The user-facing name of the option (max 100 chars)
1600
+ */
1601
+ label: string;
1602
+ /**
1603
+ * The dev-defined value of the option (max 100 chars)
1604
+ */
1605
+ value: string;
1606
+ /**
1607
+ * An additional description of the option (max 100 chars)
1608
+ */
1609
+ description?: string;
1610
+ /**
1611
+ * The emoji to display to the left of the option
1612
+ */
1613
+ emoji?: APIMessageComponentEmoji;
1614
+ /**
1615
+ * Whether this option should be already-selected by default
1616
+ */
1617
+ default?: boolean;
1618
+ }
1619
+ /**
1620
+ * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure
1621
+ */
1622
+ export interface APITextInputComponent extends APIBaseComponent<ComponentType.TextInput> {
1623
+ /**
1624
+ * One of text input styles
1625
+ */
1626
+ style: TextInputStyle;
1627
+ /**
1628
+ * The custom id for the text input
1629
+ */
1630
+ custom_id: string;
1631
+ /**
1632
+ * Text that appears on top of the text input field, max 45 characters
1633
+ */
1634
+ label: string;
1635
+ /**
1636
+ * Placeholder for the text input
1637
+ */
1638
+ placeholder?: string;
1639
+ /**
1640
+ * The pre-filled text in the text input
1641
+ */
1642
+ value?: string;
1643
+ /**
1644
+ * Minimal length of text input
1645
+ */
1646
+ min_length?: number;
1647
+ /**
1648
+ * Maximal length of text input
1649
+ */
1650
+ max_length?: number;
1651
+ /**
1652
+ * Whether or not this text input is required or not
1653
+ */
1654
+ required?: boolean;
1655
+ }
1656
+ /**
1657
+ * https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
1658
+ */
1659
+ export declare enum ChannelFlags {
1660
+ /**
1661
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1662
+ */
1663
+ GuildFeedRemoved = 1,
1664
+ /**
1665
+ * This thread is pinned to the top of its parent forum channel
1666
+ */
1667
+ Pinned = 2,
1668
+ /**
1669
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1670
+ */
1671
+ ActiveChannelsRemoved = 4,
1672
+ /**
1673
+ * Whether a tag is required to be specified when creating a thread in a forum channel.
1674
+ * Tags are specified in the `applied_tags` field
1675
+ */
1676
+ RequireTag = 16,
1677
+ /**
1678
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1679
+ */
1680
+ IsSpam = 32,
1681
+ /**
1682
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1683
+ */
1684
+ IsGuildResourceChannel = 128,
1685
+ /**
1686
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1687
+ */
1688
+ ClydeAI = 256,
1689
+ /**
1690
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1691
+ */
1692
+ IsScheduledForDeletion = 512,
1693
+ /**
1694
+ * Whether media download options are hidden.
1695
+ */
1696
+ HideMediaDownloadOptions = 32768
1697
+ }
1698
+ /**
1699
+ * https://discord.com/developers/docs/interactions/message-components#message-components
1700
+ */
1701
+ export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
1702
+ export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
1703
+ export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;
1704
+ /**
1705
+ * https://discord.com/developers/docs/interactions/message-components#message-components
1706
+ */
1707
+ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent;
1708
+ export type APIModalActionRowComponent = APITextInputComponent;