seyfert 1.5.0 → 2.1.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 (439) 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 +8 -2
  9. package/lib/api/Routes/invites.d.ts +1 -1
  10. package/lib/api/Routes/skus.d.ts +11 -0
  11. package/lib/api/Routes/skus.js +2 -0
  12. package/lib/api/Routes/stage-instances.d.ts +1 -1
  13. package/lib/api/Routes/stickers.d.ts +2 -2
  14. package/lib/api/Routes/users.d.ts +1 -1
  15. package/lib/api/Routes/voice.d.ts +1 -1
  16. package/lib/api/Routes/webhooks.d.ts +2 -2
  17. package/lib/api/api.d.ts +3 -3
  18. package/lib/api/api.js +15 -25
  19. package/lib/api/bucket.d.ts +0 -1
  20. package/lib/api/shared.d.ts +1 -2
  21. package/lib/api/utils/constants.d.ts +2 -5
  22. package/lib/api/utils/constants.js +3 -7
  23. package/lib/api/utils/utils.d.ts +1 -2
  24. package/lib/api/utils/utils.js +2 -3
  25. package/lib/builders/ActionRow.d.ts +1 -1
  26. package/lib/builders/ActionRow.js +3 -3
  27. package/lib/builders/Attachment.d.ts +3 -4
  28. package/lib/builders/Attachment.js +24 -25
  29. package/lib/builders/Base.d.ts +2 -2
  30. package/lib/builders/Base.js +1 -1
  31. package/lib/builders/Button.d.ts +7 -7
  32. package/lib/builders/Button.js +11 -9
  33. package/lib/builders/Embed.d.ts +1 -1
  34. package/lib/builders/Modal.d.ts +1 -1
  35. package/lib/builders/Modal.js +2 -2
  36. package/lib/builders/Poll.d.ts +2 -2
  37. package/lib/builders/Poll.js +5 -6
  38. package/lib/builders/SelectMenu.d.ts +1 -1
  39. package/lib/builders/SelectMenu.js +17 -18
  40. package/lib/builders/index.d.ts +1 -1
  41. package/lib/builders/index.js +10 -11
  42. package/lib/cache/adapters/default.d.ts +16 -9
  43. package/lib/cache/adapters/default.js +42 -31
  44. package/lib/cache/adapters/index.d.ts +0 -1
  45. package/lib/cache/adapters/index.js +0 -1
  46. package/lib/cache/adapters/limited.d.ts +17 -12
  47. package/lib/cache/adapters/limited.js +80 -36
  48. package/lib/cache/adapters/types.d.ts +6 -7
  49. package/lib/cache/adapters/workeradapter.d.ts +6 -6
  50. package/lib/cache/adapters/workeradapter.js +13 -0
  51. package/lib/cache/index.d.ts +20 -8
  52. package/lib/cache/index.js +328 -22
  53. package/lib/cache/resources/bans.d.ts +9 -6
  54. package/lib/cache/resources/bans.js +13 -4
  55. package/lib/cache/resources/channels.d.ts +6 -4
  56. package/lib/cache/resources/channels.js +13 -7
  57. package/lib/cache/resources/default/base.d.ts +7 -7
  58. package/lib/cache/resources/default/base.js +2 -2
  59. package/lib/cache/resources/default/guild-based.d.ts +6 -6
  60. package/lib/cache/resources/default/guild-based.js +6 -6
  61. package/lib/cache/resources/default/guild-related.d.ts +7 -7
  62. package/lib/cache/resources/default/guild-related.js +10 -8
  63. package/lib/cache/resources/emojis.d.ts +15 -6
  64. package/lib/cache/resources/emojis.js +13 -4
  65. package/lib/cache/resources/guilds.d.ts +9 -6
  66. package/lib/cache/resources/guilds.js +27 -6
  67. package/lib/cache/resources/members.d.ts +9 -6
  68. package/lib/cache/resources/members.js +22 -6
  69. package/lib/cache/resources/messages.d.ts +11 -7
  70. package/lib/cache/resources/messages.js +19 -7
  71. package/lib/cache/resources/overwrites.d.ts +11 -2
  72. package/lib/cache/resources/overwrites.js +9 -0
  73. package/lib/cache/resources/presence.d.ts +3 -2
  74. package/lib/cache/resources/roles.d.ts +9 -6
  75. package/lib/cache/resources/roles.js +13 -4
  76. package/lib/cache/resources/stage-instances.d.ts +2 -2
  77. package/lib/cache/resources/stickers.d.ts +9 -6
  78. package/lib/cache/resources/stickers.js +13 -4
  79. package/lib/cache/resources/threads.d.ts +9 -6
  80. package/lib/cache/resources/threads.js +13 -4
  81. package/lib/cache/resources/users.d.ts +9 -6
  82. package/lib/cache/resources/users.js +13 -4
  83. package/lib/cache/resources/voice-states.d.ts +11 -8
  84. package/lib/cache/resources/voice-states.js +15 -4
  85. package/lib/client/base.d.ts +29 -21
  86. package/lib/client/base.js +64 -57
  87. package/lib/client/client.d.ts +11 -16
  88. package/lib/client/client.js +51 -37
  89. package/lib/client/collectors.d.ts +10 -10
  90. package/lib/client/collectors.js +26 -1
  91. package/lib/client/httpclient.d.ts +8 -13
  92. package/lib/client/httpclient.js +27 -218
  93. package/lib/client/index.d.ts +1 -0
  94. package/lib/client/index.js +1 -0
  95. package/lib/client/transformers.d.ts +68 -0
  96. package/lib/client/transformers.js +99 -0
  97. package/lib/client/types.d.ts +5 -0
  98. package/lib/client/types.js +2 -0
  99. package/lib/client/workerclient.d.ts +16 -15
  100. package/lib/client/workerclient.js +130 -72
  101. package/lib/commands/applications/chat.d.ts +35 -34
  102. package/lib/commands/applications/chat.js +5 -9
  103. package/lib/commands/applications/chatcontext.d.ts +17 -17
  104. package/lib/commands/applications/chatcontext.js +5 -5
  105. package/lib/commands/applications/entryPoint.d.ts +46 -0
  106. package/lib/commands/applications/entryPoint.js +56 -0
  107. package/lib/commands/applications/entrycontext.d.ts +40 -0
  108. package/lib/commands/applications/entrycontext.js +85 -0
  109. package/lib/commands/applications/menu.d.ts +2 -3
  110. package/lib/commands/applications/menu.js +2 -5
  111. package/lib/commands/applications/menucontext.d.ts +14 -13
  112. package/lib/commands/applications/menucontext.js +9 -9
  113. package/lib/commands/applications/options.d.ts +4 -3
  114. package/lib/commands/applications/options.js +20 -21
  115. package/lib/commands/applications/shared.d.ts +3 -1
  116. package/lib/commands/decorators.d.ts +47 -35
  117. package/lib/commands/decorators.js +20 -18
  118. package/lib/commands/handle.d.ts +65 -0
  119. package/lib/commands/handle.js +727 -0
  120. package/lib/commands/handler.d.ts +29 -18
  121. package/lib/commands/handler.js +295 -164
  122. package/lib/commands/index.d.ts +2 -0
  123. package/lib/commands/index.js +2 -0
  124. package/lib/commands/optionresolver.d.ts +13 -13
  125. package/lib/commands/optionresolver.js +24 -29
  126. package/lib/common/bot/watcher.d.ts +4 -33
  127. package/lib/common/bot/watcher.js +0 -109
  128. package/lib/common/index.d.ts +1 -0
  129. package/lib/common/index.js +1 -0
  130. package/lib/common/it/colors.js +48 -49
  131. package/lib/common/it/formatter.d.ts +32 -0
  132. package/lib/common/it/formatter.js +42 -0
  133. package/lib/common/it/logger.d.ts +0 -1
  134. package/lib/common/it/logger.js +3 -3
  135. package/lib/common/it/utils.d.ts +24 -4
  136. package/lib/common/it/utils.js +88 -17
  137. package/lib/common/shorters/application.d.ts +56 -0
  138. package/lib/common/shorters/application.js +81 -0
  139. package/lib/common/shorters/bans.d.ts +4 -5
  140. package/lib/common/shorters/bans.js +3 -3
  141. package/lib/common/shorters/channels.d.ts +7 -6
  142. package/lib/common/shorters/channels.js +19 -15
  143. package/lib/common/shorters/emojis.d.ts +5 -6
  144. package/lib/common/shorters/emojis.js +5 -5
  145. package/lib/common/shorters/guilds.d.ts +18 -16
  146. package/lib/common/shorters/guilds.js +31 -26
  147. package/lib/common/shorters/interaction.d.ts +7 -7
  148. package/lib/common/shorters/interaction.js +3 -2
  149. package/lib/common/shorters/members.d.ts +29 -12
  150. package/lib/common/shorters/members.js +55 -16
  151. package/lib/common/shorters/messages.d.ts +7 -8
  152. package/lib/common/shorters/messages.js +8 -7
  153. package/lib/common/shorters/reactions.d.ts +3 -3
  154. package/lib/common/shorters/reactions.js +11 -11
  155. package/lib/common/shorters/roles.d.ts +9 -7
  156. package/lib/common/shorters/roles.js +26 -7
  157. package/lib/common/shorters/templates.d.ts +7 -8
  158. package/lib/common/shorters/templates.js +7 -7
  159. package/lib/common/shorters/threads.d.ts +6 -7
  160. package/lib/common/shorters/threads.js +6 -9
  161. package/lib/common/shorters/users.d.ts +4 -4
  162. package/lib/common/shorters/users.js +8 -4
  163. package/lib/common/shorters/webhook.d.ts +10 -10
  164. package/lib/common/shorters/webhook.js +10 -9
  165. package/lib/common/types/resolvables.d.ts +2 -2
  166. package/lib/common/types/util.d.ts +4 -2
  167. package/lib/common/types/write.d.ts +3 -3
  168. package/lib/components/ActionRow.d.ts +1 -1
  169. package/lib/components/BaseComponent.d.ts +1 -1
  170. package/lib/components/BaseComponent.js +1 -1
  171. package/lib/components/BaseSelectMenuComponent.d.ts +1 -1
  172. package/lib/components/ButtonComponent.d.ts +17 -7
  173. package/lib/components/ButtonComponent.js +19 -2
  174. package/lib/components/ChannelSelectMenuComponent.d.ts +3 -3
  175. package/lib/components/MentionableSelectMenuComponent.d.ts +2 -2
  176. package/lib/components/RoleSelectMenuComponent.d.ts +2 -2
  177. package/lib/components/StringSelectMenuComponent.d.ts +2 -2
  178. package/lib/components/TextInputComponent.d.ts +2 -2
  179. package/lib/components/UserSelectMenuComponent.d.ts +2 -2
  180. package/lib/components/componentcommand.js +2 -2
  181. package/lib/components/componentcontext.d.ts +10 -9
  182. package/lib/components/componentcontext.js +8 -8
  183. package/lib/components/handler.d.ts +15 -14
  184. package/lib/components/handler.js +89 -93
  185. package/lib/components/index.d.ts +3 -3
  186. package/lib/components/index.js +12 -10
  187. package/lib/components/modalcontext.d.ts +12 -11
  188. package/lib/components/modalcontext.js +2 -2
  189. package/lib/deps/mixer.d.ts +8 -0
  190. package/lib/deps/mixer.js +71 -0
  191. package/lib/events/handler.d.ts +35 -13
  192. package/lib/events/handler.js +57 -24
  193. package/lib/events/hooks/application_command.d.ts +2 -2
  194. package/lib/events/hooks/auto_moderation.d.ts +6 -7
  195. package/lib/events/hooks/auto_moderation.js +4 -4
  196. package/lib/events/hooks/channel.d.ts +2 -2
  197. package/lib/events/hooks/channel.js +4 -7
  198. package/lib/events/hooks/custom.d.ts +4 -3
  199. package/lib/events/hooks/custom.js +5 -1
  200. package/lib/events/hooks/dispatch.d.ts +3 -4
  201. package/lib/events/hooks/dispatch.js +2 -2
  202. package/lib/events/hooks/entitlement.d.ts +5 -37
  203. package/lib/events/hooks/entitlement.js +7 -7
  204. package/lib/events/hooks/guild.d.ts +125 -125
  205. package/lib/events/hooks/guild.js +13 -15
  206. package/lib/events/hooks/integration.d.ts +27 -28
  207. package/lib/events/hooks/integration.js +3 -3
  208. package/lib/events/hooks/interactions.d.ts +2 -2
  209. package/lib/events/hooks/invite.d.ts +18 -17
  210. package/lib/events/hooks/message.d.ts +69 -54
  211. package/lib/events/hooks/message.js +4 -8
  212. package/lib/events/hooks/presence.d.ts +17 -16
  213. package/lib/events/hooks/stage.d.ts +4 -4
  214. package/lib/events/hooks/subscriptions.d.ts +35 -0
  215. package/lib/events/hooks/subscriptions.js +16 -0
  216. package/lib/events/hooks/thread.d.ts +132 -63
  217. package/lib/events/hooks/thread.js +4 -4
  218. package/lib/events/hooks/typing.d.ts +28 -6
  219. package/lib/events/hooks/typing.js +2 -2
  220. package/lib/events/hooks/user.d.ts +3 -3
  221. package/lib/events/hooks/user.js +2 -2
  222. package/lib/events/hooks/voice.d.ts +28 -3
  223. package/lib/events/hooks/voice.js +8 -4
  224. package/lib/events/hooks/webhook.d.ts +1 -1
  225. package/lib/index.d.ts +5 -14
  226. package/lib/index.js +7 -12
  227. package/lib/langs/handler.d.ts +14 -10
  228. package/lib/langs/handler.js +40 -9
  229. package/lib/structures/AutoModerationRule.d.ts +4 -4
  230. package/lib/structures/AutoModerationRule.js +1 -2
  231. package/lib/structures/ClientUser.d.ts +1 -1
  232. package/lib/structures/Entitlement.d.ts +10 -0
  233. package/lib/structures/Entitlement.js +16 -0
  234. package/lib/structures/Guild.d.ts +33 -34
  235. package/lib/structures/Guild.js +5 -2
  236. package/lib/structures/GuildBan.d.ts +6 -6
  237. package/lib/structures/GuildBan.js +2 -1
  238. package/lib/structures/GuildEmoji.d.ts +4 -4
  239. package/lib/structures/GuildEmoji.js +3 -2
  240. package/lib/structures/GuildMember.d.ts +20 -17
  241. package/lib/structures/GuildMember.js +18 -8
  242. package/lib/structures/GuildPreview.d.ts +1 -1
  243. package/lib/structures/GuildRole.d.ts +5 -3
  244. package/lib/structures/GuildRole.js +8 -1
  245. package/lib/structures/GuildTemplate.d.ts +2 -2
  246. package/lib/structures/GuildTemplate.js +1 -1
  247. package/lib/structures/Interaction.d.ts +76 -39
  248. package/lib/structures/Interaction.js +179 -94
  249. package/lib/structures/Message.d.ts +29 -33
  250. package/lib/structures/Message.js +8 -12
  251. package/lib/structures/Poll.d.ts +4 -3
  252. package/lib/structures/Poll.js +6 -2
  253. package/lib/structures/Sticker.d.ts +7 -7
  254. package/lib/structures/Sticker.js +7 -7
  255. package/lib/structures/User.d.ts +5 -4
  256. package/lib/structures/User.js +2 -1
  257. package/lib/structures/VoiceState.d.ts +15 -11
  258. package/lib/structures/VoiceState.js +35 -17
  259. package/lib/structures/Webhook.d.ts +6 -7
  260. package/lib/structures/Webhook.js +6 -7
  261. package/lib/structures/channels.d.ts +11 -10
  262. package/lib/structures/channels.js +70 -65
  263. package/lib/structures/extra/BaseGuild.d.ts +12 -2
  264. package/lib/structures/extra/BaseGuild.js +30 -3
  265. package/lib/structures/extra/BitField.d.ts +1 -1
  266. package/lib/structures/extra/BitField.js +3 -2
  267. package/lib/structures/extra/DiscordBase.js +2 -2
  268. package/lib/structures/extra/Permissions.d.ts +3 -1
  269. package/lib/structures/extra/Permissions.js +8 -3
  270. package/lib/types/gateway.d.ts +1554 -0
  271. package/lib/types/gateway.js +4 -0
  272. package/lib/types/index.d.ts +9 -1
  273. package/lib/types/index.js +28 -1
  274. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/attachment.d.ts +5 -0
  275. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/attachment.js +2 -0
  276. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/base.d.ts +22 -0
  277. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/base.js +2 -0
  278. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/boolean.d.ts +4 -0
  279. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/boolean.js +2 -0
  280. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/channel.d.ts +7 -0
  281. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/channel.js +2 -0
  282. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/integer.d.ts +17 -0
  283. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/integer.js +2 -0
  284. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/mentionable.d.ts +5 -0
  285. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/mentionable.js +2 -0
  286. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/number.d.ts +17 -0
  287. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/number.js +2 -0
  288. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/role.d.ts +5 -0
  289. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/role.js +2 -0
  290. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.d.ts +25 -0
  291. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.js +20 -0
  292. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/string.d.ts +17 -0
  293. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/string.js +2 -0
  294. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommand.d.ts +11 -0
  295. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommand.js +2 -0
  296. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommandGroup.d.ts +11 -0
  297. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommandGroup.js +2 -0
  298. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/user.d.ts +5 -0
  299. package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/user.js +2 -0
  300. package/lib/types/payloads/_interactions/_applicationCommands/chatInput.d.ts +65 -0
  301. package/lib/types/payloads/_interactions/_applicationCommands/chatInput.js +29 -0
  302. package/lib/types/payloads/_interactions/_applicationCommands/contextMenu.d.ts +65 -0
  303. package/lib/types/payloads/_interactions/_applicationCommands/contextMenu.js +2 -0
  304. package/lib/types/payloads/_interactions/_applicationCommands/internals.d.ts +8 -0
  305. package/lib/types/payloads/_interactions/_applicationCommands/internals.js +2 -0
  306. package/lib/types/payloads/_interactions/_applicationCommands/permissions.d.ts +54 -0
  307. package/lib/types/payloads/_interactions/_applicationCommands/permissions.js +20 -0
  308. package/lib/types/payloads/_interactions/applicationCommands.d.ts +188 -0
  309. package/lib/types/payloads/_interactions/applicationCommands.js +88 -0
  310. package/lib/types/payloads/_interactions/autocomplete.d.ts +10 -0
  311. package/lib/types/payloads/_interactions/autocomplete.js +2 -0
  312. package/lib/types/payloads/_interactions/base.d.ts +197 -0
  313. package/lib/types/payloads/_interactions/base.js +2 -0
  314. package/lib/types/payloads/_interactions/messageComponents.d.ts +41 -0
  315. package/lib/types/payloads/_interactions/messageComponents.js +2 -0
  316. package/lib/types/payloads/_interactions/modalSubmit.d.ts +35 -0
  317. package/lib/types/payloads/_interactions/modalSubmit.js +2 -0
  318. package/lib/types/payloads/_interactions/ping.d.ts +3 -0
  319. package/lib/types/payloads/_interactions/ping.js +2 -0
  320. package/lib/types/payloads/_interactions/responses.d.ts +184 -0
  321. package/lib/types/payloads/_interactions/responses.js +58 -0
  322. package/lib/types/payloads/application.d.ts +292 -0
  323. package/lib/types/payloads/application.js +117 -0
  324. package/lib/types/payloads/auditLog.d.ts +644 -0
  325. package/lib/types/payloads/auditLog.js +80 -0
  326. package/lib/types/payloads/autoModeration.d.ts +219 -0
  327. package/lib/types/payloads/autoModeration.js +87 -0
  328. package/lib/types/payloads/channel.d.ts +1748 -0
  329. package/lib/types/payloads/channel.js +376 -0
  330. package/lib/types/payloads/emoji.d.ts +48 -0
  331. package/lib/types/payloads/emoji.js +5 -0
  332. package/lib/types/payloads/gateway.d.ts +373 -0
  333. package/lib/types/payloads/gateway.js +82 -0
  334. package/lib/types/payloads/guild.d.ts +1060 -0
  335. package/lib/types/payloads/guild.js +324 -0
  336. package/lib/types/payloads/guildScheduledEvent.d.ts +138 -0
  337. package/lib/types/payloads/guildScheduledEvent.js +32 -0
  338. package/lib/types/payloads/index.d.ts +64 -0
  339. package/lib/types/payloads/index.js +37 -0
  340. package/lib/types/payloads/interactions.d.ts +24 -0
  341. package/lib/types/payloads/interactions.js +23 -0
  342. package/lib/types/payloads/invite.d.ts +121 -0
  343. package/lib/types/payloads/invite.js +23 -0
  344. package/lib/types/payloads/monetization.d.ts +178 -0
  345. package/lib/types/payloads/monetization.js +88 -0
  346. package/lib/types/payloads/oauth2.d.ts +131 -0
  347. package/lib/types/payloads/oauth2.js +135 -0
  348. package/lib/types/payloads/permissions.d.ts +97 -0
  349. package/lib/types/payloads/permissions.js +16 -0
  350. package/lib/types/payloads/poll.d.ts +104 -0
  351. package/lib/types/payloads/poll.js +16 -0
  352. package/lib/types/payloads/stageInstance.d.ts +77 -0
  353. package/lib/types/payloads/stageInstance.js +19 -0
  354. package/lib/types/payloads/sticker.d.ts +123 -0
  355. package/lib/types/payloads/sticker.js +30 -0
  356. package/lib/types/payloads/teams.d.ts +78 -0
  357. package/lib/types/payloads/teams.js +23 -0
  358. package/lib/types/payloads/template.d.ts +62 -0
  359. package/lib/types/payloads/template.js +5 -0
  360. package/lib/types/payloads/user.d.ts +337 -0
  361. package/lib/types/payloads/user.js +167 -0
  362. package/lib/types/payloads/voice.d.ts +89 -0
  363. package/lib/types/payloads/voice.js +5 -0
  364. package/lib/types/payloads/webhook.d.ts +76 -0
  365. package/lib/types/payloads/webhook.js +21 -0
  366. package/lib/types/rest/application.d.ts +57 -0
  367. package/lib/types/rest/application.js +2 -0
  368. package/lib/types/rest/auditLog.d.ts +30 -0
  369. package/lib/types/rest/auditLog.js +2 -0
  370. package/lib/types/rest/autoModeration.d.ts +66 -0
  371. package/lib/types/rest/autoModeration.js +2 -0
  372. package/lib/types/rest/channel.d.ts +699 -0
  373. package/lib/types/rest/channel.js +11 -0
  374. package/lib/types/rest/emoji.d.ts +54 -0
  375. package/lib/types/rest/emoji.js +2 -0
  376. package/lib/types/rest/gateway.d.ts +9 -0
  377. package/lib/types/rest/gateway.js +2 -0
  378. package/lib/types/rest/guild.d.ts +865 -0
  379. package/lib/types/rest/guild.js +2 -0
  380. package/lib/types/rest/guildScheduledEvent.d.ts +126 -0
  381. package/lib/types/rest/guildScheduledEvent.js +2 -0
  382. package/lib/types/rest/index.d.ts +296 -0
  383. package/lib/types/rest/index.js +292 -0
  384. package/lib/types/rest/interactions.d.ts +216 -0
  385. package/lib/types/rest/interactions.js +2 -0
  386. package/lib/types/rest/invite.d.ts +24 -0
  387. package/lib/types/rest/invite.js +2 -0
  388. package/lib/types/rest/monetization.d.ts +103 -0
  389. package/lib/types/rest/monetization.js +11 -0
  390. package/lib/types/rest/oauth2.d.ts +172 -0
  391. package/lib/types/rest/oauth2.js +2 -0
  392. package/lib/types/rest/poll.d.ts +44 -0
  393. package/lib/types/rest/poll.js +2 -0
  394. package/lib/types/rest/stageInstance.d.ts +58 -0
  395. package/lib/types/rest/stageInstance.js +2 -0
  396. package/lib/types/rest/sticker.d.ts +77 -0
  397. package/lib/types/rest/sticker.js +2 -0
  398. package/lib/types/rest/template.d.ts +62 -0
  399. package/lib/types/rest/template.js +2 -0
  400. package/lib/types/rest/user.d.ts +120 -0
  401. package/lib/types/rest/user.js +2 -0
  402. package/lib/types/rest/voice.d.ts +17 -0
  403. package/lib/types/rest/voice.js +2 -0
  404. package/lib/types/rest/webhook.d.ts +250 -0
  405. package/lib/types/rest/webhook.js +2 -0
  406. package/lib/types/utils/index.d.ts +808 -0
  407. package/lib/types/utils/index.js +810 -0
  408. package/lib/websocket/SharedTypes.d.ts +12 -5
  409. package/lib/websocket/SharedTypes.js +1 -1
  410. package/lib/websocket/constants/index.d.ts +3 -3
  411. package/lib/websocket/constants/index.js +11 -1
  412. package/lib/websocket/discord/basesocket.d.ts +7 -7
  413. package/lib/websocket/discord/basesocket.js +34 -22
  414. package/lib/websocket/discord/events/memberUpdate.d.ts +1 -6
  415. package/lib/websocket/discord/events/memberUpdate.js +2 -1
  416. package/lib/websocket/discord/events/presenceUpdate.d.ts +5 -18
  417. package/lib/websocket/discord/events/presenceUpdate.js +5 -6
  418. package/lib/websocket/discord/shard.d.ts +9 -8
  419. package/lib/websocket/discord/shard.js +83 -57
  420. package/lib/websocket/discord/sharder.d.ts +6 -5
  421. package/lib/websocket/discord/sharder.js +70 -11
  422. package/lib/websocket/discord/shared.d.ts +34 -6
  423. package/lib/websocket/discord/socket/custom.d.ts +52 -0
  424. package/lib/websocket/discord/socket/custom.js +300 -0
  425. package/lib/websocket/discord/worker.d.ts +6 -10
  426. package/lib/websocket/discord/workermanager.d.ts +10 -16
  427. package/lib/websocket/discord/workermanager.js +63 -50
  428. package/lib/websocket/structures/index.d.ts +0 -1
  429. package/lib/websocket/structures/index.js +1 -1
  430. package/lib/websocket/structures/timeout.d.ts +0 -1
  431. package/package.json +70 -74
  432. package/lib/cache/adapters/redis.d.ts +0 -37
  433. package/lib/cache/adapters/redis.js +0 -218
  434. package/lib/client/oninteractioncreate.d.ts +0 -4
  435. package/lib/client/oninteractioncreate.js +0 -198
  436. package/lib/client/onmessagecreate.d.ts +0 -13
  437. package/lib/client/onmessagecreate.js +0 -410
  438. package/lib/structures/extra/functions.d.ts +0 -12
  439. package/lib/structures/extra/functions.js +0 -70
@@ -0,0 +1,1748 @@
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' | 'sticker_items' | 'components' | 'stickers'>;
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
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-types
994
+ */
995
+ type?: EmbedType;
996
+ /**
997
+ * Description of embed
998
+ *
999
+ * Length limit: 4096 characters
1000
+ */
1001
+ description?: string;
1002
+ /**
1003
+ * URL of embed
1004
+ */
1005
+ url?: string;
1006
+ /**
1007
+ * Timestamp of embed content
1008
+ */
1009
+ timestamp?: string;
1010
+ /**
1011
+ * Color code of the embed
1012
+ */
1013
+ color?: number;
1014
+ /**
1015
+ * Footer information
1016
+ *
1017
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
1018
+ */
1019
+ footer?: APIEmbedFooter;
1020
+ /**
1021
+ * Image information
1022
+ *
1023
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
1024
+ */
1025
+ image?: APIEmbedImage;
1026
+ /**
1027
+ * Thumbnail information
1028
+ *
1029
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
1030
+ */
1031
+ thumbnail?: APIEmbedThumbnail;
1032
+ /**
1033
+ * Video information
1034
+ *
1035
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
1036
+ */
1037
+ video?: APIEmbedVideo;
1038
+ /**
1039
+ * Provider information
1040
+ *
1041
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
1042
+ */
1043
+ provider?: APIEmbedProvider;
1044
+ /**
1045
+ * Author information
1046
+ *
1047
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
1048
+ */
1049
+ author?: APIEmbedAuthor;
1050
+ /**
1051
+ * Fields information
1052
+ *
1053
+ * Length limit: 25 field objects
1054
+ *
1055
+ * See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
1056
+ */
1057
+ fields?: APIEmbedField[];
1058
+ }
1059
+ /**
1060
+ * https://discord.com/developers/docs/resources/message#embed-fields-by-embed-type-poll-result-embed-fields
1061
+ */
1062
+ export interface PollResultEmbedField<T extends string, V extends string = string> {
1063
+ name: T;
1064
+ value: V;
1065
+ inline: false;
1066
+ }
1067
+ /**
1068
+ * https://discord.com/developers/docs/resources/message#embed-fields-by-embed-type-poll-result-embed-fields
1069
+ */
1070
+ export type PollResultEmbedFields = [
1071
+ /** question text from the original poll */
1072
+ PollResultEmbedField<'poll_question_text'>,
1073
+ /** number of votes for the answer(s) with the most votes */
1074
+ PollResultEmbedField<'victor_answer_votes', `${number}`>,
1075
+ /** total number of votes in the poll */
1076
+ PollResultEmbedField<'total_votes', `${number}`>,
1077
+ /** id for the winning answer */
1078
+ PollResultEmbedField<'victor_answer_id', `${number}`> | undefined,
1079
+ /** text for the winning answer */
1080
+ PollResultEmbedField<'victor_answer_text'> | undefined,
1081
+ /** id for an emoji associated with the winning answer */
1082
+ PollResultEmbedField<'victor_answer_emoji_id'> | undefined,
1083
+ /** name for an emoji associated with the winning answer */
1084
+ PollResultEmbedField<'victor_answer_emoji_name'> | undefined,
1085
+ /** if an emoji associated with the winning answer is animated */
1086
+ PollResultEmbedField<'victor_answer_emoji_animated', `${boolean}`> | undefined
1087
+ ];
1088
+ export type APIEmbedPollResult = {
1089
+ type: EmbedType.PollResult;
1090
+ fields: PollResultEmbedFields;
1091
+ /**
1092
+ * @unstable This field is not officially documented by Discord.
1093
+ * Current observations indicate a consistent value of 0 for all embeds.
1094
+ */
1095
+ content_scan_version: number;
1096
+ };
1097
+ /**
1098
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-types
1099
+ *
1100
+ */
1101
+ export declare enum EmbedType {
1102
+ /**
1103
+ * Generic embed rendered from embed attributes
1104
+ */
1105
+ Rich = "rich",
1106
+ /**
1107
+ * Image embed
1108
+ */
1109
+ Image = "image",
1110
+ /**
1111
+ * Video embed
1112
+ */
1113
+ Video = "video",
1114
+ /**
1115
+ * Animated gif image embed rendered as a video embed
1116
+ */
1117
+ GIFV = "gifv",
1118
+ /**
1119
+ * Article embed
1120
+ */
1121
+ Article = "article",
1122
+ /**
1123
+ * Link embed
1124
+ */
1125
+ Link = "link",
1126
+ /**
1127
+ * Poll result embed
1128
+ * https://discord.com/developers/docs/resources/message#embed-fields-by-embed-type-poll-result-embed-fields
1129
+ */
1130
+ PollResult = "poll_result",
1131
+ /**
1132
+ * Auto moderation alert embed
1133
+ *
1134
+ * @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
1135
+ */
1136
+ AutoModerationMessage = "auto_moderation_message"
1137
+ }
1138
+ /**
1139
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
1140
+ */
1141
+ export interface APIEmbedThumbnail {
1142
+ /**
1143
+ * Source url of thumbnail (only supports http(s) and attachments)
1144
+ */
1145
+ url: string;
1146
+ /**
1147
+ * A proxied url of the thumbnail
1148
+ */
1149
+ proxy_url?: string;
1150
+ /**
1151
+ * Height of thumbnail
1152
+ */
1153
+ height?: number;
1154
+ /**
1155
+ * Width of thumbnail
1156
+ */
1157
+ width?: number;
1158
+ }
1159
+ /**
1160
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
1161
+ */
1162
+ export interface APIEmbedVideo {
1163
+ /**
1164
+ * Source url of video
1165
+ */
1166
+ url?: string;
1167
+ /**
1168
+ * A proxied url of the video
1169
+ */
1170
+ proxy_url?: string;
1171
+ /**
1172
+ * Height of video
1173
+ */
1174
+ height?: number;
1175
+ /**
1176
+ * Width of video
1177
+ */
1178
+ width?: number;
1179
+ }
1180
+ /**
1181
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
1182
+ */
1183
+ export interface APIEmbedImage {
1184
+ /**
1185
+ * Source url of image (only supports http(s) and attachments)
1186
+ */
1187
+ url: string;
1188
+ /**
1189
+ * A proxied url of the image
1190
+ */
1191
+ proxy_url?: string;
1192
+ /**
1193
+ * Height of image
1194
+ */
1195
+ height?: number;
1196
+ /**
1197
+ * Width of image
1198
+ */
1199
+ width?: number;
1200
+ }
1201
+ /**
1202
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
1203
+ */
1204
+ export interface APIEmbedProvider {
1205
+ /**
1206
+ * Name of provider
1207
+ */
1208
+ name?: string;
1209
+ /**
1210
+ * URL of provider
1211
+ */
1212
+ url?: string;
1213
+ }
1214
+ /**
1215
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
1216
+ */
1217
+ export interface APIEmbedAuthor {
1218
+ /**
1219
+ * Name of author
1220
+ *
1221
+ * Length limit: 256 characters
1222
+ */
1223
+ name: string;
1224
+ /**
1225
+ * URL of author
1226
+ */
1227
+ url?: string;
1228
+ /**
1229
+ * URL of author icon (only supports http(s) and attachments)
1230
+ */
1231
+ icon_url?: string;
1232
+ /**
1233
+ * A proxied url of author icon
1234
+ */
1235
+ proxy_icon_url?: string;
1236
+ }
1237
+ /**
1238
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
1239
+ */
1240
+ export interface APIEmbedFooter {
1241
+ /**
1242
+ * Footer text
1243
+ *
1244
+ * Length limit: 2048 characters
1245
+ */
1246
+ text: string;
1247
+ /**
1248
+ * URL of footer icon (only supports http(s) and attachments)
1249
+ */
1250
+ icon_url?: string;
1251
+ /**
1252
+ * A proxied url of footer icon
1253
+ */
1254
+ proxy_icon_url?: string;
1255
+ }
1256
+ /**
1257
+ * https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
1258
+ */
1259
+ export interface APIEmbedField {
1260
+ /**
1261
+ * Name of the field
1262
+ *
1263
+ * Length limit: 256 characters
1264
+ */
1265
+ name: string;
1266
+ /**
1267
+ * Value of the field
1268
+ *
1269
+ * Length limit: 1024 characters
1270
+ */
1271
+ value: string;
1272
+ /**
1273
+ * Whether or not this field should display inline
1274
+ */
1275
+ inline?: boolean;
1276
+ }
1277
+ /**
1278
+ * https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
1279
+ */
1280
+ export interface APIAttachment {
1281
+ /**
1282
+ * Attachment id
1283
+ */
1284
+ id: Snowflake;
1285
+ /**
1286
+ * Name of file attached
1287
+ */
1288
+ filename: string;
1289
+ /**
1290
+ * The title of the file
1291
+ */
1292
+ title?: string;
1293
+ /**
1294
+ * Description for the file
1295
+ */
1296
+ description?: string;
1297
+ /**
1298
+ * The attachment's media type
1299
+ *
1300
+ * See https://en.wikipedia.org/wiki/Media_type
1301
+ */
1302
+ content_type?: string;
1303
+ /**
1304
+ * Size of file in bytes
1305
+ */
1306
+ size: number;
1307
+ /**
1308
+ * Source url of file
1309
+ */
1310
+ url: string;
1311
+ /**
1312
+ * A proxied url of file
1313
+ */
1314
+ proxy_url: string;
1315
+ /**
1316
+ * Height of file (if image)
1317
+ */
1318
+ height?: number | null;
1319
+ /**
1320
+ * Width of file (if image)
1321
+ */
1322
+ width?: number | null;
1323
+ /**
1324
+ * Whether this attachment is ephemeral
1325
+ */
1326
+ ephemeral?: boolean;
1327
+ /**
1328
+ * The duration of the audio file (currently for voice messages)
1329
+ */
1330
+ duration_secs?: number;
1331
+ /**
1332
+ * Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
1333
+ */
1334
+ waveform?: string;
1335
+ /**
1336
+ * Attachment flags combined as a bitfield
1337
+ */
1338
+ flags?: AttachmentFlags;
1339
+ }
1340
+ /**
1341
+ * https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
1342
+ */
1343
+ export declare enum AttachmentFlags {
1344
+ /**
1345
+ * This attachment has been edited using the remix feature on mobile
1346
+ */
1347
+ IsRemix = 4
1348
+ }
1349
+ /**
1350
+ * https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
1351
+ */
1352
+ export interface APIChannelMention {
1353
+ /**
1354
+ * ID of the channel
1355
+ */
1356
+ id: Snowflake;
1357
+ /**
1358
+ * ID of the guild containing the channel
1359
+ */
1360
+ guild_id: Snowflake;
1361
+ /**
1362
+ * The type of channel
1363
+ *
1364
+ * See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
1365
+ */
1366
+ type: ChannelType;
1367
+ /**
1368
+ * The name of the channel
1369
+ */
1370
+ name: string;
1371
+ }
1372
+ /**
1373
+ * https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
1374
+ */
1375
+ export declare enum AllowedMentionsTypes {
1376
+ /**
1377
+ * Controls @everyone and @here mentions
1378
+ */
1379
+ Everyone = "everyone",
1380
+ /**
1381
+ * Controls role mentions
1382
+ */
1383
+ Role = "roles",
1384
+ /**
1385
+ * Controls user mentions
1386
+ */
1387
+ User = "users"
1388
+ }
1389
+ /**
1390
+ * https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
1391
+ */
1392
+ export interface APIAllowedMentions {
1393
+ /**
1394
+ * An array of allowed mention types to parse from the content
1395
+ *
1396
+ * See https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
1397
+ */
1398
+ parse?: AllowedMentionsTypes[];
1399
+ /**
1400
+ * Array of role_ids to mention (Max size of 100)
1401
+ */
1402
+ roles?: Snowflake[];
1403
+ /**
1404
+ * Array of user_ids to mention (Max size of 100)
1405
+ */
1406
+ users?: Snowflake[];
1407
+ /**
1408
+ * For replies, whether to mention the author of the message being replied to (default false)
1409
+ *
1410
+ * @default false
1411
+ */
1412
+ replied_user?: boolean;
1413
+ }
1414
+ /**
1415
+ * https://discord.com/developers/docs/interactions/message-components#component-object
1416
+ */
1417
+ export interface APIBaseComponent<T extends ComponentType> {
1418
+ /**
1419
+ * The type of the component
1420
+ */
1421
+ type: T;
1422
+ }
1423
+ /**
1424
+ * https://discord.com/developers/docs/interactions/message-components#component-object-component-types
1425
+ */
1426
+ export declare enum ComponentType {
1427
+ /**
1428
+ * Action Row component
1429
+ */
1430
+ ActionRow = 1,
1431
+ /**
1432
+ * Button component
1433
+ */
1434
+ Button = 2,
1435
+ /**
1436
+ * Select menu for picking from defined text options
1437
+ */
1438
+ StringSelect = 3,
1439
+ /**
1440
+ * Text Input component
1441
+ */
1442
+ TextInput = 4,
1443
+ /**
1444
+ * Select menu for users
1445
+ */
1446
+ UserSelect = 5,
1447
+ /**
1448
+ * Select menu for roles
1449
+ */
1450
+ RoleSelect = 6,
1451
+ /**
1452
+ * Select menu for users and roles
1453
+ */
1454
+ MentionableSelect = 7,
1455
+ /**
1456
+ * Select menu for channels
1457
+ */
1458
+ ChannelSelect = 8,
1459
+ /**
1460
+ * Select menu for picking from defined text options
1461
+ *
1462
+ * @deprecated This is the old name for {@apilink ComponentType#StringSelect}
1463
+ */
1464
+ SelectMenu = 3
1465
+ }
1466
+ /**
1467
+ * https://discord.com/developers/docs/interactions/message-components#action-rows
1468
+ */
1469
+ export interface APIActionRowComponent<T extends APIActionRowComponentTypes> extends APIBaseComponent<ComponentType.ActionRow> {
1470
+ /**
1471
+ * The components in the ActionRow
1472
+ */
1473
+ components: T[];
1474
+ }
1475
+ /**
1476
+ * https://discord.com/developers/docs/interactions/message-components#buttons
1477
+ */
1478
+ export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
1479
+ /**
1480
+ * The label to be displayed on the button
1481
+ */
1482
+ label?: string;
1483
+ /**
1484
+ * The style of the button
1485
+ */
1486
+ style: Style;
1487
+ /**
1488
+ * The emoji to display to the left of the text
1489
+ */
1490
+ emoji?: APIMessageComponentEmoji;
1491
+ /**
1492
+ * The status of the button
1493
+ */
1494
+ disabled?: boolean;
1495
+ }
1496
+ export interface APIMessageComponentEmoji {
1497
+ /**
1498
+ * Emoji id
1499
+ */
1500
+ id?: Snowflake;
1501
+ /**
1502
+ * Emoji name
1503
+ */
1504
+ name?: string;
1505
+ /**
1506
+ * Whether this emoji is animated
1507
+ */
1508
+ animated?: boolean;
1509
+ }
1510
+ export interface APIButtonComponentWithCustomId extends APIButtonComponentBase<ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success> {
1511
+ /**
1512
+ * The custom_id to be sent in the interaction when clicked
1513
+ */
1514
+ custom_id: string;
1515
+ }
1516
+ export interface APIButtonComponentWithURL extends APIButtonComponentBase<ButtonStyle.Link> {
1517
+ /**
1518
+ * The URL to direct users to when clicked for Link buttons
1519
+ */
1520
+ url: string;
1521
+ }
1522
+ export interface APIButtonComponentWithSKUId extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
1523
+ /**
1524
+ * The id for a purchasable SKU
1525
+ */
1526
+ sku_id: Snowflake;
1527
+ }
1528
+ export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithSKUId | APIButtonComponentWithURL;
1529
+ /**
1530
+ * https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
1531
+ */
1532
+ export declare enum ButtonStyle {
1533
+ Primary = 1,
1534
+ Secondary = 2,
1535
+ Success = 3,
1536
+ Danger = 4,
1537
+ Link = 5,
1538
+ Premium = 6
1539
+ }
1540
+ /**
1541
+ * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles
1542
+ */
1543
+ export declare enum TextInputStyle {
1544
+ Short = 1,
1545
+ Paragraph = 2
1546
+ }
1547
+ /**
1548
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1549
+ */
1550
+ export interface APIBaseSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect> extends APIBaseComponent<T> {
1551
+ /**
1552
+ * A developer-defined identifier for the select menu, max 100 characters
1553
+ */
1554
+ custom_id: string;
1555
+ /**
1556
+ * Custom placeholder text if nothing is selected, max 150 characters
1557
+ */
1558
+ placeholder?: string;
1559
+ /**
1560
+ * The minimum number of items that must be chosen; min 0, max 25
1561
+ *
1562
+ * @default 1
1563
+ */
1564
+ min_values?: number;
1565
+ /**
1566
+ * The maximum number of items that can be chosen; max 25
1567
+ *
1568
+ * @default 1
1569
+ */
1570
+ max_values?: number;
1571
+ /**
1572
+ * Disable the select
1573
+ *
1574
+ * @default false
1575
+ */
1576
+ disabled?: boolean;
1577
+ }
1578
+ export interface APIBaseAutoPopulatedSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.UserSelect, D extends SelectMenuDefaultValueType> extends APIBaseSelectMenuComponent<T> {
1579
+ /**
1580
+ * List of default values for auto-populated select menu components
1581
+ */
1582
+ default_values?: APISelectMenuDefaultValue<D>[];
1583
+ }
1584
+ /**
1585
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1586
+ */
1587
+ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
1588
+ /**
1589
+ * Specified choices in a select menu; max 25
1590
+ */
1591
+ options: APISelectMenuOption[];
1592
+ }
1593
+ /**
1594
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1595
+ */
1596
+ export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.UserSelect, SelectMenuDefaultValueType.User>;
1597
+ /**
1598
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1599
+ */
1600
+ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.RoleSelect, SelectMenuDefaultValueType.Role>;
1601
+ /**
1602
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1603
+ */
1604
+ export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.MentionableSelect, SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User>;
1605
+ /**
1606
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1607
+ */
1608
+ export interface APIChannelSelectComponent extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
1609
+ /**
1610
+ * List of channel types to include in the ChannelSelect component
1611
+ */
1612
+ channel_types?: ChannelType[];
1613
+ }
1614
+ /**
1615
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
1616
+ */
1617
+ export declare enum SelectMenuDefaultValueType {
1618
+ Channel = "channel",
1619
+ Role = "role",
1620
+ User = "user"
1621
+ }
1622
+ /**
1623
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
1624
+ */
1625
+ export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
1626
+ type: T;
1627
+ id: Snowflake;
1628
+ }
1629
+ export type APIAutoPopulatedSelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIUserSelectComponent;
1630
+ /**
1631
+ * https://discord.com/developers/docs/interactions/message-components#select-menus
1632
+ */
1633
+ export type APISelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIStringSelectComponent | APIUserSelectComponent;
1634
+ /**
1635
+ * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
1636
+ */
1637
+ export interface APISelectMenuOption {
1638
+ /**
1639
+ * The user-facing name of the option (max 100 chars)
1640
+ */
1641
+ label: string;
1642
+ /**
1643
+ * The dev-defined value of the option (max 100 chars)
1644
+ */
1645
+ value: string;
1646
+ /**
1647
+ * An additional description of the option (max 100 chars)
1648
+ */
1649
+ description?: string;
1650
+ /**
1651
+ * The emoji to display to the left of the option
1652
+ */
1653
+ emoji?: APIMessageComponentEmoji;
1654
+ /**
1655
+ * Whether this option should be already-selected by default
1656
+ */
1657
+ default?: boolean;
1658
+ }
1659
+ /**
1660
+ * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure
1661
+ */
1662
+ export interface APITextInputComponent extends APIBaseComponent<ComponentType.TextInput> {
1663
+ /**
1664
+ * One of text input styles
1665
+ */
1666
+ style: TextInputStyle;
1667
+ /**
1668
+ * The custom id for the text input
1669
+ */
1670
+ custom_id: string;
1671
+ /**
1672
+ * Text that appears on top of the text input field, max 45 characters
1673
+ */
1674
+ label: string;
1675
+ /**
1676
+ * Placeholder for the text input
1677
+ */
1678
+ placeholder?: string;
1679
+ /**
1680
+ * The pre-filled text in the text input
1681
+ */
1682
+ value?: string;
1683
+ /**
1684
+ * Minimal length of text input
1685
+ */
1686
+ min_length?: number;
1687
+ /**
1688
+ * Maximal length of text input
1689
+ */
1690
+ max_length?: number;
1691
+ /**
1692
+ * Whether or not this text input is required or not
1693
+ */
1694
+ required?: boolean;
1695
+ }
1696
+ /**
1697
+ * https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
1698
+ */
1699
+ export declare enum ChannelFlags {
1700
+ /**
1701
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1702
+ */
1703
+ GuildFeedRemoved = 1,
1704
+ /**
1705
+ * This thread is pinned to the top of its parent forum channel
1706
+ */
1707
+ Pinned = 2,
1708
+ /**
1709
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1710
+ */
1711
+ ActiveChannelsRemoved = 4,
1712
+ /**
1713
+ * Whether a tag is required to be specified when creating a thread in a forum channel.
1714
+ * Tags are specified in the `applied_tags` field
1715
+ */
1716
+ RequireTag = 16,
1717
+ /**
1718
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1719
+ */
1720
+ IsSpam = 32,
1721
+ /**
1722
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1723
+ */
1724
+ IsGuildResourceChannel = 128,
1725
+ /**
1726
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1727
+ */
1728
+ ClydeAI = 256,
1729
+ /**
1730
+ * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1731
+ */
1732
+ IsScheduledForDeletion = 512,
1733
+ /**
1734
+ * Whether media download options are hidden.
1735
+ */
1736
+ HideMediaDownloadOptions = 32768
1737
+ }
1738
+ /**
1739
+ * https://discord.com/developers/docs/interactions/message-components#message-components
1740
+ */
1741
+ export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
1742
+ export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
1743
+ export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;
1744
+ /**
1745
+ * https://discord.com/developers/docs/interactions/message-components#message-components
1746
+ */
1747
+ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent;
1748
+ export type APIModalActionRowComponent = APITextInputComponent;