cognova 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DQlXU6_H.js → -2wkydbj.js} +1 -1
- package/.output/public/_nuxt/{D9V13KTK.js → 0J8pJb0Z.js} +1 -1
- package/.output/public/_nuxt/{CclZMdca.js → 0LyRrTRM.js} +1 -1
- package/.output/public/_nuxt/{CflRLvFC.js → 1Hz98MKF.js} +1 -1
- package/.output/public/_nuxt/{DkBIU-1F.js → 1IuG3yiQ.js} +1 -1
- package/.output/public/_nuxt/{B_17gAr_.js → 4bC1z31I.js} +1 -1
- package/.output/public/_nuxt/{CC4Goztu.js → A5lrd5_j.js} +1 -1
- package/.output/public/_nuxt/{BHe4VLtR.js → B-5roYpk.js} +1 -1
- package/.output/public/_nuxt/{B_qzFVK_.js → B-YQztaH.js} +1 -1
- package/.output/public/_nuxt/B1gFtqXK.js +1 -0
- package/.output/public/_nuxt/B43p0So7.js +1 -0
- package/.output/public/_nuxt/{DSQj-oMk.js → B5OWqWCh.js} +1 -1
- package/.output/public/_nuxt/{CvJtd2Af.js → B7-0ADn3.js} +1 -1
- package/.output/public/_nuxt/{DU6ewLkE.js → B8Kve-DH.js} +1 -1
- package/.output/public/_nuxt/{BF7413u4.js → B9Kd_0HK.js} +1 -1
- package/.output/public/_nuxt/{BhrzKbv9.js → BJ_GgKV0.js} +1 -1
- package/.output/public/_nuxt/{CM2phu_3.js → BJi2ZHtT.js} +1 -1
- package/.output/public/_nuxt/{qR_K5W8V.js → BLL1JLwq.js} +1 -1
- package/.output/public/_nuxt/{aiXk7zRt.js → BLszW9T3.js} +1 -1
- package/.output/public/_nuxt/{DeAGWdWK.js → BMLwzSDu.js} +1 -1
- package/.output/public/_nuxt/{B5dI_yLq.js → BNlugvM3.js} +1 -1
- package/.output/public/_nuxt/{Dvw-hR3Y.js → BTfZ7nek.js} +1 -1
- package/.output/public/_nuxt/{m5001Uvl.js → BTk5mgdf.js} +1 -1
- package/.output/public/_nuxt/{DfF1qofg.js → BW-E-Sar.js} +1 -1
- package/.output/public/_nuxt/{xxnk7j0F.js → BZFXnEwe.js} +1 -1
- package/.output/public/_nuxt/{DaBp0Gba.js → B_28CKij.js} +2 -2
- package/.output/public/_nuxt/{CYjcQPl-.js → BaJEGr8G.js} +1 -1
- package/.output/public/_nuxt/{CFyD2NHP.js → BaVaTug8.js} +1 -1
- package/.output/public/_nuxt/{_E89BQAO.js → Bb1B0ntt.js} +1 -1
- package/.output/public/_nuxt/{C3dYlP5x.js → Bb9LNSu_.js} +1 -1
- package/.output/public/_nuxt/{BLmc9T7l.js → BbPnqQJ0.js} +1 -1
- package/.output/public/_nuxt/{XHiJSquP.js → Bc0NIKN7.js} +1 -1
- package/.output/public/_nuxt/{DFg8PvHV.js → BdCB2PoJ.js} +1 -1
- package/.output/public/_nuxt/{BQZfTrUg.js → Bf34lExB.js} +1 -1
- package/.output/public/_nuxt/{CrZGoMo_.js → BhOIdu3Z.js} +1 -1
- package/.output/public/_nuxt/{PqWbiAD2.js → BhSWIRpp.js} +1 -1
- package/.output/public/_nuxt/{DqsUSndS.js → BjFs8Ujb.js} +1 -1
- package/.output/public/_nuxt/{DauLdT7p.js → BmTCDcNm.js} +1 -1
- package/.output/public/_nuxt/{DAIbdyS6.js → Bn8loaeQ.js} +1 -1
- package/.output/public/_nuxt/{BGtUoCgi.js → BoPAYize.js} +1 -1
- package/.output/public/_nuxt/{BtVIBBUN.js → BrICHPil.js} +1 -1
- package/.output/public/_nuxt/{gGlaVUMD.js → Brqrl-cH.js} +1 -1
- package/.output/public/_nuxt/{9QKmiSP_.js → BsPj3ifk.js} +1 -1
- package/.output/public/_nuxt/{DAvlXjt0.js → BsXPllgv.js} +1 -1
- package/.output/public/_nuxt/{DEATxnaF.js → BvuV9uCn.js} +1 -1
- package/.output/public/_nuxt/{DaH2FbAy.js → By6kmkhJ.js} +1 -1
- package/.output/public/_nuxt/{Cwtd8e-P.js → ByfSJZV6.js} +1 -1
- package/.output/public/_nuxt/{D1r0uqf3.js → C14DGwaT.js} +1 -1
- package/.output/public/_nuxt/{DmAM6bZ0.js → C4XVJnNJ.js} +1 -1
- package/.output/public/_nuxt/{BIvPdoE3.js → C5nfaH9w.js} +1 -1
- package/.output/public/_nuxt/{fEUQvmn8.js → C6Kc4XvS.js} +1 -1
- package/.output/public/_nuxt/{BrEXdify.js → CB8_A8N4.js} +1 -1
- package/.output/public/_nuxt/{D1DYuOOm.js → CBrXB4hk.js} +1 -1
- package/.output/public/_nuxt/{Bwcpy7gC.js → CEfkp9Rl.js} +2 -2
- package/.output/public/_nuxt/{D5EZbuub.js → CG0fS-BQ.js} +1 -1
- package/.output/public/_nuxt/{BlPToGni.js → CJ85o8FK.js} +1 -1
- package/.output/public/_nuxt/{-AsXrBBy.js → CK5Ef4YR.js} +1 -1
- package/.output/public/_nuxt/{cL7whuPe.js → CLZS246x.js} +1 -1
- package/.output/public/_nuxt/{BnmwiZbF.js → CNwGp6eP.js} +1 -1
- package/.output/public/_nuxt/{Bw5h4Jaf.js → CSQ-nblB.js} +1 -1
- package/.output/public/_nuxt/{DQvuQpwh.js → CVr40yKH.js} +1 -1
- package/.output/public/_nuxt/{B-2BuR5g.js → CW8xtqwN.js} +1 -1
- package/.output/public/_nuxt/{CQpYRq61.js → CXuKrnTA.js} +1 -1
- package/.output/public/_nuxt/{DWhzQg7B.js → CeDxLTxX.js} +1 -1
- package/.output/public/_nuxt/{Bl6LNGlA.js → Cebw7Q7c.js} +1 -1
- package/.output/public/_nuxt/{DmmTnMzZ.js → Cedv1M65.js} +1 -1
- package/.output/public/_nuxt/{B6fnZcA6.js → CfWDee_q.js} +1 -1
- package/.output/public/_nuxt/{CHpwuMSk.js → CgQKyBSS.js} +1 -1
- package/.output/public/_nuxt/{C2RZSTuy.js → Ci-MVdCd.js} +1 -1
- package/.output/public/_nuxt/{DBKzwexZ.js → CjRmY2OQ.js} +1 -1
- package/.output/public/_nuxt/{Tu4FhMRc.js → CjYUi9c8.js} +1 -1
- package/.output/public/_nuxt/{xKRwul0f.js → CkvyAKbu.js} +1 -1
- package/.output/public/_nuxt/{wPSLEMBw.js → CnW8zyuA.js} +1 -1
- package/.output/public/_nuxt/{UO2Y9Nve.js → Cow1TrPj.js} +1 -1
- package/.output/public/_nuxt/{C4zyxZG7.js → CpC3C9gj.js} +1 -1
- package/.output/public/_nuxt/{D0P9llU7.js → CphXSvBo.js} +1 -1
- package/.output/public/_nuxt/{mQkFCz_M.js → CqiOV9n1.js} +1 -1
- package/.output/public/_nuxt/{BIMBp1Tj.js → CrjKigv8.js} +1 -1
- package/.output/public/_nuxt/{p9l1LjVc.js → CvMqUdkl.js} +3 -3
- package/.output/public/_nuxt/{DmeAKr3J.js → CwCEQ4Dw.js} +1 -1
- package/.output/public/_nuxt/{BbRPwpIX.js → CwJR22-0.js} +1 -1
- package/.output/public/_nuxt/{BtNnS4m3.js → CwaMSU1O.js} +1 -1
- package/.output/public/_nuxt/{D_vK6VPK.js → CxJr4mB0.js} +1 -1
- package/.output/public/_nuxt/{ARbTpeGy.js → CzTTKfet.js} +1 -1
- package/.output/public/_nuxt/{DaJo0CeV.js → CzqLfT8k.js} +1 -1
- package/.output/public/_nuxt/{5UFq_rDn.js → D-wVwRIx.js} +1 -1
- package/.output/public/_nuxt/D2f7BlK2.js +1 -0
- package/.output/public/_nuxt/D2lmhTjQ.js +1 -0
- package/.output/public/_nuxt/{B4u7Mczo.js → D3V98LVR.js} +1 -1
- package/.output/public/_nuxt/D64-rCSQ.js +1 -0
- package/.output/public/_nuxt/{CGQDTeaO.js → DAFasgHH.js} +1 -1
- package/.output/public/_nuxt/{BlwHr46F.js → DAs574wU.js} +1 -1
- package/.output/public/_nuxt/{BQnublTW.js → DB3y_21M.js} +1 -1
- package/.output/public/_nuxt/{C3sh_tLi.js → DCco_rlV.js} +1 -1
- package/.output/public/_nuxt/{90UksHlj.js → DGP2JJt8.js} +1 -1
- package/.output/public/_nuxt/{HOeKUnra.js → DImdNj-F.js} +1 -1
- package/.output/public/_nuxt/{CzIMQevQ.js → DMsHLHmB.js} +1 -1
- package/.output/public/_nuxt/{ct6_k5IW.js → DNpsjOxN.js} +1 -1
- package/.output/public/_nuxt/{UKPXYG4z.js → DV0JMebZ.js} +1 -1
- package/.output/public/_nuxt/{CLzcRUcs.js → DZ_azKLI.js} +1 -1
- package/.output/public/_nuxt/{BBiRyPlN.js → DZdh7_lh.js} +1 -1
- package/.output/public/_nuxt/{MpTk6K7N.js → DaiWSWdm.js} +1 -1
- package/.output/public/_nuxt/{BOgdaA_8.js → Db5XIfWS.js} +1 -1
- package/.output/public/_nuxt/{ClXDAYjE.js → DfpSaqgV.js} +1 -1
- package/.output/public/_nuxt/{D3a8R1T6.js → DgKeJf5C.js} +1 -1
- package/.output/public/_nuxt/{BWqJFnZy.js → DgPiIWA2.js} +1 -1
- package/.output/public/_nuxt/{BKaRtCjP.js → Dkzqkzki.js} +1 -1
- package/.output/public/_nuxt/DpYns7cT.js +1 -0
- package/.output/public/_nuxt/{5Zh-9l8_.js → Dpp5cOwJ.js} +1 -1
- package/.output/public/_nuxt/{DiGBA-aA.js → Drr-RSSP.js} +1 -1
- package/.output/public/_nuxt/{CUN4bYcg.js → DsKy-gee.js} +1 -1
- package/.output/public/_nuxt/{BqtxLJaf.js → DuOsLoVR.js} +1 -1
- package/.output/public/_nuxt/{IR1jkN7B.js → DvgLoqaC.js} +1 -1
- package/.output/public/_nuxt/{2W1RPpXM.js → Dx2Tgm6S.js} +1 -1
- package/.output/public/_nuxt/{D1dDc8Vw.js → DxR8g9So.js} +1 -1
- package/.output/public/_nuxt/Dysa6np_.js +1 -0
- package/.output/public/_nuxt/{gjmGkVlL.js → DytaiikM.js} +1 -1
- package/.output/public/_nuxt/{Cx44SSNp.js → EgYyfo1g.js} +3 -3
- package/.output/public/_nuxt/{NZ7Wz6LP.js → HC3657Xq.js} +1 -1
- package/.output/public/_nuxt/{CZ32KfaS.js → HCCuOAgZ.js} +1 -1
- package/.output/public/_nuxt/{BVypxKRT.js → JJIcQEna.js} +1 -1
- package/.output/public/_nuxt/{FNhYm5FX.js → MdebRWqA.js} +1 -1
- package/.output/public/_nuxt/{CxEVzuCn.js → MzEmU9ER.js} +1 -1
- package/.output/public/_nuxt/{C0TUK31m.js → NBE83ZQn.js} +1 -1
- package/.output/public/_nuxt/{ZR87XvwB.js → NlScC3GW.js} +1 -1
- package/.output/public/_nuxt/{xgpiGSxb.js → RRoc4m9d.js} +1 -1
- package/.output/public/_nuxt/{BXxYdXMr.js → S4a_N6rD.js} +1 -1
- package/.output/public/_nuxt/{DAE2hbP7.js → WWNeb45u.js} +1 -1
- package/.output/public/_nuxt/{DiJxF69i.js → XzRnkkwG.js} +1 -1
- package/.output/public/_nuxt/{DdPA4eTX.js → Zjvb5YJR.js} +1 -1
- package/.output/public/_nuxt/{uc4c4mfb.js → _16_b82K.js} +1 -1
- package/.output/public/_nuxt/{CXoITXft.js → atVSHCxP.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/92941c1a-266b-42f8-9e67-ac947a462d37.json +1 -0
- package/.output/public/_nuxt/{Dz6sfh81.js → deSeNTOh.js} +1 -1
- package/.output/public/_nuxt/f7zDjk6q.js +1 -0
- package/.output/public/_nuxt/{CdpT_Vb6.js → fTEmwfo4.js} +1 -1
- package/.output/public/_nuxt/{CkqNv7sq.js → hqpqUuXS.js} +1 -1
- package/.output/public/_nuxt/{DPFugPaB.js → jeu3Xx8e.js} +1 -1
- package/.output/public/_nuxt/{ApfLnl06.js → pkbwpgSD.js} +1 -1
- package/.output/public/_nuxt/{t_9QQ4MF.js → qW7F87d8.js} +3 -3
- package/.output/public/_nuxt/{C5I-XBZT.js → sdvIKLwS.js} +1 -1
- package/.output/public/_nuxt/{B7uMSBlN.js → vM-wdhkZ.js} +1 -1
- package/.output/public/_nuxt/{DNE7kw9s.js → w3t8WD8v.js} +1 -1
- package/.output/public/_nuxt/{C1T4GK6c.js → zBoPDS4z.js} +1 -1
- package/.output/server/chunks/build/A-BWukSPjS.mjs +4 -1
- package/.output/server/chunks/build/Accordion-BaJYea6e.mjs +4 -1
- package/.output/server/chunks/build/AccordionItem-DdG2zgcN.mjs +4 -1
- package/.output/server/chunks/build/Badge-BrU9UkCv.mjs +4 -1
- package/.output/server/chunks/build/Blockquote-DND8wTkU.mjs +4 -1
- package/.output/server/chunks/build/Callout-1halpaEg.mjs +4 -1
- package/.output/server/chunks/build/Card-BHCSDKDt.mjs +4 -1
- package/.output/server/chunks/build/CardGroup-BOuJcNGp.mjs +4 -1
- package/.output/server/chunks/build/Caution-BP3y-TcC.mjs +4 -1
- package/.output/server/chunks/build/Code-B1xkAS5a.mjs +4 -1
- package/.output/server/chunks/build/CodeCollapse-BIhaNa22.mjs +4 -1
- package/.output/server/chunks/build/CodeGroup-BviYyCuo.mjs +4 -1
- package/.output/server/chunks/build/CodeIcon-CWD5HcV7.mjs +5 -2
- package/.output/server/chunks/build/CodePreview-D8PsCQ6m.mjs +4 -1
- package/.output/server/chunks/build/CodeTree-BUTLupmL.mjs +4 -1
- package/.output/server/chunks/build/Collapsible-BIvXNaSq.mjs +4 -1
- package/.output/server/chunks/build/DropdownMenu-BBrV9nXz.mjs +1 -1
- package/.output/server/chunks/build/EditorToolbar-DIfb5arC.mjs +1 -1
- package/.output/server/chunks/build/Em-DsIz_BnD.mjs +4 -1
- package/.output/server/chunks/build/Field-cwwmSQDT.mjs +4 -1
- package/.output/server/chunks/build/FieldGroup-CAIpQv8s.mjs +4 -1
- package/.output/server/chunks/build/H1-BbFNsPyP.mjs +4 -1
- package/.output/server/chunks/build/H2-vHTl_pWr.mjs +4 -1
- package/.output/server/chunks/build/H3-7eTcfO3s.mjs +4 -1
- package/.output/server/chunks/build/H4-C89p_PKO.mjs +4 -1
- package/.output/server/chunks/build/Hr-Bm8RlL3O.mjs +4 -1
- package/.output/server/chunks/build/Icon-Dp9iy0BI.mjs +4 -1
- package/.output/server/chunks/build/Img-CWLmvN1t.mjs +5 -2
- package/.output/server/chunks/build/Kbd-CQG6I_Ch.mjs +4 -1
- package/.output/server/chunks/build/Li-Bw1QUaGv.mjs +4 -1
- package/.output/server/chunks/build/MDC-Dx0YPDhe.mjs +1 -1
- package/.output/server/chunks/build/Note-CHkjm9jm.mjs +4 -1
- package/.output/server/chunks/build/Ol-D-fPnfFM.mjs +4 -1
- package/.output/server/chunks/build/P-B5YI1V9y.mjs +4 -1
- package/.output/server/chunks/build/Pre-ChiJcf3C.mjs +4 -1
- package/.output/server/chunks/build/ProseH5-DahJyv8h.mjs +4 -1
- package/.output/server/chunks/build/ProseH6-C4Is5h6c.mjs +4 -1
- package/.output/server/chunks/build/Select-BB1oLrCD.mjs +1 -1
- package/.output/server/chunks/build/SelectMenu-DPssg6zD.mjs +1 -1
- package/.output/server/chunks/build/Steps-BZpvXfzb.mjs +4 -1
- package/.output/server/chunks/build/Strong-DXJqOWL3.mjs +4 -1
- package/.output/server/chunks/build/Table-BSrLZ7dt.mjs +4 -1
- package/.output/server/chunks/build/Table-DCwTlhCj.mjs +1 -1
- package/.output/server/chunks/build/Tabs-Dk3nvOFF.mjs +4 -1
- package/.output/server/chunks/build/TabsItem-CDhyuBtJ.mjs +4 -1
- package/.output/server/chunks/build/Tbody-CjMT5oH-.mjs +4 -1
- package/.output/server/chunks/build/Td-ZBVaEjFN.mjs +4 -1
- package/.output/server/chunks/build/Th-D317icbd.mjs +4 -1
- package/.output/server/chunks/build/Thead-Ca_ZESTK.mjs +4 -1
- package/.output/server/chunks/build/Tip-CP3oTARR.mjs +4 -1
- package/.output/server/chunks/build/Tooltip-TRyl6dje.mjs +1 -1
- package/.output/server/chunks/build/Tr-6jI8j9gD.mjs +4 -1
- package/.output/server/chunks/build/Tree-DUhXKd8y.mjs +1 -1
- package/.output/server/chunks/build/Ul-BUGj_CPb.mjs +4 -1
- package/.output/server/chunks/build/Warning-BJ8G6cxC.mjs +4 -1
- package/.output/server/chunks/build/_id_-DN00UDdO.mjs +4 -1
- package/.output/server/chunks/build/_id_-DN00UDdO.mjs.map +1 -1
- package/.output/server/chunks/build/_name_-BnS_KEfX.mjs +4 -1
- package/.output/server/chunks/build/_name_-BnS_KEfX.mjs.map +1 -1
- package/.output/server/chunks/build/_uuid_-DfJaumTE.mjs +5 -2
- package/.output/server/chunks/build/auth-CvD7MqKW.mjs +4 -1
- package/.output/server/chunks/build/auth-CvD7MqKW.mjs.map +1 -1
- package/.output/server/chunks/build/chat-CZMiB68R.mjs +4 -1
- package/.output/server/chunks/build/chat-CZMiB68R.mjs.map +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/cookie-C_iulBi6.mjs +1 -1
- package/.output/server/chunks/build/dashboard-CLk1NlbR.mjs +4 -1
- package/.output/server/chunks/build/dashboard-CLk1NlbR.mjs.map +1 -1
- package/.output/server/chunks/build/dashboard-CiVTAZuF.mjs +5 -2
- package/.output/server/chunks/build/docs-ChGwOPg5.mjs +5 -2
- package/.output/server/chunks/build/error-404-BzbcNcdU.mjs +4 -1
- package/.output/server/chunks/build/error-500-uCDjGRW8.mjs +4 -1
- package/.output/server/chunks/build/fetch-BB7Qzkwe.mjs +1 -1
- package/.output/server/chunks/build/hooks-D328DcO6.mjs +4 -1
- package/.output/server/chunks/build/hooks-D328DcO6.mjs.map +1 -1
- package/.output/server/chunks/build/index-Byt-3Yq6.mjs +4 -1
- package/.output/server/chunks/build/index-C9PuieXh.mjs +4 -1
- package/.output/server/chunks/build/index-C9PuieXh.mjs.map +1 -1
- package/.output/server/chunks/build/{index-C_LcBBgO.mjs → index-CAnGTRlu.mjs} +281 -14
- package/.output/server/chunks/build/{index-C_LcBBgO.mjs.map → index-CAnGTRlu.mjs.map} +1 -1
- package/.output/server/chunks/build/index-CxDxc9fm.mjs +1 -1
- package/.output/server/chunks/build/index-DzdvIi8V.mjs +4 -1
- package/.output/server/chunks/build/{library-CbWcF5wT.mjs → library-Aeg7_Lsb.mjs} +8 -3
- package/.output/server/chunks/build/library-Aeg7_Lsb.mjs.map +1 -0
- package/.output/server/chunks/build/login-DnnElTl2.mjs +4 -1
- package/.output/server/chunks/build/memories-BqA719O1.mjs +4 -1
- package/.output/server/chunks/build/memories-BqA719O1.mjs.map +1 -1
- package/.output/server/chunks/build/server.mjs +8 -5
- package/.output/server/chunks/build/{settings-DdkKCJ00.mjs → settings-DuT6LGJZ.mjs} +524 -12
- package/.output/server/chunks/build/settings-DuT6LGJZ.mjs.map +1 -0
- package/.output/server/chunks/build/tasks-DnAFqbtt.mjs +4 -1
- package/.output/server/chunks/build/tasks-DnAFqbtt.mjs.map +1 -1
- package/.output/server/chunks/build/usage-CSrBh4Or.mjs +4 -1
- package/.output/server/chunks/build/useNotificationBus-BG5JNQf1.mjs +1 -1
- package/.output/server/chunks/build/view-n2sYa4Zh.mjs +5 -2
- package/.output/server/chunks/build/virtual_nuxt__Users_tony_Documents_GitHub_second-brain_node_modules_.cache_nuxt_.nuxt_mdc-imports-PtwWlZ2H.mjs +4 -1
- package/.output/server/chunks/nitro/nitro.mjs +2091 -1081
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/_ws/chat.mjs +4 -1
- package/.output/server/chunks/routes/_ws/chat.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id/cancel.post.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id/cancel.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id/run.post.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id/run.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id/runs.get.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id/runs.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id/stats.get.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id/stats.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id_.delete.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id_.get.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id_.patch.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/stats.get.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/stats.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/auth/_...all_.mjs +4 -1
- package/.output/server/chunks/routes/api/auth/_...all_.mjs.map +1 -1
- package/.output/server/chunks/routes/api/bridges/_id/health.get.mjs +98 -0
- package/.output/server/chunks/routes/api/bridges/_id/health.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/bridges/_id_.delete.mjs +68 -0
- package/.output/server/chunks/routes/api/bridges/_id_.delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/bridges/_id_.get.mjs +60 -0
- package/.output/server/chunks/routes/api/bridges/_id_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/bridges/_id_.put.mjs +79 -0
- package/.output/server/chunks/routes/api/bridges/_id_.put.mjs.map +1 -0
- package/.output/server/chunks/routes/api/bridges/context.get.mjs +183 -0
- package/.output/server/chunks/routes/api/bridges/context.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/conversations/_id_.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/conversations/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations/_id_.get.mjs +5 -2
- package/.output/server/chunks/routes/api/conversations/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/dashboard/overview.get.mjs +5 -2
- package/.output/server/chunks/routes/api/dashboard/overview.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/_id/public.get.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/_id/public.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/_id/restore.post.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/_id/restore.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/by-path.post.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/by-path.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/index.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/index.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/index.put.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/delete.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/list.get.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/list.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/mkdir.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/mkdir.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/move.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/move.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/read.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/read.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/rename.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/rename.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/write.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/write.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +5 -2
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/home.get.mjs +5 -2
- package/.output/server/chunks/routes/api/home.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/hooks/index.get.mjs +5 -2
- package/.output/server/chunks/routes/api/hooks/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/hooks/index.post.mjs +5 -2
- package/.output/server/chunks/routes/api/hooks/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/hooks/stats.get.mjs +5 -2
- package/.output/server/chunks/routes/api/hooks/stats.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +4 -1
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get10.mjs +86 -0
- package/.output/server/chunks/routes/api/index.get10.mjs.map +1 -0
- package/.output/server/chunks/routes/api/index.get2.mjs +11 -5
- package/.output/server/chunks/routes/api/index.get2.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get3.mjs +8 -34
- package/.output/server/chunks/routes/api/index.get3.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get4.mjs +35 -5
- package/.output/server/chunks/routes/api/index.get4.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get5.mjs +12 -15
- package/.output/server/chunks/routes/api/index.get5.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get6.mjs +17 -22
- package/.output/server/chunks/routes/api/index.get6.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get7.mjs +28 -40
- package/.output/server/chunks/routes/api/index.get7.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get8.mjs +56 -38
- package/.output/server/chunks/routes/api/index.get8.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get9.mjs +36 -39
- package/.output/server/chunks/routes/api/index.get9.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +4 -1
- package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post2.mjs +26 -17
- package/.output/server/chunks/routes/api/index.post2.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post3.mjs +21 -35
- package/.output/server/chunks/routes/api/index.post3.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post4.mjs +35 -25
- package/.output/server/chunks/routes/api/index.post4.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post5.mjs +75 -0
- package/.output/server/chunks/routes/api/index.post5.mjs.map +1 -0
- package/.output/server/chunks/routes/api/index.put.mjs +5 -2
- package/.output/server/chunks/routes/api/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/_id_.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/context.get.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/context.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/extract.post.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/extract.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/search.get.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/search.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/store.post.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/store.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/projects/index.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/projects/index.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/projects/index.get.mjs +5 -2
- package/.output/server/chunks/routes/api/projects/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/projects/index.put.mjs +5 -2
- package/.output/server/chunks/routes/api/projects/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/secrets/_key_.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/secrets/_key_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/secrets/_key_.get.mjs +5 -2
- package/.output/server/chunks/routes/api/secrets/_key_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/secrets/_key_.put.mjs +5 -2
- package/.output/server/chunks/routes/api/secrets/_key_.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/delete.post.mjs +69 -0
- package/.output/server/chunks/routes/api/skills/_name/delete.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/skills/_name/export.get.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/export.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/files/create.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/files/create.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/files/delete.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/files/delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/files/read.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/files/read.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/files/write.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/files/write.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/index.get.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/rename.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/rename.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/toggle.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/toggle.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/create.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/create.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/generate.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/generate.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/import.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/import.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/index.get.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/index.get2.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/index.get2.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/library/check-updates.get.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/library/check-updates.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/library/install.post.mjs +9 -4
- package/.output/server/chunks/routes/api/skills/library/install.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/_id/restore.post.mjs +5 -2
- package/.output/server/chunks/routes/api/tasks/_id/restore.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/index.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/tasks/index.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/index.get.mjs +4 -1
- package/.output/server/chunks/routes/api/tasks/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/index.put.mjs +5 -2
- package/.output/server/chunks/routes/api/tasks/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/tags.get.mjs +5 -2
- package/.output/server/chunks/routes/api/tasks/tags.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/usage/stats.get.mjs +5 -2
- package/.output/server/chunks/routes/api/usage/stats.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/user/email.patch.mjs +5 -2
- package/.output/server/chunks/routes/api/user/email.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/webhooks/bluebubbles.post.mjs +56 -0
- package/.output/server/chunks/routes/api/webhooks/bluebubbles.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/webhooks/telegram.post.mjs +60 -0
- package/.output/server/chunks/routes/api/webhooks/telegram.post.mjs.map +1 -0
- package/.output/server/chunks/routes/notifications.mjs +5 -2
- package/.output/server/chunks/routes/notifications.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/chunks/routes/terminal.mjs +5 -2
- package/.output/server/chunks/routes/terminal.mjs.map +1 -1
- package/.output/server/index.mjs +5 -2
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/.nitro/@discordjs/collection@1.5.3/dist/index.js +543 -0
- package/.output/server/node_modules/.nitro/@discordjs/collection@1.5.3/package.json +76 -0
- package/.output/server/node_modules/.nitro/@discordjs/collection@2.1.1/dist/index.js +567 -0
- package/.output/server/node_modules/.nitro/@discordjs/collection@2.1.1/package.json +86 -0
- package/.output/server/node_modules/@discordjs/builders/dist/index.js +4229 -0
- package/.output/server/node_modules/@discordjs/builders/package.json +99 -0
- package/.output/server/node_modules/@discordjs/formatters/dist/index.js +519 -0
- package/.output/server/node_modules/@discordjs/formatters/package.json +83 -0
- package/.output/server/node_modules/@discordjs/rest/dist/index.js +1515 -0
- package/.output/server/node_modules/@discordjs/rest/package.json +119 -0
- package/.output/server/node_modules/@discordjs/util/dist/index.js +159 -0
- package/.output/server/node_modules/@discordjs/util/package.json +94 -0
- package/.output/server/node_modules/@discordjs/ws/dist/defaultWorker.js +1057 -0
- package/.output/server/node_modules/@discordjs/ws/dist/index.js +1506 -0
- package/.output/server/node_modules/@discordjs/ws/package.json +113 -0
- package/.output/server/node_modules/@sapphire/async-queue/dist/cjs/index.cjs +137 -0
- package/.output/server/node_modules/@sapphire/async-queue/package.json +74 -0
- package/.output/server/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs +3210 -0
- package/.output/server/node_modules/@sapphire/shapeshift/package.json +125 -0
- package/.output/server/node_modules/@sapphire/snowflake/dist/cjs/index.cjs +194 -0
- package/.output/server/node_modules/@sapphire/snowflake/package.json +72 -0
- package/.output/server/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs +2825 -0
- package/.output/server/node_modules/@vladfrangu/async_event_emitter/package.json +112 -0
- package/.output/server/node_modules/discord-api-types/gateway/v10.js +277 -0
- package/.output/server/node_modules/discord-api-types/globals.js +105 -0
- package/.output/server/node_modules/discord-api-types/package.json +215 -0
- package/.output/server/node_modules/discord-api-types/payloads/common.js +310 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/shared.js +21 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/chatInput.js +18 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/permissions.js +21 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/applicationCommands.js +89 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/responses.js +63 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/application.js +138 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/auditLog.js +85 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/autoModeration.js +88 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/channel.js +219 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/gateway.js +103 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/guild.js +403 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/guildScheduledEvent.js +74 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/index.js +37 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/interactions.js +19 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/invite.js +31 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/message.js +379 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/monetization.js +101 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/oauth2.js +148 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/permissions.js +17 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/poll.js +17 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/stageInstance.js +21 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/sticker.js +31 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/teams.js +24 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/user.js +189 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/webhook.js +73 -0
- package/.output/server/node_modules/discord-api-types/rest/common.js +273 -0
- package/.output/server/node_modules/discord-api-types/rest/v10/channel.js +12 -0
- package/.output/server/node_modules/discord-api-types/rest/v10/index.js +1272 -0
- package/.output/server/node_modules/discord-api-types/rest/v10/monetization.js +12 -0
- package/.output/server/node_modules/discord-api-types/rpc/common.js +240 -0
- package/.output/server/node_modules/discord-api-types/rpc/v10.js +299 -0
- package/.output/server/node_modules/discord-api-types/utils/internals.js +13 -0
- package/.output/server/node_modules/discord-api-types/utils/v10.js +158 -0
- package/.output/server/node_modules/discord-api-types/v10.js +25 -0
- package/.output/server/node_modules/discord.js/package.json +107 -0
- package/.output/server/node_modules/discord.js/src/client/BaseClient.js +120 -0
- package/.output/server/node_modules/discord.js/src/client/Client.js +649 -0
- package/.output/server/node_modules/discord.js/src/client/WebhookClient.js +103 -0
- package/.output/server/node_modules/discord.js/src/client/actions/Action.js +143 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ActionsManager.js +85 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ApplicationCommandPermissionsUpdate.js +34 -0
- package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationActionExecution.js +26 -0
- package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleCreate.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleDelete.js +31 -0
- package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleUpdate.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ChannelCreate.js +23 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ChannelDelete.js +23 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ChannelUpdate.js +42 -0
- package/.output/server/node_modules/discord.js/src/client/actions/EntitlementCreate.js +23 -0
- package/.output/server/node_modules/discord.js/src/client/actions/EntitlementDelete.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/actions/EntitlementUpdate.js +25 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildAuditLogEntryCreate.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildBanAdd.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildBanRemove.js +25 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildChannelsPositionUpdate.js +21 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildDelete.js +44 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiCreate.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiDelete.js +19 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiUpdate.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojisUpdate.js +34 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildIntegrationsUpdate.js +19 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildMemberRemove.js +31 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildMemberUpdate.js +44 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleCreate.js +25 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleDelete.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleUpdate.js +39 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js +21 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventCreate.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventDelete.js +31 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUpdate.js +30 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUserAdd.js +32 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUserRemove.js +32 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildSoundboardSoundDelete.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerCreate.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerDelete.js +19 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerUpdate.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildStickersUpdate.js +34 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildUpdate.js +33 -0
- package/.output/server/node_modules/discord.js/src/client/actions/InteractionCreate.js +105 -0
- package/.output/server/node_modules/discord.js/src/client/actions/InviteCreate.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/actions/InviteDelete.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageCreate.js +41 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageDelete.js +32 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageDeleteBulk.js +47 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessagePollVoteAdd.js +40 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessagePollVoteRemove.js +38 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionAdd.js +70 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemove.js +50 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemoveAll.js +33 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemoveEmoji.js +28 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageUpdate.js +26 -0
- package/.output/server/node_modules/discord.js/src/client/actions/PresenceUpdate.js +45 -0
- package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceCreate.js +28 -0
- package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceDelete.js +31 -0
- package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceUpdate.js +30 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadCreate.js +24 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadDelete.js +26 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadListSync.js +60 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadMemberUpdate.js +30 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js +47 -0
- package/.output/server/node_modules/discord.js/src/client/actions/TypingStart.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/UserUpdate.js +36 -0
- package/.output/server/node_modules/discord.js/src/client/actions/VoiceStateUpdate.js +43 -0
- package/.output/server/node_modules/discord.js/src/client/actions/WebhooksUpdate.js +37 -0
- package/.output/server/node_modules/discord.js/src/client/voice/ClientVoiceManager.js +44 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/WebSocketManager.js +407 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/WebSocketShard.js +234 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js +22 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_UPDATE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_ADD.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js +33 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js +39 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUNDS_UPDATE.js +24 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_CREATE.js +18 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_UPDATE.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INVITE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INVITE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/PRESENCE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/RATE_LIMITED.js +25 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/READY.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/RESUMED.js +14 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SOUNDBOARD_SOUNDS.js +24 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_CREATE.js +14 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_DELETE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_LIST_SYNC.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_UPDATE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/TYPING_START.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/USER_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js +6 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_STATE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/WEBHOOKS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/index.js +79 -0
- package/.output/server/node_modules/discord.js/src/errors/DJSError.js +48 -0
- package/.output/server/node_modules/discord.js/src/errors/ErrorCodes.js +356 -0
- package/.output/server/node_modules/discord.js/src/errors/Messages.js +187 -0
- package/.output/server/node_modules/discord.js/src/errors/index.js +5 -0
- package/.output/server/node_modules/discord.js/src/index.js +254 -0
- package/.output/server/node_modules/discord.js/src/managers/ApplicationCommandManager.js +269 -0
- package/.output/server/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js +428 -0
- package/.output/server/node_modules/discord.js/src/managers/ApplicationEmojiManager.js +142 -0
- package/.output/server/node_modules/discord.js/src/managers/AutoModerationRuleManager.js +292 -0
- package/.output/server/node_modules/discord.js/src/managers/BaseGuildEmojiManager.js +85 -0
- package/.output/server/node_modules/discord.js/src/managers/BaseManager.js +19 -0
- package/.output/server/node_modules/discord.js/src/managers/CachedManager.js +64 -0
- package/.output/server/node_modules/discord.js/src/managers/CategoryChannelChildManager.js +79 -0
- package/.output/server/node_modules/discord.js/src/managers/ChannelManager.js +135 -0
- package/.output/server/node_modules/discord.js/src/managers/DMMessageManager.js +17 -0
- package/.output/server/node_modules/discord.js/src/managers/DataManager.js +61 -0
- package/.output/server/node_modules/discord.js/src/managers/EntitlementManager.js +174 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildApplicationCommandManager.js +28 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildBanManager.js +249 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildChannelManager.js +519 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildEmojiManager.js +174 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildEmojiRoleManager.js +126 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildForumThreadManager.js +83 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildInviteManager.js +215 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildManager.js +408 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildMemberManager.js +638 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildMemberRoleManager.js +217 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildMessageManager.js +17 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildScheduledEventManager.js +315 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildSoundboardSoundManager.js +214 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildStickerManager.js +182 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildTextThreadManager.js +91 -0
- package/.output/server/node_modules/discord.js/src/managers/MessageManager.js +368 -0
- package/.output/server/node_modules/discord.js/src/managers/PartialGroupDMMessageManager.js +17 -0
- package/.output/server/node_modules/discord.js/src/managers/PermissionOverwriteManager.js +166 -0
- package/.output/server/node_modules/discord.js/src/managers/PollAnswerVoterManager.js +50 -0
- package/.output/server/node_modules/discord.js/src/managers/PresenceManager.js +58 -0
- package/.output/server/node_modules/discord.js/src/managers/ReactionManager.js +68 -0
- package/.output/server/node_modules/discord.js/src/managers/ReactionUserManager.js +78 -0
- package/.output/server/node_modules/discord.js/src/managers/RoleManager.js +444 -0
- package/.output/server/node_modules/discord.js/src/managers/StageInstanceManager.js +159 -0
- package/.output/server/node_modules/discord.js/src/managers/SubscriptionManager.js +81 -0
- package/.output/server/node_modules/discord.js/src/managers/ThreadManager.js +193 -0
- package/.output/server/node_modules/discord.js/src/managers/ThreadMemberManager.js +204 -0
- package/.output/server/node_modules/discord.js/src/managers/UserManager.js +146 -0
- package/.output/server/node_modules/discord.js/src/managers/VoiceStateManager.js +59 -0
- package/.output/server/node_modules/discord.js/src/sharding/Shard.js +482 -0
- package/.output/server/node_modules/discord.js/src/sharding/ShardClientUtil.js +292 -0
- package/.output/server/node_modules/discord.js/src/sharding/ShardingManager.js +331 -0
- package/.output/server/node_modules/discord.js/src/structures/ActionRow.js +46 -0
- package/.output/server/node_modules/discord.js/src/structures/ActionRowBuilder.js +35 -0
- package/.output/server/node_modules/discord.js/src/structures/AnonymousGuild.js +97 -0
- package/.output/server/node_modules/discord.js/src/structures/ApplicationCommand.js +639 -0
- package/.output/server/node_modules/discord.js/src/structures/ApplicationEmoji.js +169 -0
- package/.output/server/node_modules/discord.js/src/structures/ApplicationRoleConnectionMetadata.js +46 -0
- package/.output/server/node_modules/discord.js/src/structures/Attachment.js +163 -0
- package/.output/server/node_modules/discord.js/src/structures/AttachmentBuilder.js +111 -0
- package/.output/server/node_modules/discord.js/src/structures/AutoModerationActionExecution.js +116 -0
- package/.output/server/node_modules/discord.js/src/structures/AutoModerationRule.js +288 -0
- package/.output/server/node_modules/discord.js/src/structures/AutocompleteInteraction.js +102 -0
- package/.output/server/node_modules/discord.js/src/structures/Base.js +43 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseChannel.js +171 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseGuild.js +119 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseGuildEmoji.js +111 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseGuildTextChannel.js +196 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseGuildVoiceChannel.js +234 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseInteraction.js +349 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseSelectMenuComponent.js +56 -0
- package/.output/server/node_modules/discord.js/src/structures/ButtonBuilder.js +44 -0
- package/.output/server/node_modules/discord.js/src/structures/ButtonComponent.js +65 -0
- package/.output/server/node_modules/discord.js/src/structures/ButtonInteraction.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/CategoryChannel.js +45 -0
- package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuBuilder.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuComponent.js +20 -0
- package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuInteraction.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/ChatInputCommandInteraction.js +42 -0
- package/.output/server/node_modules/discord.js/src/structures/ClientApplication.js +415 -0
- package/.output/server/node_modules/discord.js/src/structures/ClientPresence.js +84 -0
- package/.output/server/node_modules/discord.js/src/structures/ClientUser.js +204 -0
- package/.output/server/node_modules/discord.js/src/structures/CommandInteraction.js +168 -0
- package/.output/server/node_modules/discord.js/src/structures/CommandInteractionOptionResolver.js +308 -0
- package/.output/server/node_modules/discord.js/src/structures/Component.js +56 -0
- package/.output/server/node_modules/discord.js/src/structures/ContainerComponent.js +60 -0
- package/.output/server/node_modules/discord.js/src/structures/ContextMenuCommandInteraction.js +65 -0
- package/.output/server/node_modules/discord.js/src/structures/DMChannel.js +129 -0
- package/.output/server/node_modules/discord.js/src/structures/DirectoryChannel.js +36 -0
- package/.output/server/node_modules/discord.js/src/structures/Embed.js +237 -0
- package/.output/server/node_modules/discord.js/src/structures/EmbedBuilder.js +50 -0
- package/.output/server/node_modules/discord.js/src/structures/Emoji.js +115 -0
- package/.output/server/node_modules/discord.js/src/structures/Entitlement.js +179 -0
- package/.output/server/node_modules/discord.js/src/structures/FileComponent.js +40 -0
- package/.output/server/node_modules/discord.js/src/structures/ForumChannel.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/Guild.js +1496 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildAuditLogs.js +91 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildAuditLogsEntry.js +527 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildBan.js +59 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildChannel.js +476 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildEmoji.js +148 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildMember.js +591 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildOnboarding.js +64 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildOnboardingPrompt.js +78 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildOnboardingPromptOption.js +86 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildPreview.js +193 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildPreviewEmoji.js +27 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildScheduledEvent.js +534 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildTemplate.js +242 -0
- package/.output/server/node_modules/discord.js/src/structures/Integration.js +220 -0
- package/.output/server/node_modules/discord.js/src/structures/IntegrationApplication.js +85 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionCallback.js +74 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionCallbackResource.js +52 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionCallbackResponse.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionCollector.js +269 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionResponse.js +102 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionWebhook.js +59 -0
- package/.output/server/node_modules/discord.js/src/structures/Invite.js +341 -0
- package/.output/server/node_modules/discord.js/src/structures/InviteGuild.js +22 -0
- package/.output/server/node_modules/discord.js/src/structures/InviteStageInstance.js +87 -0
- package/.output/server/node_modules/discord.js/src/structures/LabelComponent.js +54 -0
- package/.output/server/node_modules/discord.js/src/structures/MediaChannel.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/MediaGalleryComponent.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/MediaGalleryItem.js +51 -0
- package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuBuilder.js +32 -0
- package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuComponent.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuInteraction.js +71 -0
- package/.output/server/node_modules/discord.js/src/structures/Message.js +1137 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageCollector.js +146 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageComponentInteraction.js +108 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageContextMenuCommandInteraction.js +20 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageMentions.js +297 -0
- package/.output/server/node_modules/discord.js/src/structures/MessagePayload.js +344 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageReaction.js +200 -0
- package/.output/server/node_modules/discord.js/src/structures/ModalBuilder.js +36 -0
- package/.output/server/node_modules/discord.js/src/structures/ModalSubmitFields.js +232 -0
- package/.output/server/node_modules/discord.js/src/structures/ModalSubmitInteraction.js +256 -0
- package/.output/server/node_modules/discord.js/src/structures/NewsChannel.js +32 -0
- package/.output/server/node_modules/discord.js/src/structures/OAuth2Guild.js +28 -0
- package/.output/server/node_modules/discord.js/src/structures/PartialGroupDMChannel.js +131 -0
- package/.output/server/node_modules/discord.js/src/structures/PermissionOverwrites.js +199 -0
- package/.output/server/node_modules/discord.js/src/structures/Poll.js +175 -0
- package/.output/server/node_modules/discord.js/src/structures/PollAnswer.js +114 -0
- package/.output/server/node_modules/discord.js/src/structures/Presence.js +385 -0
- package/.output/server/node_modules/discord.js/src/structures/PrimaryEntryPointCommandInteraction.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/ReactionCollector.js +229 -0
- package/.output/server/node_modules/discord.js/src/structures/ReactionEmoji.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/Role.js +519 -0
- package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuBuilder.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuComponent.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuInteraction.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/SKU.js +52 -0
- package/.output/server/node_modules/discord.js/src/structures/SectionComponent.js +42 -0
- package/.output/server/node_modules/discord.js/src/structures/SelectMenuBuilder.js +26 -0
- package/.output/server/node_modules/discord.js/src/structures/SelectMenuComponent.js +26 -0
- package/.output/server/node_modules/discord.js/src/structures/SelectMenuInteraction.js +26 -0
- package/.output/server/node_modules/discord.js/src/structures/SelectMenuOptionBuilder.js +26 -0
- package/.output/server/node_modules/discord.js/src/structures/SeparatorComponent.js +30 -0
- package/.output/server/node_modules/discord.js/src/structures/SoundboardSound.js +204 -0
- package/.output/server/node_modules/discord.js/src/structures/StageChannel.js +112 -0
- package/.output/server/node_modules/discord.js/src/structures/StageInstance.js +167 -0
- package/.output/server/node_modules/discord.js/src/structures/Sticker.js +268 -0
- package/.output/server/node_modules/discord.js/src/structures/StickerPack.js +95 -0
- package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuBuilder.js +79 -0
- package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuComponent.js +20 -0
- package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuInteraction.js +21 -0
- package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuOptionBuilder.js +49 -0
- package/.output/server/node_modules/discord.js/src/structures/Subscription.js +117 -0
- package/.output/server/node_modules/discord.js/src/structures/Team.js +117 -0
- package/.output/server/node_modules/discord.js/src/structures/TeamMember.js +79 -0
- package/.output/server/node_modules/discord.js/src/structures/TextChannel.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/TextDisplayComponent.js +20 -0
- package/.output/server/node_modules/discord.js/src/structures/TextInputBuilder.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/TextInputComponent.js +29 -0
- package/.output/server/node_modules/discord.js/src/structures/ThreadChannel.js +612 -0
- package/.output/server/node_modules/discord.js/src/structures/ThreadMember.js +119 -0
- package/.output/server/node_modules/discord.js/src/structures/ThreadOnlyChannel.js +249 -0
- package/.output/server/node_modules/discord.js/src/structures/ThumbnailComponent.js +49 -0
- package/.output/server/node_modules/discord.js/src/structures/Typing.js +74 -0
- package/.output/server/node_modules/discord.js/src/structures/UnfurledMediaItem.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/User.js +505 -0
- package/.output/server/node_modules/discord.js/src/structures/UserContextMenuCommandInteraction.js +29 -0
- package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuBuilder.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuComponent.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuInteraction.js +51 -0
- package/.output/server/node_modules/discord.js/src/structures/VoiceChannel.js +116 -0
- package/.output/server/node_modules/discord.js/src/structures/VoiceChannelEffect.js +78 -0
- package/.output/server/node_modules/discord.js/src/structures/VoiceRegion.js +46 -0
- package/.output/server/node_modules/discord.js/src/structures/VoiceState.js +312 -0
- package/.output/server/node_modules/discord.js/src/structures/Webhook.js +489 -0
- package/.output/server/node_modules/discord.js/src/structures/WelcomeChannel.js +60 -0
- package/.output/server/node_modules/discord.js/src/structures/WelcomeScreen.js +49 -0
- package/.output/server/node_modules/discord.js/src/structures/Widget.js +97 -0
- package/.output/server/node_modules/discord.js/src/structures/WidgetMember.js +99 -0
- package/.output/server/node_modules/discord.js/src/structures/interfaces/Application.js +158 -0
- package/.output/server/node_modules/discord.js/src/structures/interfaces/Collector.js +335 -0
- package/.output/server/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js +494 -0
- package/.output/server/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js +447 -0
- package/.output/server/node_modules/discord.js/src/util/ActivityFlagsBitField.js +26 -0
- package/.output/server/node_modules/discord.js/src/util/ApplicationFlagsBitField.js +41 -0
- package/.output/server/node_modules/discord.js/src/util/AttachmentFlagsBitField.js +26 -0
- package/.output/server/node_modules/discord.js/src/util/BitField.js +178 -0
- package/.output/server/node_modules/discord.js/src/util/ChannelFlagsBitField.js +41 -0
- package/.output/server/node_modules/discord.js/src/util/Channels.js +161 -0
- package/.output/server/node_modules/discord.js/src/util/Colors.js +73 -0
- package/.output/server/node_modules/discord.js/src/util/Components.js +311 -0
- package/.output/server/node_modules/discord.js/src/util/Constants.js +283 -0
- package/.output/server/node_modules/discord.js/src/util/DataResolver.js +142 -0
- package/.output/server/node_modules/discord.js/src/util/Enums.js +13 -0
- package/.output/server/node_modules/discord.js/src/util/Events.js +190 -0
- package/.output/server/node_modules/discord.js/src/util/Formatters.js +413 -0
- package/.output/server/node_modules/discord.js/src/util/GuildMemberFlagsBitField.js +42 -0
- package/.output/server/node_modules/discord.js/src/util/IntentsBitField.js +34 -0
- package/.output/server/node_modules/discord.js/src/util/InviteFlagsBitField.js +28 -0
- package/.output/server/node_modules/discord.js/src/util/LimitedCollection.js +68 -0
- package/.output/server/node_modules/discord.js/src/util/MessageFlagsBitField.js +41 -0
- package/.output/server/node_modules/discord.js/src/util/Options.js +239 -0
- package/.output/server/node_modules/discord.js/src/util/Partials.js +50 -0
- package/.output/server/node_modules/discord.js/src/util/PermissionsBitField.js +104 -0
- package/.output/server/node_modules/discord.js/src/util/RoleFlagsBitField.js +26 -0
- package/.output/server/node_modules/discord.js/src/util/SKUFlagsBitField.js +26 -0
- package/.output/server/node_modules/discord.js/src/util/ShardEvents.js +29 -0
- package/.output/server/node_modules/discord.js/src/util/Status.js +33 -0
- package/.output/server/node_modules/discord.js/src/util/Sweepers.js +487 -0
- package/.output/server/node_modules/discord.js/src/util/Symbols.js +3 -0
- package/.output/server/node_modules/discord.js/src/util/SystemChannelFlagsBitField.js +43 -0
- package/.output/server/node_modules/discord.js/src/util/ThreadMemberFlagsBitField.js +32 -0
- package/.output/server/node_modules/discord.js/src/util/Transformers.js +125 -0
- package/.output/server/node_modules/discord.js/src/util/UserFlagsBitField.js +32 -0
- package/.output/server/node_modules/discord.js/src/util/Util.js +558 -0
- package/.output/server/node_modules/discord.js/src/util/WebSocketShardEvents.js +25 -0
- package/.output/server/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/.output/server/node_modules/fast-deep-equal/index.js +46 -0
- package/.output/server/node_modules/fast-deep-equal/package.json +61 -0
- package/.output/server/node_modules/lodash/_Hash.js +32 -0
- package/.output/server/node_modules/lodash/_ListCache.js +32 -0
- package/.output/server/node_modules/lodash/_Map.js +7 -0
- package/.output/server/node_modules/lodash/_MapCache.js +32 -0
- package/.output/server/node_modules/lodash/_Set.js +7 -0
- package/.output/server/node_modules/lodash/_SetCache.js +27 -0
- package/.output/server/node_modules/lodash/_Symbol.js +6 -0
- package/.output/server/node_modules/lodash/_arrayIncludes.js +17 -0
- package/.output/server/node_modules/lodash/_arrayIncludesWith.js +22 -0
- package/.output/server/node_modules/lodash/_arrayMap.js +21 -0
- package/.output/server/node_modules/lodash/_assocIndexOf.js +21 -0
- package/.output/server/node_modules/lodash/_baseFindIndex.js +24 -0
- package/.output/server/node_modules/lodash/_baseGet.js +24 -0
- package/.output/server/node_modules/lodash/_baseGetTag.js +28 -0
- package/.output/server/node_modules/lodash/_baseIndexOf.js +20 -0
- package/.output/server/node_modules/lodash/_baseIsNaN.js +12 -0
- package/.output/server/node_modules/lodash/_baseIsNative.js +47 -0
- package/.output/server/node_modules/lodash/_baseToString.js +37 -0
- package/.output/server/node_modules/lodash/_baseUniq.js +72 -0
- package/.output/server/node_modules/lodash/_cacheHas.js +13 -0
- package/.output/server/node_modules/lodash/_castPath.js +21 -0
- package/.output/server/node_modules/lodash/_coreJsData.js +6 -0
- package/.output/server/node_modules/lodash/_createSet.js +19 -0
- package/.output/server/node_modules/lodash/_freeGlobal.js +4 -0
- package/.output/server/node_modules/lodash/_getMapData.js +18 -0
- package/.output/server/node_modules/lodash/_getNative.js +17 -0
- package/.output/server/node_modules/lodash/_getRawTag.js +46 -0
- package/.output/server/node_modules/lodash/_getValue.js +13 -0
- package/.output/server/node_modules/lodash/_hashClear.js +15 -0
- package/.output/server/node_modules/lodash/_hashDelete.js +17 -0
- package/.output/server/node_modules/lodash/_hashGet.js +30 -0
- package/.output/server/node_modules/lodash/_hashHas.js +23 -0
- package/.output/server/node_modules/lodash/_hashSet.js +23 -0
- package/.output/server/node_modules/lodash/_isKey.js +29 -0
- package/.output/server/node_modules/lodash/_isKeyable.js +15 -0
- package/.output/server/node_modules/lodash/_isMasked.js +20 -0
- package/.output/server/node_modules/lodash/_listCacheClear.js +13 -0
- package/.output/server/node_modules/lodash/_listCacheDelete.js +35 -0
- package/.output/server/node_modules/lodash/_listCacheGet.js +19 -0
- package/.output/server/node_modules/lodash/_listCacheHas.js +16 -0
- package/.output/server/node_modules/lodash/_listCacheSet.js +26 -0
- package/.output/server/node_modules/lodash/_mapCacheClear.js +21 -0
- package/.output/server/node_modules/lodash/_mapCacheDelete.js +18 -0
- package/.output/server/node_modules/lodash/_mapCacheGet.js +16 -0
- package/.output/server/node_modules/lodash/_mapCacheHas.js +16 -0
- package/.output/server/node_modules/lodash/_mapCacheSet.js +22 -0
- package/.output/server/node_modules/lodash/_memoizeCapped.js +26 -0
- package/.output/server/node_modules/lodash/_nativeCreate.js +6 -0
- package/.output/server/node_modules/lodash/_objectToString.js +22 -0
- package/.output/server/node_modules/lodash/_root.js +9 -0
- package/.output/server/node_modules/lodash/_setCacheAdd.js +19 -0
- package/.output/server/node_modules/lodash/_setCacheHas.js +14 -0
- package/.output/server/node_modules/lodash/_setToArray.js +18 -0
- package/.output/server/node_modules/lodash/_strictIndexOf.js +23 -0
- package/.output/server/node_modules/lodash/_stringToPath.js +27 -0
- package/.output/server/node_modules/lodash/_toKey.js +21 -0
- package/.output/server/node_modules/lodash/_toSource.js +26 -0
- package/.output/server/node_modules/lodash/eq.js +37 -0
- package/.output/server/node_modules/lodash/get.js +33 -0
- package/.output/server/node_modules/lodash/isArray.js +26 -0
- package/.output/server/node_modules/lodash/isFunction.js +37 -0
- package/.output/server/node_modules/lodash/isObject.js +31 -0
- package/.output/server/node_modules/lodash/isObjectLike.js +29 -0
- package/.output/server/node_modules/lodash/isSymbol.js +29 -0
- package/.output/server/node_modules/lodash/memoize.js +73 -0
- package/.output/server/node_modules/lodash/noop.js +17 -0
- package/.output/server/node_modules/lodash/package.json +19 -0
- package/.output/server/node_modules/lodash/toString.js +28 -0
- package/.output/server/node_modules/lodash/uniqWith.js +28 -0
- package/.output/server/node_modules/lodash.snakecase/index.js +435 -0
- package/.output/server/node_modules/lodash.snakecase/package.json +19 -0
- package/.output/server/node_modules/magic-bytes.js/dist/index.js +61 -0
- package/.output/server/node_modules/magic-bytes.js/dist/model/pattern-tree.js +1176 -0
- package/.output/server/node_modules/magic-bytes.js/dist/model/toHex.js +8 -0
- package/.output/server/node_modules/magic-bytes.js/dist/model/tree.js +61 -0
- package/.output/server/node_modules/magic-bytes.js/package.json +77 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/decorator.js +109 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/index.js +12 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/mixin-tracking.js +42 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/mixins.js +82 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/proxy.js +82 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/settings.js +9 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/util.js +85 -0
- package/.output/server/node_modules/ts-mixer/package.json +63 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/node_modules/undici/index.js +169 -0
- package/.output/server/node_modules/undici/lib/api/abort-signal.js +57 -0
- package/.output/server/node_modules/undici/lib/api/api-connect.js +108 -0
- package/.output/server/node_modules/undici/lib/api/api-pipeline.js +251 -0
- package/.output/server/node_modules/undici/lib/api/api-request.js +214 -0
- package/.output/server/node_modules/undici/lib/api/api-stream.js +220 -0
- package/.output/server/node_modules/undici/lib/api/api-upgrade.js +108 -0
- package/.output/server/node_modules/undici/lib/api/index.js +7 -0
- package/.output/server/node_modules/undici/lib/api/readable.js +385 -0
- package/.output/server/node_modules/undici/lib/api/util.js +93 -0
- package/.output/server/node_modules/undici/lib/core/connect.js +240 -0
- package/.output/server/node_modules/undici/lib/core/constants.js +118 -0
- package/.output/server/node_modules/undici/lib/core/diagnostics.js +202 -0
- package/.output/server/node_modules/undici/lib/core/errors.js +244 -0
- package/.output/server/node_modules/undici/lib/core/request.js +395 -0
- package/.output/server/node_modules/undici/lib/core/symbols.js +67 -0
- package/.output/server/node_modules/undici/lib/core/tree.js +152 -0
- package/.output/server/node_modules/undici/lib/core/util.js +719 -0
- package/.output/server/node_modules/undici/lib/dispatcher/agent.js +129 -0
- package/.output/server/node_modules/undici/lib/dispatcher/balanced-pool.js +209 -0
- package/.output/server/node_modules/undici/lib/dispatcher/client-h1.js +1370 -0
- package/.output/server/node_modules/undici/lib/dispatcher/client-h2.js +744 -0
- package/.output/server/node_modules/undici/lib/dispatcher/client.js +622 -0
- package/.output/server/node_modules/undici/lib/dispatcher/dispatcher-base.js +190 -0
- package/.output/server/node_modules/undici/lib/dispatcher/dispatcher.js +65 -0
- package/.output/server/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +160 -0
- package/.output/server/node_modules/undici/lib/dispatcher/fixed-queue.js +117 -0
- package/.output/server/node_modules/undici/lib/dispatcher/pool-base.js +194 -0
- package/.output/server/node_modules/undici/lib/dispatcher/pool-stats.js +34 -0
- package/.output/server/node_modules/undici/lib/dispatcher/pool.js +107 -0
- package/.output/server/node_modules/undici/lib/dispatcher/proxy-agent.js +192 -0
- package/.output/server/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
- package/.output/server/node_modules/undici/lib/global.js +32 -0
- package/.output/server/node_modules/undici/lib/handler/decorator-handler.js +44 -0
- package/.output/server/node_modules/undici/lib/handler/redirect-handler.js +232 -0
- package/.output/server/node_modules/undici/lib/handler/retry-handler.js +374 -0
- package/.output/server/node_modules/undici/lib/interceptor/dns.js +375 -0
- package/.output/server/node_modules/undici/lib/interceptor/dump.js +123 -0
- package/.output/server/node_modules/undici/lib/interceptor/redirect-interceptor.js +21 -0
- package/.output/server/node_modules/undici/lib/interceptor/redirect.js +24 -0
- package/.output/server/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/.output/server/node_modules/undici/lib/llhttp/constants.js +278 -0
- package/.output/server/node_modules/undici/lib/llhttp/llhttp-wasm.js +5 -0
- package/.output/server/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +5 -0
- package/.output/server/node_modules/undici/lib/llhttp/utils.js +15 -0
- package/.output/server/node_modules/undici/lib/mock/mock-agent.js +160 -0
- package/.output/server/node_modules/undici/lib/mock/mock-client.js +59 -0
- package/.output/server/node_modules/undici/lib/mock/mock-errors.js +17 -0
- package/.output/server/node_modules/undici/lib/mock/mock-interceptor.js +207 -0
- package/.output/server/node_modules/undici/lib/mock/mock-pool.js +59 -0
- package/.output/server/node_modules/undici/lib/mock/mock-symbols.js +23 -0
- package/.output/server/node_modules/undici/lib/mock/mock-utils.js +367 -0
- package/.output/server/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/.output/server/node_modules/undici/lib/mock/pluralizer.js +29 -0
- package/.output/server/node_modules/undici/lib/util/timers.js +423 -0
- package/.output/server/node_modules/undici/lib/web/cache/cache.js +859 -0
- package/.output/server/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
- package/.output/server/node_modules/undici/lib/web/cache/symbols.js +5 -0
- package/.output/server/node_modules/undici/lib/web/cache/util.js +45 -0
- package/.output/server/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/.output/server/node_modules/undici/lib/web/cookies/index.js +184 -0
- package/.output/server/node_modules/undici/lib/web/cookies/parse.js +317 -0
- package/.output/server/node_modules/undici/lib/web/cookies/util.js +282 -0
- package/.output/server/node_modules/undici/lib/web/eventsource/eventsource-stream.js +398 -0
- package/.output/server/node_modules/undici/lib/web/eventsource/eventsource.js +480 -0
- package/.output/server/node_modules/undici/lib/web/eventsource/util.js +37 -0
- package/.output/server/node_modules/undici/lib/web/fetch/body.js +533 -0
- package/.output/server/node_modules/undici/lib/web/fetch/constants.js +124 -0
- package/.output/server/node_modules/undici/lib/web/fetch/data-url.js +744 -0
- package/.output/server/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +46 -0
- package/.output/server/node_modules/undici/lib/web/fetch/file.js +126 -0
- package/.output/server/node_modules/undici/lib/web/fetch/formdata-parser.js +474 -0
- package/.output/server/node_modules/undici/lib/web/fetch/formdata.js +252 -0
- package/.output/server/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/.output/server/node_modules/undici/lib/web/fetch/headers.js +687 -0
- package/.output/server/node_modules/undici/lib/web/fetch/index.js +2266 -0
- package/.output/server/node_modules/undici/lib/web/fetch/request.js +1037 -0
- package/.output/server/node_modules/undici/lib/web/fetch/response.js +605 -0
- package/.output/server/node_modules/undici/lib/web/fetch/symbols.js +9 -0
- package/.output/server/node_modules/undici/lib/web/fetch/util.js +1632 -0
- package/.output/server/node_modules/undici/lib/web/fetch/webidl.js +695 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/encoding.js +290 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/filereader.js +344 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/progressevent.js +78 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/symbols.js +10 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/util.js +391 -0
- package/.output/server/node_modules/undici/lib/web/websocket/connection.js +371 -0
- package/.output/server/node_modules/undici/lib/web/websocket/constants.js +66 -0
- package/.output/server/node_modules/undici/lib/web/websocket/events.js +329 -0
- package/.output/server/node_modules/undici/lib/web/websocket/frame.js +96 -0
- package/.output/server/node_modules/undici/lib/web/websocket/permessage-deflate.js +70 -0
- package/.output/server/node_modules/undici/lib/web/websocket/receiver.js +424 -0
- package/.output/server/node_modules/undici/lib/web/websocket/sender.js +104 -0
- package/.output/server/node_modules/undici/lib/web/websocket/symbols.js +12 -0
- package/.output/server/node_modules/undici/lib/web/websocket/util.js +314 -0
- package/.output/server/node_modules/undici/lib/web/websocket/websocket.js +588 -0
- package/.output/server/node_modules/undici/package.json +160 -0
- package/.output/server/node_modules/ws/index.js +13 -0
- package/.output/server/node_modules/ws/lib/buffer-util.js +131 -0
- package/.output/server/node_modules/ws/lib/constants.js +18 -0
- package/.output/server/node_modules/ws/lib/event-target.js +292 -0
- package/.output/server/node_modules/ws/lib/extension.js +203 -0
- package/.output/server/node_modules/ws/lib/limiter.js +55 -0
- package/.output/server/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/.output/server/node_modules/ws/lib/receiver.js +706 -0
- package/.output/server/node_modules/ws/lib/sender.js +602 -0
- package/.output/server/node_modules/ws/lib/stream.js +161 -0
- package/.output/server/node_modules/ws/lib/subprotocol.js +62 -0
- package/.output/server/node_modules/ws/lib/validation.js +152 -0
- package/.output/server/node_modules/ws/lib/websocket-server.js +550 -0
- package/.output/server/node_modules/ws/lib/websocket.js +1388 -0
- package/.output/server/node_modules/ws/package.json +69 -0
- package/.output/server/package.json +21 -1
- package/Claude/hooks/lib/hook_client.py +38 -0
- package/Claude/hooks/session-start.py +8 -1
- package/Claude/skills/bridge/SKILL.md +125 -0
- package/Claude/skills/bridge/bridge.py +234 -0
- package/README.md +1 -1
- package/app/components/skills/Card.vue +18 -0
- package/app/pages/settings.vue +279 -3
- package/app/pages/skills/index.vue +106 -0
- package/app/pages/skills/library.vue +20 -1
- package/package.json +4 -5
- package/server/api/bridges/[id]/health.get.ts +78 -0
- package/server/api/bridges/[id].delete.ts +41 -0
- package/server/api/bridges/[id].get.ts +25 -0
- package/server/api/bridges/[id].put.ts +54 -0
- package/server/api/bridges/context.get.ts +168 -0
- package/server/api/bridges/index.get.ts +15 -0
- package/server/api/bridges/index.post.ts +39 -0
- package/server/api/skills/[name]/delete.post.ts +38 -0
- package/server/api/skills/index.get.ts +24 -0
- package/server/api/skills/library/install.post.ts +7 -3
- package/server/api/webhooks/bluebubbles.post.ts +23 -0
- package/server/api/webhooks/telegram.post.ts +34 -0
- package/server/bridge/adapters/discord.ts +180 -0
- package/server/bridge/adapters/email.ts +50 -0
- package/server/bridge/adapters/google.ts +215 -0
- package/server/bridge/adapters/imessage.ts +352 -0
- package/server/bridge/adapters/telegram.ts +294 -0
- package/server/bridge/lifecycle.ts +124 -0
- package/server/bridge/registry.ts +50 -0
- package/server/bridge/router.ts +126 -0
- package/server/bridge/types.ts +87 -0
- package/server/db/schema.ts +53 -0
- package/server/drizzle/migrations/0014_worthless_cable.sql +36 -0
- package/server/drizzle/migrations/meta/0014_snapshot.json +1959 -0
- package/server/drizzle/migrations/meta/_journal.json +7 -0
- package/server/plugins/06.message-bridge.ts +42 -0
- package/server/utils/get-secret.ts +18 -0
- package/server/utils/notify-resource.ts +2 -1
- package/shared/types/index.ts +113 -0
- package/shared/utils/notification-defaults.ts +2 -1
- package/.output/public/_nuxt/BMdnU6BF.js +0 -1
- package/.output/public/_nuxt/BSsvedap.js +0 -1
- package/.output/public/_nuxt/C2ANDZen.js +0 -1
- package/.output/public/_nuxt/CC77iplr.js +0 -1
- package/.output/public/_nuxt/DM4MyqI-.js +0 -1
- package/.output/public/_nuxt/DO0oG4fG.js +0 -1
- package/.output/public/_nuxt/DRlG_bnX.js +0 -1
- package/.output/public/_nuxt/YGWAImQo.js +0 -1
- package/.output/public/_nuxt/builds/meta/91727fcc-bf7f-407f-9b1e-092017fcfee0.json +0 -1
- package/.output/server/chunks/build/library-CbWcF5wT.mjs.map +0 -1
- package/.output/server/chunks/build/settings-DdkKCJ00.mjs.map +0 -1
- package/Claude/CLAUDE.md +0 -129
|
@@ -0,0 +1,4229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
32
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
33
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
34
|
+
if (decorator = decorators[i])
|
|
35
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
36
|
+
if (kind && result) __defProp(target, key, result);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/index.ts
|
|
41
|
+
var index_exports = {};
|
|
42
|
+
__export(index_exports, {
|
|
43
|
+
ActionRowBuilder: () => ActionRowBuilder,
|
|
44
|
+
ApplicationCommandNumericOptionMinMaxValueMixin: () => ApplicationCommandNumericOptionMinMaxValueMixin,
|
|
45
|
+
ApplicationCommandOptionBase: () => ApplicationCommandOptionBase,
|
|
46
|
+
ApplicationCommandOptionChannelTypesMixin: () => ApplicationCommandOptionChannelTypesMixin,
|
|
47
|
+
ApplicationCommandOptionWithAutocompleteMixin: () => ApplicationCommandOptionWithAutocompleteMixin,
|
|
48
|
+
ApplicationCommandOptionWithChoicesMixin: () => ApplicationCommandOptionWithChoicesMixin,
|
|
49
|
+
BaseSelectMenuBuilder: () => BaseSelectMenuBuilder,
|
|
50
|
+
ButtonBuilder: () => ButtonBuilder,
|
|
51
|
+
ChannelSelectMenuBuilder: () => ChannelSelectMenuBuilder,
|
|
52
|
+
ComponentAssertions: () => Assertions_exports2,
|
|
53
|
+
ComponentBuilder: () => ComponentBuilder,
|
|
54
|
+
ComponentsV2Assertions: () => Assertions_exports7,
|
|
55
|
+
ContainerBuilder: () => ContainerBuilder,
|
|
56
|
+
ContextMenuCommandAssertions: () => Assertions_exports10,
|
|
57
|
+
ContextMenuCommandBuilder: () => ContextMenuCommandBuilder,
|
|
58
|
+
EmbedAssertions: () => Assertions_exports,
|
|
59
|
+
EmbedBuilder: () => EmbedBuilder,
|
|
60
|
+
FileBuilder: () => FileBuilder,
|
|
61
|
+
FileUploadAssertions: () => Assertions_exports3,
|
|
62
|
+
FileUploadBuilder: () => FileUploadBuilder,
|
|
63
|
+
LabelAssertions: () => Assertions_exports6,
|
|
64
|
+
LabelBuilder: () => LabelBuilder,
|
|
65
|
+
MediaGalleryBuilder: () => MediaGalleryBuilder,
|
|
66
|
+
MediaGalleryItemBuilder: () => MediaGalleryItemBuilder,
|
|
67
|
+
MentionableSelectMenuBuilder: () => MentionableSelectMenuBuilder,
|
|
68
|
+
ModalAssertions: () => Assertions_exports8,
|
|
69
|
+
ModalBuilder: () => ModalBuilder,
|
|
70
|
+
RoleSelectMenuBuilder: () => RoleSelectMenuBuilder,
|
|
71
|
+
SectionBuilder: () => SectionBuilder,
|
|
72
|
+
SelectMenuAssertions: () => Assertions_exports5,
|
|
73
|
+
SelectMenuBuilder: () => StringSelectMenuBuilder,
|
|
74
|
+
SelectMenuOptionBuilder: () => StringSelectMenuOptionBuilder,
|
|
75
|
+
SeparatorBuilder: () => SeparatorBuilder,
|
|
76
|
+
SharedNameAndDescription: () => SharedNameAndDescription,
|
|
77
|
+
SharedSlashCommand: () => SharedSlashCommand,
|
|
78
|
+
SharedSlashCommandOptions: () => SharedSlashCommandOptions,
|
|
79
|
+
SharedSlashCommandSubcommands: () => SharedSlashCommandSubcommands,
|
|
80
|
+
SlashCommandAssertions: () => Assertions_exports9,
|
|
81
|
+
SlashCommandAttachmentOption: () => SlashCommandAttachmentOption,
|
|
82
|
+
SlashCommandBooleanOption: () => SlashCommandBooleanOption,
|
|
83
|
+
SlashCommandBuilder: () => SlashCommandBuilder,
|
|
84
|
+
SlashCommandChannelOption: () => SlashCommandChannelOption,
|
|
85
|
+
SlashCommandIntegerOption: () => SlashCommandIntegerOption,
|
|
86
|
+
SlashCommandMentionableOption: () => SlashCommandMentionableOption,
|
|
87
|
+
SlashCommandNumberOption: () => SlashCommandNumberOption,
|
|
88
|
+
SlashCommandRoleOption: () => SlashCommandRoleOption,
|
|
89
|
+
SlashCommandStringOption: () => SlashCommandStringOption,
|
|
90
|
+
SlashCommandSubcommandBuilder: () => SlashCommandSubcommandBuilder,
|
|
91
|
+
SlashCommandSubcommandGroupBuilder: () => SlashCommandSubcommandGroupBuilder,
|
|
92
|
+
SlashCommandUserOption: () => SlashCommandUserOption,
|
|
93
|
+
StringSelectMenuBuilder: () => StringSelectMenuBuilder,
|
|
94
|
+
StringSelectMenuOptionBuilder: () => StringSelectMenuOptionBuilder,
|
|
95
|
+
TextDisplayBuilder: () => TextDisplayBuilder,
|
|
96
|
+
TextInputAssertions: () => Assertions_exports4,
|
|
97
|
+
TextInputBuilder: () => TextInputBuilder,
|
|
98
|
+
ThumbnailBuilder: () => ThumbnailBuilder,
|
|
99
|
+
UserSelectMenuBuilder: () => UserSelectMenuBuilder,
|
|
100
|
+
createComponentBuilder: () => createComponentBuilder,
|
|
101
|
+
disableValidators: () => disableValidators,
|
|
102
|
+
embedLength: () => embedLength,
|
|
103
|
+
enableValidators: () => enableValidators,
|
|
104
|
+
isValidationEnabled: () => isValidationEnabled,
|
|
105
|
+
normalizeArray: () => normalizeArray,
|
|
106
|
+
resolveBuilder: () => resolveBuilder,
|
|
107
|
+
version: () => version
|
|
108
|
+
});
|
|
109
|
+
module.exports = __toCommonJS(index_exports);
|
|
110
|
+
|
|
111
|
+
// src/messages/embed/Assertions.ts
|
|
112
|
+
var Assertions_exports = {};
|
|
113
|
+
__export(Assertions_exports, {
|
|
114
|
+
RGBPredicate: () => RGBPredicate,
|
|
115
|
+
authorNamePredicate: () => authorNamePredicate,
|
|
116
|
+
colorPredicate: () => colorPredicate,
|
|
117
|
+
descriptionPredicate: () => descriptionPredicate,
|
|
118
|
+
embedAuthorPredicate: () => embedAuthorPredicate,
|
|
119
|
+
embedFieldPredicate: () => embedFieldPredicate,
|
|
120
|
+
embedFieldsArrayPredicate: () => embedFieldsArrayPredicate,
|
|
121
|
+
embedFooterPredicate: () => embedFooterPredicate,
|
|
122
|
+
fieldInlinePredicate: () => fieldInlinePredicate,
|
|
123
|
+
fieldLengthPredicate: () => fieldLengthPredicate,
|
|
124
|
+
fieldNamePredicate: () => fieldNamePredicate,
|
|
125
|
+
fieldValuePredicate: () => fieldValuePredicate,
|
|
126
|
+
footerTextPredicate: () => footerTextPredicate,
|
|
127
|
+
imageURLPredicate: () => imageURLPredicate,
|
|
128
|
+
timestampPredicate: () => timestampPredicate,
|
|
129
|
+
titlePredicate: () => titlePredicate,
|
|
130
|
+
urlPredicate: () => urlPredicate,
|
|
131
|
+
validateFieldLength: () => validateFieldLength
|
|
132
|
+
});
|
|
133
|
+
var import_shapeshift = require("@sapphire/shapeshift");
|
|
134
|
+
|
|
135
|
+
// src/util/validation.ts
|
|
136
|
+
var validate = true;
|
|
137
|
+
function enableValidators() {
|
|
138
|
+
return validate = true;
|
|
139
|
+
}
|
|
140
|
+
__name(enableValidators, "enableValidators");
|
|
141
|
+
function disableValidators() {
|
|
142
|
+
return validate = false;
|
|
143
|
+
}
|
|
144
|
+
__name(disableValidators, "disableValidators");
|
|
145
|
+
function isValidationEnabled() {
|
|
146
|
+
return validate;
|
|
147
|
+
}
|
|
148
|
+
__name(isValidationEnabled, "isValidationEnabled");
|
|
149
|
+
|
|
150
|
+
// src/messages/embed/Assertions.ts
|
|
151
|
+
var fieldNamePredicate = import_shapeshift.s.string().lengthLessThanOrEqual(256).setValidationEnabled(isValidationEnabled);
|
|
152
|
+
var fieldValuePredicate = import_shapeshift.s.string().lengthLessThanOrEqual(1024).setValidationEnabled(isValidationEnabled);
|
|
153
|
+
var fieldInlinePredicate = import_shapeshift.s.boolean().optional();
|
|
154
|
+
var embedFieldPredicate = import_shapeshift.s.object({
|
|
155
|
+
name: fieldNamePredicate,
|
|
156
|
+
value: fieldValuePredicate,
|
|
157
|
+
inline: fieldInlinePredicate
|
|
158
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
159
|
+
var embedFieldsArrayPredicate = embedFieldPredicate.array().setValidationEnabled(isValidationEnabled);
|
|
160
|
+
var fieldLengthPredicate = import_shapeshift.s.number().lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
|
|
161
|
+
function validateFieldLength(amountAdding, fields) {
|
|
162
|
+
fieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);
|
|
163
|
+
}
|
|
164
|
+
__name(validateFieldLength, "validateFieldLength");
|
|
165
|
+
var authorNamePredicate = fieldNamePredicate.lengthGreaterThanOrEqual(1).nullable().setValidationEnabled(isValidationEnabled);
|
|
166
|
+
var imageURLPredicate = import_shapeshift.s.string().url({
|
|
167
|
+
allowedProtocols: ["http:", "https:", "attachment:"]
|
|
168
|
+
}).nullish().setValidationEnabled(isValidationEnabled);
|
|
169
|
+
var urlPredicate = import_shapeshift.s.string().url({
|
|
170
|
+
allowedProtocols: ["http:", "https:"]
|
|
171
|
+
}).nullish().setValidationEnabled(isValidationEnabled);
|
|
172
|
+
var embedAuthorPredicate = import_shapeshift.s.object({
|
|
173
|
+
name: authorNamePredicate,
|
|
174
|
+
iconURL: imageURLPredicate,
|
|
175
|
+
url: urlPredicate
|
|
176
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
177
|
+
var RGBPredicate = import_shapeshift.s.number().int().greaterThanOrEqual(0).lessThanOrEqual(255).setValidationEnabled(isValidationEnabled);
|
|
178
|
+
var colorPredicate = import_shapeshift.s.number().int().greaterThanOrEqual(0).lessThanOrEqual(16777215).or(import_shapeshift.s.tuple([RGBPredicate, RGBPredicate, RGBPredicate])).nullable().setValidationEnabled(isValidationEnabled);
|
|
179
|
+
var descriptionPredicate = import_shapeshift.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(4096).nullable().setValidationEnabled(isValidationEnabled);
|
|
180
|
+
var footerTextPredicate = import_shapeshift.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(2048).nullable().setValidationEnabled(isValidationEnabled);
|
|
181
|
+
var embedFooterPredicate = import_shapeshift.s.object({
|
|
182
|
+
text: footerTextPredicate,
|
|
183
|
+
iconURL: imageURLPredicate
|
|
184
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
185
|
+
var timestampPredicate = import_shapeshift.s.union([import_shapeshift.s.number(), import_shapeshift.s.date()]).nullable().setValidationEnabled(isValidationEnabled);
|
|
186
|
+
var titlePredicate = fieldNamePredicate.lengthGreaterThanOrEqual(1).nullable().setValidationEnabled(isValidationEnabled);
|
|
187
|
+
|
|
188
|
+
// src/util/normalizeArray.ts
|
|
189
|
+
function normalizeArray(arr) {
|
|
190
|
+
if (Array.isArray(arr[0])) return [...arr[0]];
|
|
191
|
+
return arr;
|
|
192
|
+
}
|
|
193
|
+
__name(normalizeArray, "normalizeArray");
|
|
194
|
+
|
|
195
|
+
// src/messages/embed/Embed.ts
|
|
196
|
+
var EmbedBuilder = class {
|
|
197
|
+
static {
|
|
198
|
+
__name(this, "EmbedBuilder");
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* The API data associated with this embed.
|
|
202
|
+
*/
|
|
203
|
+
data;
|
|
204
|
+
/**
|
|
205
|
+
* Creates a new embed from API data.
|
|
206
|
+
*
|
|
207
|
+
* @param data - The API data to create this embed with
|
|
208
|
+
*/
|
|
209
|
+
constructor(data = {}) {
|
|
210
|
+
this.data = { ...data };
|
|
211
|
+
if (data.timestamp) this.data.timestamp = new Date(data.timestamp).toISOString();
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Appends fields to the embed.
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* This method accepts either an array of fields or a variable number of field parameters.
|
|
218
|
+
* The maximum amount of fields that can be added is 25.
|
|
219
|
+
* @example
|
|
220
|
+
* Using an array:
|
|
221
|
+
* ```ts
|
|
222
|
+
* const fields: APIEmbedField[] = ...;
|
|
223
|
+
* const embed = new EmbedBuilder()
|
|
224
|
+
* .addFields(fields);
|
|
225
|
+
* ```
|
|
226
|
+
* @example
|
|
227
|
+
* Using rest parameters (variadic):
|
|
228
|
+
* ```ts
|
|
229
|
+
* const embed = new EmbedBuilder()
|
|
230
|
+
* .addFields(
|
|
231
|
+
* { name: 'Field 1', value: 'Value 1' },
|
|
232
|
+
* { name: 'Field 2', value: 'Value 2' },
|
|
233
|
+
* );
|
|
234
|
+
* ```
|
|
235
|
+
* @param fields - The fields to add
|
|
236
|
+
*/
|
|
237
|
+
addFields(...fields) {
|
|
238
|
+
const normalizedFields = normalizeArray(fields);
|
|
239
|
+
validateFieldLength(normalizedFields.length, this.data.fields);
|
|
240
|
+
embedFieldsArrayPredicate.parse(normalizedFields);
|
|
241
|
+
if (this.data.fields) this.data.fields.push(...normalizedFields);
|
|
242
|
+
else this.data.fields = normalizedFields;
|
|
243
|
+
return this;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Removes, replaces, or inserts fields for this embed.
|
|
247
|
+
*
|
|
248
|
+
* @remarks
|
|
249
|
+
* This method behaves similarly
|
|
250
|
+
* to {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
|
|
251
|
+
* The maximum amount of fields that can be added is 25.
|
|
252
|
+
*
|
|
253
|
+
* It's useful for modifying and adjusting order of the already-existing fields of an embed.
|
|
254
|
+
* @example
|
|
255
|
+
* Remove the first field:
|
|
256
|
+
* ```ts
|
|
257
|
+
* embed.spliceFields(0, 1);
|
|
258
|
+
* ```
|
|
259
|
+
* @example
|
|
260
|
+
* Remove the first n fields:
|
|
261
|
+
* ```ts
|
|
262
|
+
* const n = 4;
|
|
263
|
+
* embed.spliceFields(0, n);
|
|
264
|
+
* ```
|
|
265
|
+
* @example
|
|
266
|
+
* Remove the last field:
|
|
267
|
+
* ```ts
|
|
268
|
+
* embed.spliceFields(-1, 1);
|
|
269
|
+
* ```
|
|
270
|
+
* @param index - The index to start at
|
|
271
|
+
* @param deleteCount - The number of fields to remove
|
|
272
|
+
* @param fields - The replacing field objects
|
|
273
|
+
*/
|
|
274
|
+
spliceFields(index, deleteCount, ...fields) {
|
|
275
|
+
validateFieldLength(fields.length - deleteCount, this.data.fields);
|
|
276
|
+
embedFieldsArrayPredicate.parse(fields);
|
|
277
|
+
if (this.data.fields) this.data.fields.splice(index, deleteCount, ...fields);
|
|
278
|
+
else this.data.fields = fields;
|
|
279
|
+
return this;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Sets the fields for this embed.
|
|
283
|
+
*
|
|
284
|
+
* @remarks
|
|
285
|
+
* This method is an alias for {@link EmbedBuilder.spliceFields}. More specifically,
|
|
286
|
+
* it splices the entire array of fields, replacing them with the provided fields.
|
|
287
|
+
*
|
|
288
|
+
* You can set a maximum of 25 fields.
|
|
289
|
+
* @param fields - The fields to set
|
|
290
|
+
*/
|
|
291
|
+
setFields(...fields) {
|
|
292
|
+
this.spliceFields(0, this.data.fields?.length ?? 0, ...normalizeArray(fields));
|
|
293
|
+
return this;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Sets the author of this embed.
|
|
297
|
+
*
|
|
298
|
+
* @param options - The options to use
|
|
299
|
+
*/
|
|
300
|
+
setAuthor(options) {
|
|
301
|
+
if (options === null) {
|
|
302
|
+
this.data.author = void 0;
|
|
303
|
+
return this;
|
|
304
|
+
}
|
|
305
|
+
embedAuthorPredicate.parse(options);
|
|
306
|
+
this.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };
|
|
307
|
+
return this;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Sets the color of this embed.
|
|
311
|
+
*
|
|
312
|
+
* @param color - The color to use
|
|
313
|
+
*/
|
|
314
|
+
setColor(color) {
|
|
315
|
+
colorPredicate.parse(color);
|
|
316
|
+
if (Array.isArray(color)) {
|
|
317
|
+
const [red, green, blue] = color;
|
|
318
|
+
this.data.color = (red << 16) + (green << 8) + blue;
|
|
319
|
+
return this;
|
|
320
|
+
}
|
|
321
|
+
this.data.color = color ?? void 0;
|
|
322
|
+
return this;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Sets the description of this embed.
|
|
326
|
+
*
|
|
327
|
+
* @param description - The description to use
|
|
328
|
+
*/
|
|
329
|
+
setDescription(description) {
|
|
330
|
+
descriptionPredicate.parse(description);
|
|
331
|
+
this.data.description = description ?? void 0;
|
|
332
|
+
return this;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Sets the footer of this embed.
|
|
336
|
+
*
|
|
337
|
+
* @param options - The footer to use
|
|
338
|
+
*/
|
|
339
|
+
setFooter(options) {
|
|
340
|
+
if (options === null) {
|
|
341
|
+
this.data.footer = void 0;
|
|
342
|
+
return this;
|
|
343
|
+
}
|
|
344
|
+
embedFooterPredicate.parse(options);
|
|
345
|
+
this.data.footer = { text: options.text, icon_url: options.iconURL };
|
|
346
|
+
return this;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Sets the image of this embed.
|
|
350
|
+
*
|
|
351
|
+
* @param url - The image URL to use
|
|
352
|
+
*/
|
|
353
|
+
setImage(url) {
|
|
354
|
+
imageURLPredicate.parse(url);
|
|
355
|
+
this.data.image = url ? { url } : void 0;
|
|
356
|
+
return this;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Sets the thumbnail of this embed.
|
|
360
|
+
*
|
|
361
|
+
* @param url - The thumbnail URL to use
|
|
362
|
+
*/
|
|
363
|
+
setThumbnail(url) {
|
|
364
|
+
imageURLPredicate.parse(url);
|
|
365
|
+
this.data.thumbnail = url ? { url } : void 0;
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Sets the timestamp of this embed.
|
|
370
|
+
*
|
|
371
|
+
* @param timestamp - The timestamp or date to use
|
|
372
|
+
*/
|
|
373
|
+
setTimestamp(timestamp = Date.now()) {
|
|
374
|
+
timestampPredicate.parse(timestamp);
|
|
375
|
+
this.data.timestamp = timestamp ? new Date(timestamp).toISOString() : void 0;
|
|
376
|
+
return this;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Sets the title for this embed.
|
|
380
|
+
*
|
|
381
|
+
* @param title - The title to use
|
|
382
|
+
*/
|
|
383
|
+
setTitle(title) {
|
|
384
|
+
titlePredicate.parse(title);
|
|
385
|
+
this.data.title = title ?? void 0;
|
|
386
|
+
return this;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Sets the URL of this embed.
|
|
390
|
+
*
|
|
391
|
+
* @param url - The URL to use
|
|
392
|
+
*/
|
|
393
|
+
setURL(url) {
|
|
394
|
+
urlPredicate.parse(url);
|
|
395
|
+
this.data.url = url ?? void 0;
|
|
396
|
+
return this;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Serializes this builder to API-compatible JSON data.
|
|
400
|
+
*
|
|
401
|
+
* @remarks
|
|
402
|
+
* This method runs validations on the data before serializing it.
|
|
403
|
+
* As such, it may throw an error if the data is invalid.
|
|
404
|
+
*/
|
|
405
|
+
toJSON() {
|
|
406
|
+
return { ...this.data };
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
// src/index.ts
|
|
411
|
+
__reExport(index_exports, require("@discordjs/formatters"), module.exports);
|
|
412
|
+
|
|
413
|
+
// src/components/Assertions.ts
|
|
414
|
+
var Assertions_exports2 = {};
|
|
415
|
+
__export(Assertions_exports2, {
|
|
416
|
+
buttonLabelValidator: () => buttonLabelValidator,
|
|
417
|
+
buttonStyleValidator: () => buttonStyleValidator,
|
|
418
|
+
channelTypesValidator: () => channelTypesValidator,
|
|
419
|
+
customIdValidator: () => customIdValidator,
|
|
420
|
+
defaultValidator: () => defaultValidator,
|
|
421
|
+
disabledValidator: () => disabledValidator,
|
|
422
|
+
emojiValidator: () => emojiValidator,
|
|
423
|
+
idValidator: () => idValidator,
|
|
424
|
+
jsonOptionValidator: () => jsonOptionValidator,
|
|
425
|
+
labelValueDescriptionValidator: () => labelValueDescriptionValidator,
|
|
426
|
+
minMaxValidator: () => minMaxValidator,
|
|
427
|
+
optionValidator: () => optionValidator,
|
|
428
|
+
optionsLengthValidator: () => optionsLengthValidator,
|
|
429
|
+
optionsValidator: () => optionsValidator,
|
|
430
|
+
placeholderValidator: () => placeholderValidator,
|
|
431
|
+
urlValidator: () => urlValidator,
|
|
432
|
+
validateRequiredButtonParameters: () => validateRequiredButtonParameters,
|
|
433
|
+
validateRequiredSelectMenuOptionParameters: () => validateRequiredSelectMenuOptionParameters,
|
|
434
|
+
validateRequiredSelectMenuParameters: () => validateRequiredSelectMenuParameters
|
|
435
|
+
});
|
|
436
|
+
var import_shapeshift2 = require("@sapphire/shapeshift");
|
|
437
|
+
var import_v10 = require("discord-api-types/v10");
|
|
438
|
+
|
|
439
|
+
// src/components/selectMenu/StringSelectMenuOption.ts
|
|
440
|
+
var StringSelectMenuOptionBuilder = class {
|
|
441
|
+
/**
|
|
442
|
+
* Creates a new string select menu option from API data.
|
|
443
|
+
*
|
|
444
|
+
* @param data - The API data to create this string select menu option with
|
|
445
|
+
* @example
|
|
446
|
+
* Creating a string select menu option from an API data object:
|
|
447
|
+
* ```ts
|
|
448
|
+
* const selectMenuOption = new SelectMenuOptionBuilder({
|
|
449
|
+
* label: 'catchy label',
|
|
450
|
+
* value: '1',
|
|
451
|
+
* });
|
|
452
|
+
* ```
|
|
453
|
+
* @example
|
|
454
|
+
* Creating a string select menu option using setters and API data:
|
|
455
|
+
* ```ts
|
|
456
|
+
* const selectMenuOption = new SelectMenuOptionBuilder({
|
|
457
|
+
* default: true,
|
|
458
|
+
* value: '1',
|
|
459
|
+
* })
|
|
460
|
+
* .setLabel('woah');
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
463
|
+
constructor(data = {}) {
|
|
464
|
+
this.data = data;
|
|
465
|
+
}
|
|
466
|
+
static {
|
|
467
|
+
__name(this, "StringSelectMenuOptionBuilder");
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Sets the label for this option.
|
|
471
|
+
*
|
|
472
|
+
* @param label - The label to use
|
|
473
|
+
*/
|
|
474
|
+
setLabel(label) {
|
|
475
|
+
this.data.label = labelValueDescriptionValidator.parse(label);
|
|
476
|
+
return this;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Sets the value for this option.
|
|
480
|
+
*
|
|
481
|
+
* @param value - The value to use
|
|
482
|
+
*/
|
|
483
|
+
setValue(value) {
|
|
484
|
+
this.data.value = labelValueDescriptionValidator.parse(value);
|
|
485
|
+
return this;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Sets the description for this option.
|
|
489
|
+
*
|
|
490
|
+
* @param description - The description to use
|
|
491
|
+
*/
|
|
492
|
+
setDescription(description) {
|
|
493
|
+
this.data.description = labelValueDescriptionValidator.parse(description);
|
|
494
|
+
return this;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Sets whether this option is selected by default.
|
|
498
|
+
*
|
|
499
|
+
* @param isDefault - Whether this option is selected by default
|
|
500
|
+
*/
|
|
501
|
+
setDefault(isDefault = true) {
|
|
502
|
+
this.data.default = defaultValidator.parse(isDefault);
|
|
503
|
+
return this;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Sets the emoji to display for this option.
|
|
507
|
+
*
|
|
508
|
+
* @param emoji - The emoji to use
|
|
509
|
+
*/
|
|
510
|
+
setEmoji(emoji) {
|
|
511
|
+
this.data.emoji = emojiValidator.parse(emoji);
|
|
512
|
+
return this;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* {@inheritDoc BaseSelectMenuBuilder.toJSON}
|
|
516
|
+
*/
|
|
517
|
+
toJSON() {
|
|
518
|
+
validateRequiredSelectMenuOptionParameters(this.data.label, this.data.value);
|
|
519
|
+
return {
|
|
520
|
+
...this.data
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
// src/components/Assertions.ts
|
|
526
|
+
var idValidator = import_shapeshift2.s.number().safeInt().greaterThanOrEqual(1).lessThan(4294967296).setValidationEnabled(isValidationEnabled);
|
|
527
|
+
var customIdValidator = import_shapeshift2.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
|
|
528
|
+
var emojiValidator = import_shapeshift2.s.object({
|
|
529
|
+
id: import_shapeshift2.s.string(),
|
|
530
|
+
name: import_shapeshift2.s.string(),
|
|
531
|
+
animated: import_shapeshift2.s.boolean()
|
|
532
|
+
}).partial().strict().setValidationEnabled(isValidationEnabled);
|
|
533
|
+
var disabledValidator = import_shapeshift2.s.boolean();
|
|
534
|
+
var buttonLabelValidator = import_shapeshift2.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(80).setValidationEnabled(isValidationEnabled);
|
|
535
|
+
var buttonStyleValidator = import_shapeshift2.s.nativeEnum(import_v10.ButtonStyle);
|
|
536
|
+
var placeholderValidator = import_shapeshift2.s.string().lengthLessThanOrEqual(150).setValidationEnabled(isValidationEnabled);
|
|
537
|
+
var minMaxValidator = import_shapeshift2.s.number().int().greaterThanOrEqual(0).lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
|
|
538
|
+
var labelValueDescriptionValidator = import_shapeshift2.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
|
|
539
|
+
var jsonOptionValidator = import_shapeshift2.s.object({
|
|
540
|
+
label: labelValueDescriptionValidator,
|
|
541
|
+
value: labelValueDescriptionValidator,
|
|
542
|
+
description: labelValueDescriptionValidator.optional(),
|
|
543
|
+
emoji: emojiValidator.optional(),
|
|
544
|
+
default: import_shapeshift2.s.boolean().optional()
|
|
545
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
546
|
+
var optionValidator = import_shapeshift2.s.instance(StringSelectMenuOptionBuilder).setValidationEnabled(isValidationEnabled);
|
|
547
|
+
var optionsValidator = optionValidator.array().lengthGreaterThanOrEqual(0).setValidationEnabled(isValidationEnabled);
|
|
548
|
+
var optionsLengthValidator = import_shapeshift2.s.number().int().greaterThanOrEqual(0).lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
|
|
549
|
+
function validateRequiredSelectMenuParameters(options, customId) {
|
|
550
|
+
customIdValidator.parse(customId);
|
|
551
|
+
optionsValidator.parse(options);
|
|
552
|
+
}
|
|
553
|
+
__name(validateRequiredSelectMenuParameters, "validateRequiredSelectMenuParameters");
|
|
554
|
+
var defaultValidator = import_shapeshift2.s.boolean();
|
|
555
|
+
function validateRequiredSelectMenuOptionParameters(label, value) {
|
|
556
|
+
labelValueDescriptionValidator.parse(label);
|
|
557
|
+
labelValueDescriptionValidator.parse(value);
|
|
558
|
+
}
|
|
559
|
+
__name(validateRequiredSelectMenuOptionParameters, "validateRequiredSelectMenuOptionParameters");
|
|
560
|
+
var channelTypesValidator = import_shapeshift2.s.nativeEnum(import_v10.ChannelType).array().setValidationEnabled(isValidationEnabled);
|
|
561
|
+
var urlValidator = import_shapeshift2.s.string().url({
|
|
562
|
+
allowedProtocols: ["http:", "https:", "discord:"]
|
|
563
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
564
|
+
function validateRequiredButtonParameters(style, label, emoji, customId, skuId, url) {
|
|
565
|
+
if (style === import_v10.ButtonStyle.Premium) {
|
|
566
|
+
if (!skuId) {
|
|
567
|
+
throw new RangeError("Premium buttons must have an SKU id.");
|
|
568
|
+
}
|
|
569
|
+
if (customId || label || url || emoji) {
|
|
570
|
+
throw new RangeError("Premium buttons cannot have a custom id, label, URL, or emoji.");
|
|
571
|
+
}
|
|
572
|
+
} else {
|
|
573
|
+
if (skuId) {
|
|
574
|
+
throw new RangeError("Non-premium buttons must not have an SKU id.");
|
|
575
|
+
}
|
|
576
|
+
if (url && customId) {
|
|
577
|
+
throw new RangeError("URL and custom id are mutually exclusive.");
|
|
578
|
+
}
|
|
579
|
+
if (!label && !emoji) {
|
|
580
|
+
throw new RangeError("Non-premium buttons must have a label and/or an emoji.");
|
|
581
|
+
}
|
|
582
|
+
if (style === import_v10.ButtonStyle.Link) {
|
|
583
|
+
if (!url) {
|
|
584
|
+
throw new RangeError("Link buttons must have a URL.");
|
|
585
|
+
}
|
|
586
|
+
} else if (url) {
|
|
587
|
+
throw new RangeError("Non-premium and non-link buttons cannot have a URL.");
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
__name(validateRequiredButtonParameters, "validateRequiredButtonParameters");
|
|
592
|
+
|
|
593
|
+
// src/components/ActionRow.ts
|
|
594
|
+
var import_v1024 = require("discord-api-types/v10");
|
|
595
|
+
|
|
596
|
+
// src/components/Component.ts
|
|
597
|
+
var ComponentBuilder = class {
|
|
598
|
+
static {
|
|
599
|
+
__name(this, "ComponentBuilder");
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* The API data associated with this component.
|
|
603
|
+
*/
|
|
604
|
+
data;
|
|
605
|
+
/**
|
|
606
|
+
* Constructs a new kind of component.
|
|
607
|
+
*
|
|
608
|
+
* @param data - The data to construct a component out of
|
|
609
|
+
*/
|
|
610
|
+
constructor(data) {
|
|
611
|
+
this.data = data;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Sets the id (not the custom id) for this component.
|
|
615
|
+
*
|
|
616
|
+
* @param id - The id for this component
|
|
617
|
+
*/
|
|
618
|
+
setId(id) {
|
|
619
|
+
this.data.id = idValidator.parse(id);
|
|
620
|
+
return this;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Clears the id of this component, defaulting to a default incremented id.
|
|
624
|
+
*/
|
|
625
|
+
clearId() {
|
|
626
|
+
this.data.id = void 0;
|
|
627
|
+
return this;
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
// src/components/Components.ts
|
|
632
|
+
var import_v1023 = require("discord-api-types/v10");
|
|
633
|
+
|
|
634
|
+
// src/components/button/Button.ts
|
|
635
|
+
var import_v102 = require("discord-api-types/v10");
|
|
636
|
+
var ButtonBuilder = class extends ComponentBuilder {
|
|
637
|
+
static {
|
|
638
|
+
__name(this, "ButtonBuilder");
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Creates a new button from API data.
|
|
642
|
+
*
|
|
643
|
+
* @param data - The API data to create this button with
|
|
644
|
+
* @example
|
|
645
|
+
* Creating a button from an API data object:
|
|
646
|
+
* ```ts
|
|
647
|
+
* const button = new ButtonBuilder({
|
|
648
|
+
* custom_id: 'a cool button',
|
|
649
|
+
* style: ButtonStyle.Primary,
|
|
650
|
+
* label: 'Click Me',
|
|
651
|
+
* emoji: {
|
|
652
|
+
* name: 'smile',
|
|
653
|
+
* id: '123456789012345678',
|
|
654
|
+
* },
|
|
655
|
+
* });
|
|
656
|
+
* ```
|
|
657
|
+
* @example
|
|
658
|
+
* Creating a button using setters and API data:
|
|
659
|
+
* ```ts
|
|
660
|
+
* const button = new ButtonBuilder({
|
|
661
|
+
* style: ButtonStyle.Secondary,
|
|
662
|
+
* label: 'Click Me',
|
|
663
|
+
* })
|
|
664
|
+
* .setEmoji({ name: '🙂' })
|
|
665
|
+
* .setCustomId('another cool button');
|
|
666
|
+
* ```
|
|
667
|
+
*/
|
|
668
|
+
constructor(data) {
|
|
669
|
+
super({ type: import_v102.ComponentType.Button, ...data });
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Sets the style of this button.
|
|
673
|
+
*
|
|
674
|
+
* @param style - The style to use
|
|
675
|
+
*/
|
|
676
|
+
setStyle(style) {
|
|
677
|
+
this.data.style = buttonStyleValidator.parse(style);
|
|
678
|
+
return this;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Sets the URL for this button.
|
|
682
|
+
*
|
|
683
|
+
* @remarks
|
|
684
|
+
* This method is only available to buttons using the `Link` button style.
|
|
685
|
+
* Only three types of URL schemes are currently supported: `https://`, `http://`, and `discord://`.
|
|
686
|
+
* @param url - The URL to use
|
|
687
|
+
*/
|
|
688
|
+
setURL(url) {
|
|
689
|
+
this.data.url = urlValidator.parse(url);
|
|
690
|
+
return this;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Sets the custom id for this button.
|
|
694
|
+
*
|
|
695
|
+
* @remarks
|
|
696
|
+
* This method is only applicable to buttons that are not using the `Link` button style.
|
|
697
|
+
* @param customId - The custom id to use
|
|
698
|
+
*/
|
|
699
|
+
setCustomId(customId) {
|
|
700
|
+
this.data.custom_id = customIdValidator.parse(customId);
|
|
701
|
+
return this;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Sets the SKU id that represents a purchasable SKU for this button.
|
|
705
|
+
*
|
|
706
|
+
* @remarks Only available when using premium-style buttons.
|
|
707
|
+
* @param skuId - The SKU id to use
|
|
708
|
+
*/
|
|
709
|
+
setSKUId(skuId) {
|
|
710
|
+
this.data.sku_id = skuId;
|
|
711
|
+
return this;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Sets the emoji to display on this button.
|
|
715
|
+
*
|
|
716
|
+
* @param emoji - The emoji to use
|
|
717
|
+
*/
|
|
718
|
+
setEmoji(emoji) {
|
|
719
|
+
this.data.emoji = emojiValidator.parse(emoji);
|
|
720
|
+
return this;
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Sets whether this button is disabled.
|
|
724
|
+
*
|
|
725
|
+
* @param disabled - Whether to disable this button
|
|
726
|
+
*/
|
|
727
|
+
setDisabled(disabled = true) {
|
|
728
|
+
this.data.disabled = disabledValidator.parse(disabled);
|
|
729
|
+
return this;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Sets the label for this button.
|
|
733
|
+
*
|
|
734
|
+
* @param label - The label to use
|
|
735
|
+
*/
|
|
736
|
+
setLabel(label) {
|
|
737
|
+
this.data.label = buttonLabelValidator.parse(label);
|
|
738
|
+
return this;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
742
|
+
*/
|
|
743
|
+
toJSON() {
|
|
744
|
+
validateRequiredButtonParameters(
|
|
745
|
+
this.data.style,
|
|
746
|
+
this.data.label,
|
|
747
|
+
this.data.emoji,
|
|
748
|
+
this.data.custom_id,
|
|
749
|
+
this.data.sku_id,
|
|
750
|
+
this.data.url
|
|
751
|
+
);
|
|
752
|
+
return {
|
|
753
|
+
...this.data
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
// src/components/fileUpload/FileUpload.ts
|
|
759
|
+
var import_v104 = require("discord-api-types/v10");
|
|
760
|
+
|
|
761
|
+
// src/components/fileUpload/Assertions.ts
|
|
762
|
+
var Assertions_exports3 = {};
|
|
763
|
+
__export(Assertions_exports3, {
|
|
764
|
+
fileUploadPredicate: () => fileUploadPredicate
|
|
765
|
+
});
|
|
766
|
+
var import_shapeshift3 = require("@sapphire/shapeshift");
|
|
767
|
+
var import_v103 = require("discord-api-types/v10");
|
|
768
|
+
var fileUploadPredicate = import_shapeshift3.s.object({
|
|
769
|
+
type: import_shapeshift3.s.literal(import_v103.ComponentType.FileUpload),
|
|
770
|
+
id: idValidator.optional(),
|
|
771
|
+
custom_id: customIdValidator,
|
|
772
|
+
min_values: import_shapeshift3.s.number().greaterThanOrEqual(0).lessThanOrEqual(10).optional(),
|
|
773
|
+
max_values: import_shapeshift3.s.number().greaterThanOrEqual(1).lessThanOrEqual(10).optional(),
|
|
774
|
+
required: import_shapeshift3.s.boolean().optional()
|
|
775
|
+
});
|
|
776
|
+
|
|
777
|
+
// src/components/fileUpload/FileUpload.ts
|
|
778
|
+
var FileUploadBuilder = class extends ComponentBuilder {
|
|
779
|
+
static {
|
|
780
|
+
__name(this, "FileUploadBuilder");
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Creates a new file upload.
|
|
784
|
+
*
|
|
785
|
+
* @param data - The API data to create this file upload with
|
|
786
|
+
* @example
|
|
787
|
+
* Creating a file upload from an API data object:
|
|
788
|
+
* ```ts
|
|
789
|
+
* const fileUpload = new FileUploadBuilder({
|
|
790
|
+
* custom_id: "file_upload",
|
|
791
|
+
* min_values: 2,
|
|
792
|
+
* max_values: 5,
|
|
793
|
+
* });
|
|
794
|
+
* ```
|
|
795
|
+
* @example
|
|
796
|
+
* Creating a file upload using setters and API data:
|
|
797
|
+
* ```ts
|
|
798
|
+
* const fileUpload = new FileUploadBuilder({
|
|
799
|
+
* custom_id: "file_upload",
|
|
800
|
+
* min_values: 2,
|
|
801
|
+
* max_values: 5,
|
|
802
|
+
* }).setRequired();
|
|
803
|
+
* ```
|
|
804
|
+
*/
|
|
805
|
+
constructor(data = {}) {
|
|
806
|
+
super({ type: import_v104.ComponentType.FileUpload, ...data });
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Sets the custom id for this file upload.
|
|
810
|
+
*
|
|
811
|
+
* @param customId - The custom id to use
|
|
812
|
+
*/
|
|
813
|
+
setCustomId(customId) {
|
|
814
|
+
this.data.custom_id = customId;
|
|
815
|
+
return this;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Sets the minimum number of file uploads required.
|
|
819
|
+
*
|
|
820
|
+
* @param minValues - The minimum values that must be uploaded
|
|
821
|
+
*/
|
|
822
|
+
setMinValues(minValues) {
|
|
823
|
+
this.data.min_values = minValues;
|
|
824
|
+
return this;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Clears the minimum values.
|
|
828
|
+
*/
|
|
829
|
+
clearMinValues() {
|
|
830
|
+
this.data.min_values = void 0;
|
|
831
|
+
return this;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Sets the maximum number of file uploads required.
|
|
835
|
+
*
|
|
836
|
+
* @param maxValues - The maximum values that can be uploaded
|
|
837
|
+
*/
|
|
838
|
+
setMaxValues(maxValues) {
|
|
839
|
+
this.data.max_values = maxValues;
|
|
840
|
+
return this;
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Clears the maximum values.
|
|
844
|
+
*/
|
|
845
|
+
clearMaxValues() {
|
|
846
|
+
this.data.max_values = void 0;
|
|
847
|
+
return this;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Sets whether this file upload is required.
|
|
851
|
+
*
|
|
852
|
+
* @param required - Whether this file upload is required
|
|
853
|
+
*/
|
|
854
|
+
setRequired(required = true) {
|
|
855
|
+
this.data.required = required;
|
|
856
|
+
return this;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
860
|
+
*/
|
|
861
|
+
toJSON() {
|
|
862
|
+
fileUploadPredicate.parse(this.data);
|
|
863
|
+
return this.data;
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
// src/components/label/Label.ts
|
|
868
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
869
|
+
|
|
870
|
+
// src/components/selectMenu/ChannelSelectMenu.ts
|
|
871
|
+
var import_v106 = require("discord-api-types/v10");
|
|
872
|
+
|
|
873
|
+
// src/components/textInput/Assertions.ts
|
|
874
|
+
var Assertions_exports4 = {};
|
|
875
|
+
__export(Assertions_exports4, {
|
|
876
|
+
labelValidator: () => labelValidator,
|
|
877
|
+
maxLengthValidator: () => maxLengthValidator,
|
|
878
|
+
minLengthValidator: () => minLengthValidator,
|
|
879
|
+
placeholderValidator: () => placeholderValidator2,
|
|
880
|
+
requiredValidator: () => requiredValidator,
|
|
881
|
+
textInputPredicate: () => textInputPredicate,
|
|
882
|
+
textInputStyleValidator: () => textInputStyleValidator,
|
|
883
|
+
validateRequiredParameters: () => validateRequiredParameters,
|
|
884
|
+
valueValidator: () => valueValidator
|
|
885
|
+
});
|
|
886
|
+
var import_shapeshift4 = require("@sapphire/shapeshift");
|
|
887
|
+
var import_v105 = require("discord-api-types/v10");
|
|
888
|
+
var textInputStyleValidator = import_shapeshift4.s.nativeEnum(import_v105.TextInputStyle).setValidationEnabled(isValidationEnabled);
|
|
889
|
+
var minLengthValidator = import_shapeshift4.s.number().int().greaterThanOrEqual(0).lessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled);
|
|
890
|
+
var maxLengthValidator = import_shapeshift4.s.number().int().greaterThanOrEqual(1).lessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled);
|
|
891
|
+
var requiredValidator = import_shapeshift4.s.boolean().setValidationEnabled(isValidationEnabled);
|
|
892
|
+
var valueValidator = import_shapeshift4.s.string().lengthLessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled);
|
|
893
|
+
var placeholderValidator2 = import_shapeshift4.s.string().lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
|
|
894
|
+
var labelValidator = import_shapeshift4.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45).setValidationEnabled(isValidationEnabled);
|
|
895
|
+
var textInputPredicate = import_shapeshift4.s.object({
|
|
896
|
+
type: import_shapeshift4.s.literal(import_v105.ComponentType.TextInput),
|
|
897
|
+
custom_id: customIdValidator,
|
|
898
|
+
style: textInputStyleValidator,
|
|
899
|
+
id: idValidator.optional(),
|
|
900
|
+
min_length: minLengthValidator.optional(),
|
|
901
|
+
max_length: maxLengthValidator.optional(),
|
|
902
|
+
placeholder: placeholderValidator2.optional(),
|
|
903
|
+
value: valueValidator.optional(),
|
|
904
|
+
required: requiredValidator.optional()
|
|
905
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
906
|
+
function validateRequiredParameters(customId, style) {
|
|
907
|
+
customIdValidator.parse(customId);
|
|
908
|
+
textInputStyleValidator.parse(style);
|
|
909
|
+
}
|
|
910
|
+
__name(validateRequiredParameters, "validateRequiredParameters");
|
|
911
|
+
|
|
912
|
+
// src/components/selectMenu/BaseSelectMenu.ts
|
|
913
|
+
var BaseSelectMenuBuilder = class extends ComponentBuilder {
|
|
914
|
+
static {
|
|
915
|
+
__name(this, "BaseSelectMenuBuilder");
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Sets the placeholder for this select menu.
|
|
919
|
+
*
|
|
920
|
+
* @param placeholder - The placeholder to use
|
|
921
|
+
*/
|
|
922
|
+
setPlaceholder(placeholder) {
|
|
923
|
+
this.data.placeholder = placeholderValidator.parse(placeholder);
|
|
924
|
+
return this;
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Sets the minimum values that must be selected in the select menu.
|
|
928
|
+
*
|
|
929
|
+
* @param minValues - The minimum values that must be selected
|
|
930
|
+
*/
|
|
931
|
+
setMinValues(minValues) {
|
|
932
|
+
this.data.min_values = minMaxValidator.parse(minValues);
|
|
933
|
+
return this;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Sets the maximum values that can be selected in the select menu.
|
|
937
|
+
*
|
|
938
|
+
* @param maxValues - The maximum values that can be selected
|
|
939
|
+
*/
|
|
940
|
+
setMaxValues(maxValues) {
|
|
941
|
+
this.data.max_values = minMaxValidator.parse(maxValues);
|
|
942
|
+
return this;
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Sets the custom id for this select menu.
|
|
946
|
+
*
|
|
947
|
+
* @param customId - The custom id to use
|
|
948
|
+
*/
|
|
949
|
+
setCustomId(customId) {
|
|
950
|
+
this.data.custom_id = customIdValidator.parse(customId);
|
|
951
|
+
return this;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Sets whether this select menu is disabled.
|
|
955
|
+
*
|
|
956
|
+
* @param disabled - Whether this select menu is disabled
|
|
957
|
+
*/
|
|
958
|
+
setDisabled(disabled = true) {
|
|
959
|
+
this.data.disabled = disabledValidator.parse(disabled);
|
|
960
|
+
return this;
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Sets whether this select menu is required.
|
|
964
|
+
*
|
|
965
|
+
* @remarks Only for use in modals.
|
|
966
|
+
* @param required - Whether this select menu is required
|
|
967
|
+
*/
|
|
968
|
+
setRequired(required = true) {
|
|
969
|
+
this.data.required = requiredValidator.parse(required);
|
|
970
|
+
return this;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
974
|
+
*/
|
|
975
|
+
toJSON() {
|
|
976
|
+
customIdValidator.parse(this.data.custom_id);
|
|
977
|
+
return {
|
|
978
|
+
...this.data
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
// src/components/selectMenu/ChannelSelectMenu.ts
|
|
984
|
+
var ChannelSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
985
|
+
static {
|
|
986
|
+
__name(this, "ChannelSelectMenuBuilder");
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Creates a new select menu from API data.
|
|
990
|
+
*
|
|
991
|
+
* @param data - The API data to create this select menu with
|
|
992
|
+
* @example
|
|
993
|
+
* Creating a select menu from an API data object:
|
|
994
|
+
* ```ts
|
|
995
|
+
* const selectMenu = new ChannelSelectMenuBuilder({
|
|
996
|
+
* custom_id: 'a cool select menu',
|
|
997
|
+
* placeholder: 'select an option',
|
|
998
|
+
* max_values: 2,
|
|
999
|
+
* });
|
|
1000
|
+
* ```
|
|
1001
|
+
* @example
|
|
1002
|
+
* Creating a select menu using setters and API data:
|
|
1003
|
+
* ```ts
|
|
1004
|
+
* const selectMenu = new ChannelSelectMenuBuilder({
|
|
1005
|
+
* custom_id: 'a cool select menu',
|
|
1006
|
+
* })
|
|
1007
|
+
* .addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
|
1008
|
+
* .setMinValues(2);
|
|
1009
|
+
* ```
|
|
1010
|
+
*/
|
|
1011
|
+
constructor(data) {
|
|
1012
|
+
super({ ...data, type: import_v106.ComponentType.ChannelSelect });
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Adds channel types to this select menu.
|
|
1016
|
+
*
|
|
1017
|
+
* @param types - The channel types to use
|
|
1018
|
+
*/
|
|
1019
|
+
addChannelTypes(...types) {
|
|
1020
|
+
const normalizedTypes = normalizeArray(types);
|
|
1021
|
+
this.data.channel_types ??= [];
|
|
1022
|
+
this.data.channel_types.push(...channelTypesValidator.parse(normalizedTypes));
|
|
1023
|
+
return this;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Sets channel types for this select menu.
|
|
1027
|
+
*
|
|
1028
|
+
* @param types - The channel types to use
|
|
1029
|
+
*/
|
|
1030
|
+
setChannelTypes(...types) {
|
|
1031
|
+
const normalizedTypes = normalizeArray(types);
|
|
1032
|
+
this.data.channel_types ??= [];
|
|
1033
|
+
this.data.channel_types.splice(0, this.data.channel_types.length, ...channelTypesValidator.parse(normalizedTypes));
|
|
1034
|
+
return this;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Adds default channels to this auto populated select menu.
|
|
1038
|
+
*
|
|
1039
|
+
* @param channels - The channels to add
|
|
1040
|
+
*/
|
|
1041
|
+
addDefaultChannels(...channels) {
|
|
1042
|
+
const normalizedValues = normalizeArray(channels);
|
|
1043
|
+
optionsLengthValidator.parse((this.data.default_values?.length ?? 0) + normalizedValues.length);
|
|
1044
|
+
this.data.default_values ??= [];
|
|
1045
|
+
this.data.default_values.push(
|
|
1046
|
+
...normalizedValues.map((id) => ({
|
|
1047
|
+
id,
|
|
1048
|
+
type: import_v106.SelectMenuDefaultValueType.Channel
|
|
1049
|
+
}))
|
|
1050
|
+
);
|
|
1051
|
+
return this;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Sets default channels for this auto populated select menu.
|
|
1055
|
+
*
|
|
1056
|
+
* @param channels - The channels to set
|
|
1057
|
+
*/
|
|
1058
|
+
setDefaultChannels(...channels) {
|
|
1059
|
+
const normalizedValues = normalizeArray(channels);
|
|
1060
|
+
optionsLengthValidator.parse(normalizedValues.length);
|
|
1061
|
+
this.data.default_values = normalizedValues.map((id) => ({
|
|
1062
|
+
id,
|
|
1063
|
+
type: import_v106.SelectMenuDefaultValueType.Channel
|
|
1064
|
+
}));
|
|
1065
|
+
return this;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* {@inheritDoc BaseSelectMenuBuilder.toJSON}
|
|
1069
|
+
*/
|
|
1070
|
+
toJSON() {
|
|
1071
|
+
customIdValidator.parse(this.data.custom_id);
|
|
1072
|
+
return {
|
|
1073
|
+
...this.data
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
// src/components/selectMenu/MentionableSelectMenu.ts
|
|
1079
|
+
var import_v107 = require("discord-api-types/v10");
|
|
1080
|
+
var MentionableSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
1081
|
+
static {
|
|
1082
|
+
__name(this, "MentionableSelectMenuBuilder");
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Creates a new select menu from API data.
|
|
1086
|
+
*
|
|
1087
|
+
* @param data - The API data to create this select menu with
|
|
1088
|
+
* @example
|
|
1089
|
+
* Creating a select menu from an API data object:
|
|
1090
|
+
* ```ts
|
|
1091
|
+
* const selectMenu = new MentionableSelectMenuBuilder({
|
|
1092
|
+
* custom_id: 'a cool select menu',
|
|
1093
|
+
* placeholder: 'select an option',
|
|
1094
|
+
* max_values: 2,
|
|
1095
|
+
* });
|
|
1096
|
+
* ```
|
|
1097
|
+
* @example
|
|
1098
|
+
* Creating a select menu using setters and API data:
|
|
1099
|
+
* ```ts
|
|
1100
|
+
* const selectMenu = new MentionableSelectMenuBuilder({
|
|
1101
|
+
* custom_id: 'a cool select menu',
|
|
1102
|
+
* })
|
|
1103
|
+
* .setMinValues(1);
|
|
1104
|
+
* ```
|
|
1105
|
+
*/
|
|
1106
|
+
constructor(data) {
|
|
1107
|
+
super({ ...data, type: import_v107.ComponentType.MentionableSelect });
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Adds default roles to this auto populated select menu.
|
|
1111
|
+
*
|
|
1112
|
+
* @param roles - The roles to add
|
|
1113
|
+
*/
|
|
1114
|
+
addDefaultRoles(...roles) {
|
|
1115
|
+
const normalizedValues = normalizeArray(roles);
|
|
1116
|
+
optionsLengthValidator.parse((this.data.default_values?.length ?? 0) + normalizedValues.length);
|
|
1117
|
+
this.data.default_values ??= [];
|
|
1118
|
+
this.data.default_values.push(
|
|
1119
|
+
...normalizedValues.map((id) => ({
|
|
1120
|
+
id,
|
|
1121
|
+
type: import_v107.SelectMenuDefaultValueType.Role
|
|
1122
|
+
}))
|
|
1123
|
+
);
|
|
1124
|
+
return this;
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* Adds default users to this auto populated select menu.
|
|
1128
|
+
*
|
|
1129
|
+
* @param users - The users to add
|
|
1130
|
+
*/
|
|
1131
|
+
addDefaultUsers(...users) {
|
|
1132
|
+
const normalizedValues = normalizeArray(users);
|
|
1133
|
+
optionsLengthValidator.parse((this.data.default_values?.length ?? 0) + normalizedValues.length);
|
|
1134
|
+
this.data.default_values ??= [];
|
|
1135
|
+
this.data.default_values.push(
|
|
1136
|
+
...normalizedValues.map((id) => ({
|
|
1137
|
+
id,
|
|
1138
|
+
type: import_v107.SelectMenuDefaultValueType.User
|
|
1139
|
+
}))
|
|
1140
|
+
);
|
|
1141
|
+
return this;
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* Adds default values to this auto populated select menu.
|
|
1145
|
+
*
|
|
1146
|
+
* @param values - The values to add
|
|
1147
|
+
*/
|
|
1148
|
+
addDefaultValues(...values) {
|
|
1149
|
+
const normalizedValues = normalizeArray(values);
|
|
1150
|
+
optionsLengthValidator.parse((this.data.default_values?.length ?? 0) + normalizedValues.length);
|
|
1151
|
+
this.data.default_values ??= [];
|
|
1152
|
+
this.data.default_values.push(...normalizedValues);
|
|
1153
|
+
return this;
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Sets default values for this auto populated select menu.
|
|
1157
|
+
*
|
|
1158
|
+
* @param values - The values to set
|
|
1159
|
+
*/
|
|
1160
|
+
setDefaultValues(...values) {
|
|
1161
|
+
const normalizedValues = normalizeArray(values);
|
|
1162
|
+
optionsLengthValidator.parse(normalizedValues.length);
|
|
1163
|
+
this.data.default_values = normalizedValues;
|
|
1164
|
+
return this;
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
// src/components/selectMenu/RoleSelectMenu.ts
|
|
1169
|
+
var import_v108 = require("discord-api-types/v10");
|
|
1170
|
+
var RoleSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
1171
|
+
static {
|
|
1172
|
+
__name(this, "RoleSelectMenuBuilder");
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Creates a new select menu from API data.
|
|
1176
|
+
*
|
|
1177
|
+
* @param data - The API data to create this select menu with
|
|
1178
|
+
* @example
|
|
1179
|
+
* Creating a select menu from an API data object:
|
|
1180
|
+
* ```ts
|
|
1181
|
+
* const selectMenu = new RoleSelectMenuBuilder({
|
|
1182
|
+
* custom_id: 'a cool select menu',
|
|
1183
|
+
* placeholder: 'select an option',
|
|
1184
|
+
* max_values: 2,
|
|
1185
|
+
* });
|
|
1186
|
+
* ```
|
|
1187
|
+
* @example
|
|
1188
|
+
* Creating a select menu using setters and API data:
|
|
1189
|
+
* ```ts
|
|
1190
|
+
* const selectMenu = new RoleSelectMenuBuilder({
|
|
1191
|
+
* custom_id: 'a cool select menu',
|
|
1192
|
+
* })
|
|
1193
|
+
* .setMinValues(1);
|
|
1194
|
+
* ```
|
|
1195
|
+
*/
|
|
1196
|
+
constructor(data) {
|
|
1197
|
+
super({ ...data, type: import_v108.ComponentType.RoleSelect });
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Adds default roles to this auto populated select menu.
|
|
1201
|
+
*
|
|
1202
|
+
* @param roles - The roles to add
|
|
1203
|
+
*/
|
|
1204
|
+
addDefaultRoles(...roles) {
|
|
1205
|
+
const normalizedValues = normalizeArray(roles);
|
|
1206
|
+
optionsLengthValidator.parse((this.data.default_values?.length ?? 0) + normalizedValues.length);
|
|
1207
|
+
this.data.default_values ??= [];
|
|
1208
|
+
this.data.default_values.push(
|
|
1209
|
+
...normalizedValues.map((id) => ({
|
|
1210
|
+
id,
|
|
1211
|
+
type: import_v108.SelectMenuDefaultValueType.Role
|
|
1212
|
+
}))
|
|
1213
|
+
);
|
|
1214
|
+
return this;
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Sets default roles for this auto populated select menu.
|
|
1218
|
+
*
|
|
1219
|
+
* @param roles - The roles to set
|
|
1220
|
+
*/
|
|
1221
|
+
setDefaultRoles(...roles) {
|
|
1222
|
+
const normalizedValues = normalizeArray(roles);
|
|
1223
|
+
optionsLengthValidator.parse(normalizedValues.length);
|
|
1224
|
+
this.data.default_values = normalizedValues.map((id) => ({
|
|
1225
|
+
id,
|
|
1226
|
+
type: import_v108.SelectMenuDefaultValueType.Role
|
|
1227
|
+
}));
|
|
1228
|
+
return this;
|
|
1229
|
+
}
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
// src/components/selectMenu/StringSelectMenu.ts
|
|
1233
|
+
var import_v1010 = require("discord-api-types/v10");
|
|
1234
|
+
|
|
1235
|
+
// src/components/selectMenu/Assertions.ts
|
|
1236
|
+
var Assertions_exports5 = {};
|
|
1237
|
+
__export(Assertions_exports5, {
|
|
1238
|
+
selectMenuChannelPredicate: () => selectMenuChannelPredicate,
|
|
1239
|
+
selectMenuMentionablePredicate: () => selectMenuMentionablePredicate,
|
|
1240
|
+
selectMenuRolePredicate: () => selectMenuRolePredicate,
|
|
1241
|
+
selectMenuStringOptionPredicate: () => selectMenuStringOptionPredicate,
|
|
1242
|
+
selectMenuStringPredicate: () => selectMenuStringPredicate,
|
|
1243
|
+
selectMenuUserPredicate: () => selectMenuUserPredicate
|
|
1244
|
+
});
|
|
1245
|
+
var import_shapeshift5 = require("@sapphire/shapeshift");
|
|
1246
|
+
var import_v109 = require("discord-api-types/v10");
|
|
1247
|
+
var selectMenuBasePredicate = import_shapeshift5.s.object({
|
|
1248
|
+
id: idValidator.optional(),
|
|
1249
|
+
placeholder: import_shapeshift5.s.string().lengthLessThanOrEqual(150).optional(),
|
|
1250
|
+
min_values: import_shapeshift5.s.number().greaterThanOrEqual(0).lessThanOrEqual(25).optional(),
|
|
1251
|
+
max_values: import_shapeshift5.s.number().greaterThanOrEqual(0).lessThanOrEqual(25).optional(),
|
|
1252
|
+
custom_id: customIdValidator,
|
|
1253
|
+
disabled: import_shapeshift5.s.boolean().optional()
|
|
1254
|
+
});
|
|
1255
|
+
var selectMenuChannelPredicate = selectMenuBasePredicate.extend({
|
|
1256
|
+
type: import_shapeshift5.s.literal(import_v109.ComponentType.ChannelSelect),
|
|
1257
|
+
channel_types: import_shapeshift5.s.nativeEnum(import_v109.ChannelType).array().optional(),
|
|
1258
|
+
default_values: import_shapeshift5.s.object({ id: import_shapeshift5.s.string(), type: import_shapeshift5.s.literal(import_v109.SelectMenuDefaultValueType.Channel) }).array().lengthLessThanOrEqual(25).optional()
|
|
1259
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1260
|
+
var selectMenuMentionablePredicate = selectMenuBasePredicate.extend({
|
|
1261
|
+
type: import_shapeshift5.s.literal(import_v109.ComponentType.MentionableSelect),
|
|
1262
|
+
default_values: import_shapeshift5.s.object({
|
|
1263
|
+
id: import_shapeshift5.s.string(),
|
|
1264
|
+
type: import_shapeshift5.s.union([import_shapeshift5.s.literal(import_v109.SelectMenuDefaultValueType.Role), import_shapeshift5.s.literal(import_v109.SelectMenuDefaultValueType.User)])
|
|
1265
|
+
}).array().lengthLessThanOrEqual(25).optional()
|
|
1266
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1267
|
+
var selectMenuRolePredicate = selectMenuBasePredicate.extend({
|
|
1268
|
+
type: import_shapeshift5.s.literal(import_v109.ComponentType.RoleSelect),
|
|
1269
|
+
default_values: import_shapeshift5.s.object({ id: import_shapeshift5.s.string(), type: import_shapeshift5.s.literal(import_v109.SelectMenuDefaultValueType.Role) }).array().lengthLessThanOrEqual(25).optional()
|
|
1270
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1271
|
+
var selectMenuUserPredicate = selectMenuBasePredicate.extend({
|
|
1272
|
+
type: import_shapeshift5.s.literal(import_v109.ComponentType.UserSelect),
|
|
1273
|
+
default_values: import_shapeshift5.s.object({ id: import_shapeshift5.s.string(), type: import_shapeshift5.s.literal(import_v109.SelectMenuDefaultValueType.User) }).array().lengthLessThanOrEqual(25).optional()
|
|
1274
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1275
|
+
var selectMenuStringOptionPredicate = import_shapeshift5.s.object({
|
|
1276
|
+
label: import_shapeshift5.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100),
|
|
1277
|
+
value: import_shapeshift5.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100),
|
|
1278
|
+
description: import_shapeshift5.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).optional(),
|
|
1279
|
+
emoji: emojiValidator.optional(),
|
|
1280
|
+
default: import_shapeshift5.s.boolean().optional()
|
|
1281
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1282
|
+
var selectMenuStringPredicate = selectMenuBasePredicate.extend({
|
|
1283
|
+
type: import_shapeshift5.s.literal(import_v109.ComponentType.StringSelect),
|
|
1284
|
+
options: selectMenuStringOptionPredicate.array().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(25)
|
|
1285
|
+
}).reshape((value) => {
|
|
1286
|
+
if (value.min_values !== void 0 && value.options.length < value.min_values) {
|
|
1287
|
+
return import_shapeshift5.Result.err(new RangeError(`The number of options must be greater than or equal to min_values`));
|
|
1288
|
+
}
|
|
1289
|
+
if (value.min_values !== void 0 && value.max_values !== void 0 && value.min_values > value.max_values) {
|
|
1290
|
+
return import_shapeshift5.Result.err(
|
|
1291
|
+
new RangeError(`The maximum amount of options must be greater than or equal to the minimum amount of options`)
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
return import_shapeshift5.Result.ok(value);
|
|
1295
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1296
|
+
|
|
1297
|
+
// src/components/selectMenu/StringSelectMenu.ts
|
|
1298
|
+
var StringSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
1299
|
+
static {
|
|
1300
|
+
__name(this, "StringSelectMenuBuilder");
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* The options within this select menu.
|
|
1304
|
+
*/
|
|
1305
|
+
options;
|
|
1306
|
+
/**
|
|
1307
|
+
* Creates a new select menu from API data.
|
|
1308
|
+
*
|
|
1309
|
+
* @param data - The API data to create this select menu with
|
|
1310
|
+
* @example
|
|
1311
|
+
* Creating a select menu from an API data object:
|
|
1312
|
+
* ```ts
|
|
1313
|
+
* const selectMenu = new StringSelectMenuBuilder({
|
|
1314
|
+
* custom_id: 'a cool select menu',
|
|
1315
|
+
* placeholder: 'select an option',
|
|
1316
|
+
* max_values: 2,
|
|
1317
|
+
* options: [
|
|
1318
|
+
* { label: 'option 1', value: '1' },
|
|
1319
|
+
* { label: 'option 2', value: '2' },
|
|
1320
|
+
* { label: 'option 3', value: '3' },
|
|
1321
|
+
* ],
|
|
1322
|
+
* });
|
|
1323
|
+
* ```
|
|
1324
|
+
* @example
|
|
1325
|
+
* Creating a select menu using setters and API data:
|
|
1326
|
+
* ```ts
|
|
1327
|
+
* const selectMenu = new StringSelectMenuBuilder({
|
|
1328
|
+
* custom_id: 'a cool select menu',
|
|
1329
|
+
* })
|
|
1330
|
+
* .setMinValues(1)
|
|
1331
|
+
* .addOptions({
|
|
1332
|
+
* label: 'Catchy',
|
|
1333
|
+
* value: 'catch',
|
|
1334
|
+
* });
|
|
1335
|
+
* ```
|
|
1336
|
+
*/
|
|
1337
|
+
constructor(data) {
|
|
1338
|
+
const { options, ...initData } = data ?? {};
|
|
1339
|
+
super({ ...initData, type: import_v1010.ComponentType.StringSelect });
|
|
1340
|
+
this.options = options?.map((option) => new StringSelectMenuOptionBuilder(option)) ?? [];
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Adds options to this select menu.
|
|
1344
|
+
*
|
|
1345
|
+
* @param options - The options to add
|
|
1346
|
+
*/
|
|
1347
|
+
addOptions(...options) {
|
|
1348
|
+
const normalizedOptions = normalizeArray(options);
|
|
1349
|
+
optionsLengthValidator.parse(this.options.length + normalizedOptions.length);
|
|
1350
|
+
this.options.push(
|
|
1351
|
+
...normalizedOptions.map(
|
|
1352
|
+
(normalizedOption) => normalizedOption instanceof StringSelectMenuOptionBuilder ? normalizedOption : new StringSelectMenuOptionBuilder(selectMenuStringOptionPredicate.parse(normalizedOption))
|
|
1353
|
+
)
|
|
1354
|
+
);
|
|
1355
|
+
return this;
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* Sets the options for this select menu.
|
|
1359
|
+
*
|
|
1360
|
+
* @param options - The options to set
|
|
1361
|
+
*/
|
|
1362
|
+
setOptions(...options) {
|
|
1363
|
+
return this.spliceOptions(0, this.options.length, ...options);
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Removes, replaces, or inserts options for this select menu.
|
|
1367
|
+
*
|
|
1368
|
+
* @remarks
|
|
1369
|
+
* This method behaves similarly
|
|
1370
|
+
* to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | Array.prototype.splice()}.
|
|
1371
|
+
* It's useful for modifying and adjusting the order of existing options.
|
|
1372
|
+
* @example
|
|
1373
|
+
* Remove the first option:
|
|
1374
|
+
* ```ts
|
|
1375
|
+
* selectMenu.spliceOptions(0, 1);
|
|
1376
|
+
* ```
|
|
1377
|
+
* @example
|
|
1378
|
+
* Remove the first n option:
|
|
1379
|
+
* ```ts
|
|
1380
|
+
* const n = 4;
|
|
1381
|
+
* selectMenu.spliceOptions(0, n);
|
|
1382
|
+
* ```
|
|
1383
|
+
* @example
|
|
1384
|
+
* Remove the last option:
|
|
1385
|
+
* ```ts
|
|
1386
|
+
* selectMenu.spliceOptions(-1, 1);
|
|
1387
|
+
* ```
|
|
1388
|
+
* @param index - The index to start at
|
|
1389
|
+
* @param deleteCount - The number of options to remove
|
|
1390
|
+
* @param options - The replacing option objects or builders
|
|
1391
|
+
*/
|
|
1392
|
+
spliceOptions(index, deleteCount, ...options) {
|
|
1393
|
+
const normalizedOptions = normalizeArray(options);
|
|
1394
|
+
const clone = [...this.options];
|
|
1395
|
+
clone.splice(
|
|
1396
|
+
index,
|
|
1397
|
+
deleteCount,
|
|
1398
|
+
...normalizedOptions.map(
|
|
1399
|
+
(normalizedOption) => normalizedOption instanceof StringSelectMenuOptionBuilder ? normalizedOption : new StringSelectMenuOptionBuilder(selectMenuStringOptionPredicate.parse(normalizedOption))
|
|
1400
|
+
)
|
|
1401
|
+
);
|
|
1402
|
+
optionsLengthValidator.parse(clone.length);
|
|
1403
|
+
this.options.splice(0, this.options.length, ...clone);
|
|
1404
|
+
return this;
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* {@inheritDoc BaseSelectMenuBuilder.toJSON}
|
|
1408
|
+
*/
|
|
1409
|
+
toJSON() {
|
|
1410
|
+
validateRequiredSelectMenuParameters(this.options, this.data.custom_id);
|
|
1411
|
+
return {
|
|
1412
|
+
...this.data,
|
|
1413
|
+
options: this.options.map((option) => option.toJSON())
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
// src/components/selectMenu/UserSelectMenu.ts
|
|
1419
|
+
var import_v1011 = require("discord-api-types/v10");
|
|
1420
|
+
var UserSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
1421
|
+
static {
|
|
1422
|
+
__name(this, "UserSelectMenuBuilder");
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Creates a new select menu from API data.
|
|
1426
|
+
*
|
|
1427
|
+
* @param data - The API data to create this select menu with
|
|
1428
|
+
* @example
|
|
1429
|
+
* Creating a select menu from an API data object:
|
|
1430
|
+
* ```ts
|
|
1431
|
+
* const selectMenu = new UserSelectMenuBuilder({
|
|
1432
|
+
* custom_id: 'a cool select menu',
|
|
1433
|
+
* placeholder: 'select an option',
|
|
1434
|
+
* max_values: 2,
|
|
1435
|
+
* });
|
|
1436
|
+
* ```
|
|
1437
|
+
* @example
|
|
1438
|
+
* Creating a select menu using setters and API data:
|
|
1439
|
+
* ```ts
|
|
1440
|
+
* const selectMenu = new UserSelectMenuBuilder({
|
|
1441
|
+
* custom_id: 'a cool select menu',
|
|
1442
|
+
* })
|
|
1443
|
+
* .setMinValues(1);
|
|
1444
|
+
* ```
|
|
1445
|
+
*/
|
|
1446
|
+
constructor(data) {
|
|
1447
|
+
super({ ...data, type: import_v1011.ComponentType.UserSelect });
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Adds default users to this auto populated select menu.
|
|
1451
|
+
*
|
|
1452
|
+
* @param users - The users to add
|
|
1453
|
+
*/
|
|
1454
|
+
addDefaultUsers(...users) {
|
|
1455
|
+
const normalizedValues = normalizeArray(users);
|
|
1456
|
+
optionsLengthValidator.parse((this.data.default_values?.length ?? 0) + normalizedValues.length);
|
|
1457
|
+
this.data.default_values ??= [];
|
|
1458
|
+
this.data.default_values.push(
|
|
1459
|
+
...normalizedValues.map((id) => ({
|
|
1460
|
+
id,
|
|
1461
|
+
type: import_v1011.SelectMenuDefaultValueType.User
|
|
1462
|
+
}))
|
|
1463
|
+
);
|
|
1464
|
+
return this;
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Sets default users for this auto populated select menu.
|
|
1468
|
+
*
|
|
1469
|
+
* @param users - The users to set
|
|
1470
|
+
*/
|
|
1471
|
+
setDefaultUsers(...users) {
|
|
1472
|
+
const normalizedValues = normalizeArray(users);
|
|
1473
|
+
optionsLengthValidator.parse(normalizedValues.length);
|
|
1474
|
+
this.data.default_values = normalizedValues.map((id) => ({
|
|
1475
|
+
id,
|
|
1476
|
+
type: import_v1011.SelectMenuDefaultValueType.User
|
|
1477
|
+
}));
|
|
1478
|
+
return this;
|
|
1479
|
+
}
|
|
1480
|
+
};
|
|
1481
|
+
|
|
1482
|
+
// src/components/textInput/TextInput.ts
|
|
1483
|
+
var import_util = require("@discordjs/util");
|
|
1484
|
+
var import_v1012 = require("discord-api-types/v10");
|
|
1485
|
+
var import_fast_deep_equal = __toESM(require("fast-deep-equal"));
|
|
1486
|
+
var TextInputBuilder = class extends ComponentBuilder {
|
|
1487
|
+
static {
|
|
1488
|
+
__name(this, "TextInputBuilder");
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Creates a new text input from API data.
|
|
1492
|
+
*
|
|
1493
|
+
* @param data - The API data to create this text input with
|
|
1494
|
+
* @example
|
|
1495
|
+
* Creating a text input from an API data object:
|
|
1496
|
+
* ```ts
|
|
1497
|
+
* const textInput = new TextInputBuilder({
|
|
1498
|
+
* custom_id: 'a cool text input',
|
|
1499
|
+
* placeholder: 'Type something',
|
|
1500
|
+
* style: TextInputStyle.Short,
|
|
1501
|
+
* });
|
|
1502
|
+
* ```
|
|
1503
|
+
* @example
|
|
1504
|
+
* Creating a text input using setters and API data:
|
|
1505
|
+
* ```ts
|
|
1506
|
+
* const textInput = new TextInputBuilder({
|
|
1507
|
+
* placeholder: 'Type something else',
|
|
1508
|
+
* })
|
|
1509
|
+
* .setCustomId('woah')
|
|
1510
|
+
* .setStyle(TextInputStyle.Paragraph);
|
|
1511
|
+
* ```
|
|
1512
|
+
*/
|
|
1513
|
+
constructor(data) {
|
|
1514
|
+
super({ type: import_v1012.ComponentType.TextInput, ...data });
|
|
1515
|
+
}
|
|
1516
|
+
/**
|
|
1517
|
+
* Sets the custom id for this text input.
|
|
1518
|
+
*
|
|
1519
|
+
* @param customId - The custom id to use
|
|
1520
|
+
*/
|
|
1521
|
+
setCustomId(customId) {
|
|
1522
|
+
this.data.custom_id = customIdValidator.parse(customId);
|
|
1523
|
+
return this;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Sets the label for this text input.
|
|
1527
|
+
*
|
|
1528
|
+
* @param label - The label to use
|
|
1529
|
+
* @deprecated Use a label builder to create a label (and optionally a description) instead.
|
|
1530
|
+
*/
|
|
1531
|
+
setLabel(label) {
|
|
1532
|
+
this.data.label = labelValidator.parse(label);
|
|
1533
|
+
return this;
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Sets the style for this text input.
|
|
1537
|
+
*
|
|
1538
|
+
* @param style - The style to use
|
|
1539
|
+
*/
|
|
1540
|
+
setStyle(style) {
|
|
1541
|
+
this.data.style = textInputStyleValidator.parse(style);
|
|
1542
|
+
return this;
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Sets the minimum length of text for this text input.
|
|
1546
|
+
*
|
|
1547
|
+
* @param minLength - The minimum length of text for this text input
|
|
1548
|
+
*/
|
|
1549
|
+
setMinLength(minLength) {
|
|
1550
|
+
this.data.min_length = minLengthValidator.parse(minLength);
|
|
1551
|
+
return this;
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* Sets the maximum length of text for this text input.
|
|
1555
|
+
*
|
|
1556
|
+
* @param maxLength - The maximum length of text for this text input
|
|
1557
|
+
*/
|
|
1558
|
+
setMaxLength(maxLength) {
|
|
1559
|
+
this.data.max_length = maxLengthValidator.parse(maxLength);
|
|
1560
|
+
return this;
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Sets the placeholder for this text input.
|
|
1564
|
+
*
|
|
1565
|
+
* @param placeholder - The placeholder to use
|
|
1566
|
+
*/
|
|
1567
|
+
setPlaceholder(placeholder) {
|
|
1568
|
+
this.data.placeholder = placeholderValidator2.parse(placeholder);
|
|
1569
|
+
return this;
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Sets the value for this text input.
|
|
1573
|
+
*
|
|
1574
|
+
* @param value - The value to use
|
|
1575
|
+
*/
|
|
1576
|
+
setValue(value) {
|
|
1577
|
+
this.data.value = valueValidator.parse(value);
|
|
1578
|
+
return this;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Sets whether this text input is required.
|
|
1582
|
+
*
|
|
1583
|
+
* @param required - Whether this text input is required
|
|
1584
|
+
*/
|
|
1585
|
+
setRequired(required = true) {
|
|
1586
|
+
this.data.required = requiredValidator.parse(required);
|
|
1587
|
+
return this;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1591
|
+
*/
|
|
1592
|
+
toJSON() {
|
|
1593
|
+
validateRequiredParameters(this.data.custom_id, this.data.style);
|
|
1594
|
+
return {
|
|
1595
|
+
...this.data
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Whether this is equal to another structure.
|
|
1600
|
+
*/
|
|
1601
|
+
equals(other) {
|
|
1602
|
+
if ((0, import_util.isJSONEncodable)(other)) {
|
|
1603
|
+
return (0, import_fast_deep_equal.default)(other.toJSON(), this.data);
|
|
1604
|
+
}
|
|
1605
|
+
return (0, import_fast_deep_equal.default)(other, this.data);
|
|
1606
|
+
}
|
|
1607
|
+
};
|
|
1608
|
+
|
|
1609
|
+
// src/components/label/Assertions.ts
|
|
1610
|
+
var Assertions_exports6 = {};
|
|
1611
|
+
__export(Assertions_exports6, {
|
|
1612
|
+
labelPredicate: () => labelPredicate
|
|
1613
|
+
});
|
|
1614
|
+
var import_shapeshift6 = require("@sapphire/shapeshift");
|
|
1615
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
1616
|
+
var labelPredicate = import_shapeshift6.s.object({
|
|
1617
|
+
id: idValidator.optional(),
|
|
1618
|
+
type: import_shapeshift6.s.literal(import_v1013.ComponentType.Label),
|
|
1619
|
+
label: import_shapeshift6.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45),
|
|
1620
|
+
description: import_shapeshift6.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).optional(),
|
|
1621
|
+
component: import_shapeshift6.s.union([
|
|
1622
|
+
textInputPredicate,
|
|
1623
|
+
selectMenuUserPredicate,
|
|
1624
|
+
selectMenuRolePredicate,
|
|
1625
|
+
selectMenuMentionablePredicate,
|
|
1626
|
+
selectMenuChannelPredicate,
|
|
1627
|
+
selectMenuStringPredicate,
|
|
1628
|
+
fileUploadPredicate
|
|
1629
|
+
])
|
|
1630
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1631
|
+
|
|
1632
|
+
// src/components/label/Label.ts
|
|
1633
|
+
var LabelBuilder = class extends ComponentBuilder {
|
|
1634
|
+
static {
|
|
1635
|
+
__name(this, "LabelBuilder");
|
|
1636
|
+
}
|
|
1637
|
+
/**
|
|
1638
|
+
* @internal
|
|
1639
|
+
*/
|
|
1640
|
+
data;
|
|
1641
|
+
/**
|
|
1642
|
+
* Creates a new label.
|
|
1643
|
+
*
|
|
1644
|
+
* @param data - The API data to create this label with
|
|
1645
|
+
* @example
|
|
1646
|
+
* Creating a label from an API data object:
|
|
1647
|
+
* ```ts
|
|
1648
|
+
* const label = new LabelBuilder({
|
|
1649
|
+
* label: "label",
|
|
1650
|
+
* component,
|
|
1651
|
+
* });
|
|
1652
|
+
* ```
|
|
1653
|
+
* @example
|
|
1654
|
+
* Creating a label using setters and API data:
|
|
1655
|
+
* ```ts
|
|
1656
|
+
* const label = new LabelBuilder({
|
|
1657
|
+
* label: 'label',
|
|
1658
|
+
* component,
|
|
1659
|
+
* }).setLabel('new text');
|
|
1660
|
+
* ```
|
|
1661
|
+
*/
|
|
1662
|
+
constructor(data = {}) {
|
|
1663
|
+
super({ type: import_v1014.ComponentType.Label });
|
|
1664
|
+
const { component, ...rest } = data;
|
|
1665
|
+
this.data = {
|
|
1666
|
+
...rest,
|
|
1667
|
+
component: component ? createComponentBuilder(component) : void 0,
|
|
1668
|
+
type: import_v1014.ComponentType.Label
|
|
1669
|
+
};
|
|
1670
|
+
}
|
|
1671
|
+
/**
|
|
1672
|
+
* Sets the label for this label.
|
|
1673
|
+
*
|
|
1674
|
+
* @param label - The label to use
|
|
1675
|
+
*/
|
|
1676
|
+
setLabel(label) {
|
|
1677
|
+
this.data.label = label;
|
|
1678
|
+
return this;
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Sets the description for this label.
|
|
1682
|
+
*
|
|
1683
|
+
* @param description - The description to use
|
|
1684
|
+
*/
|
|
1685
|
+
setDescription(description) {
|
|
1686
|
+
this.data.description = description;
|
|
1687
|
+
return this;
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* Clears the description for this label.
|
|
1691
|
+
*/
|
|
1692
|
+
clearDescription() {
|
|
1693
|
+
this.data.description = void 0;
|
|
1694
|
+
return this;
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Sets a string select menu component to this label.
|
|
1698
|
+
*
|
|
1699
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
1700
|
+
*/
|
|
1701
|
+
setStringSelectMenuComponent(input) {
|
|
1702
|
+
this.data.component = resolveBuilder(input, StringSelectMenuBuilder);
|
|
1703
|
+
return this;
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Sets a user select menu component to this label.
|
|
1707
|
+
*
|
|
1708
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
1709
|
+
*/
|
|
1710
|
+
setUserSelectMenuComponent(input) {
|
|
1711
|
+
this.data.component = resolveBuilder(input, UserSelectMenuBuilder);
|
|
1712
|
+
return this;
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* Sets a role select menu component to this label.
|
|
1716
|
+
*
|
|
1717
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
1718
|
+
*/
|
|
1719
|
+
setRoleSelectMenuComponent(input) {
|
|
1720
|
+
this.data.component = resolveBuilder(input, RoleSelectMenuBuilder);
|
|
1721
|
+
return this;
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* Sets a mentionable select menu component to this label.
|
|
1725
|
+
*
|
|
1726
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
1727
|
+
*/
|
|
1728
|
+
setMentionableSelectMenuComponent(input) {
|
|
1729
|
+
this.data.component = resolveBuilder(input, MentionableSelectMenuBuilder);
|
|
1730
|
+
return this;
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* Sets a channel select menu component to this label.
|
|
1734
|
+
*
|
|
1735
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
1736
|
+
*/
|
|
1737
|
+
setChannelSelectMenuComponent(input) {
|
|
1738
|
+
this.data.component = resolveBuilder(input, ChannelSelectMenuBuilder);
|
|
1739
|
+
return this;
|
|
1740
|
+
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Sets a text input component to this label.
|
|
1743
|
+
*
|
|
1744
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
1745
|
+
*/
|
|
1746
|
+
setTextInputComponent(input) {
|
|
1747
|
+
this.data.component = resolveBuilder(input, TextInputBuilder);
|
|
1748
|
+
return this;
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* Sets a file upload component to this label.
|
|
1752
|
+
*
|
|
1753
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
1754
|
+
*/
|
|
1755
|
+
setFileUploadComponent(input) {
|
|
1756
|
+
this.data.component = resolveBuilder(input, FileUploadBuilder);
|
|
1757
|
+
return this;
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1761
|
+
*/
|
|
1762
|
+
toJSON() {
|
|
1763
|
+
const { component, ...rest } = this.data;
|
|
1764
|
+
const data = {
|
|
1765
|
+
...rest,
|
|
1766
|
+
// The label predicate validates the component.
|
|
1767
|
+
component: component?.toJSON()
|
|
1768
|
+
};
|
|
1769
|
+
labelPredicate.parse(data);
|
|
1770
|
+
return data;
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1773
|
+
|
|
1774
|
+
// src/components/v2/Container.ts
|
|
1775
|
+
var import_v1020 = require("discord-api-types/v10");
|
|
1776
|
+
|
|
1777
|
+
// src/components/v2/Assertions.ts
|
|
1778
|
+
var Assertions_exports7 = {};
|
|
1779
|
+
__export(Assertions_exports7, {
|
|
1780
|
+
accessoryPredicate: () => accessoryPredicate,
|
|
1781
|
+
assertReturnOfBuilder: () => assertReturnOfBuilder,
|
|
1782
|
+
containerColorPredicate: () => containerColorPredicate,
|
|
1783
|
+
descriptionPredicate: () => descriptionPredicate2,
|
|
1784
|
+
dividerPredicate: () => dividerPredicate,
|
|
1785
|
+
filePredicate: () => filePredicate,
|
|
1786
|
+
spacingPredicate: () => spacingPredicate,
|
|
1787
|
+
spoilerPredicate: () => spoilerPredicate,
|
|
1788
|
+
textDisplayContentPredicate: () => textDisplayContentPredicate,
|
|
1789
|
+
unfurledMediaItemPredicate: () => unfurledMediaItemPredicate,
|
|
1790
|
+
validateComponentArray: () => validateComponentArray
|
|
1791
|
+
});
|
|
1792
|
+
var import_shapeshift7 = require("@sapphire/shapeshift");
|
|
1793
|
+
var import_v1016 = require("discord-api-types/v10");
|
|
1794
|
+
|
|
1795
|
+
// src/components/v2/Thumbnail.ts
|
|
1796
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
1797
|
+
var ThumbnailBuilder = class extends ComponentBuilder {
|
|
1798
|
+
static {
|
|
1799
|
+
__name(this, "ThumbnailBuilder");
|
|
1800
|
+
}
|
|
1801
|
+
/**
|
|
1802
|
+
* Creates a new thumbnail from API data.
|
|
1803
|
+
*
|
|
1804
|
+
* @param data - The API data to create this thumbnail with
|
|
1805
|
+
* @example
|
|
1806
|
+
* Creating a thumbnail from an API data object:
|
|
1807
|
+
* ```ts
|
|
1808
|
+
* const thumbnail = new ThumbnailBuilder({
|
|
1809
|
+
* description: 'some text',
|
|
1810
|
+
* media: {
|
|
1811
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',
|
|
1812
|
+
* },
|
|
1813
|
+
* });
|
|
1814
|
+
* ```
|
|
1815
|
+
* @example
|
|
1816
|
+
* Creating a thumbnail using setters and API data:
|
|
1817
|
+
* ```ts
|
|
1818
|
+
* const thumbnail = new ThumbnailBuilder({
|
|
1819
|
+
* media: {
|
|
1820
|
+
* url: 'attachment://image.png',
|
|
1821
|
+
* },
|
|
1822
|
+
* })
|
|
1823
|
+
* .setDescription('alt text');
|
|
1824
|
+
* ```
|
|
1825
|
+
*/
|
|
1826
|
+
constructor(data = {}) {
|
|
1827
|
+
super({
|
|
1828
|
+
type: import_v1015.ComponentType.Thumbnail,
|
|
1829
|
+
...data,
|
|
1830
|
+
media: data.media ? { url: data.media.url } : void 0
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Sets the description of this thumbnail.
|
|
1835
|
+
*
|
|
1836
|
+
* @param description - The description to use
|
|
1837
|
+
*/
|
|
1838
|
+
setDescription(description) {
|
|
1839
|
+
this.data.description = descriptionPredicate2.parse(description);
|
|
1840
|
+
return this;
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* Clears the description of this thumbnail.
|
|
1844
|
+
*/
|
|
1845
|
+
clearDescription() {
|
|
1846
|
+
this.data.description = void 0;
|
|
1847
|
+
return this;
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Sets the spoiler status of this thumbnail.
|
|
1851
|
+
*
|
|
1852
|
+
* @param spoiler - The spoiler status to use
|
|
1853
|
+
*/
|
|
1854
|
+
setSpoiler(spoiler = true) {
|
|
1855
|
+
this.data.spoiler = spoilerPredicate.parse(spoiler);
|
|
1856
|
+
return this;
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* Sets the media URL of this thumbnail.
|
|
1860
|
+
*
|
|
1861
|
+
* @param url - The URL to use
|
|
1862
|
+
*/
|
|
1863
|
+
setURL(url) {
|
|
1864
|
+
this.data.media = unfurledMediaItemPredicate.parse({ url });
|
|
1865
|
+
return this;
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* {@inheritdoc ComponentBuilder.toJSON}
|
|
1869
|
+
*/
|
|
1870
|
+
toJSON() {
|
|
1871
|
+
unfurledMediaItemPredicate.parse(this.data.media);
|
|
1872
|
+
return { ...this.data };
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1875
|
+
|
|
1876
|
+
// src/components/v2/Assertions.ts
|
|
1877
|
+
var unfurledMediaItemPredicate = import_shapeshift7.s.object({
|
|
1878
|
+
url: import_shapeshift7.s.string().url(
|
|
1879
|
+
{ allowedProtocols: ["http:", "https:", "attachment:"] },
|
|
1880
|
+
{ message: "Invalid protocol for media URL. Must be http:, https:, or attachment:" }
|
|
1881
|
+
)
|
|
1882
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1883
|
+
var descriptionPredicate2 = import_shapeshift7.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(1024).setValidationEnabled(isValidationEnabled);
|
|
1884
|
+
var filePredicate = import_shapeshift7.s.object({
|
|
1885
|
+
url: import_shapeshift7.s.string().url({ allowedProtocols: ["attachment:"] }, { message: "Invalid protocol for file URL. Must be attachment:" })
|
|
1886
|
+
}).setValidationEnabled(isValidationEnabled);
|
|
1887
|
+
var spoilerPredicate = import_shapeshift7.s.boolean();
|
|
1888
|
+
var dividerPredicate = import_shapeshift7.s.boolean();
|
|
1889
|
+
var spacingPredicate = import_shapeshift7.s.nativeEnum(import_v1016.SeparatorSpacingSize);
|
|
1890
|
+
var textDisplayContentPredicate = import_shapeshift7.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled);
|
|
1891
|
+
var accessoryPredicate = import_shapeshift7.s.instance(ButtonBuilder).or(import_shapeshift7.s.instance(ThumbnailBuilder)).setValidationEnabled(isValidationEnabled);
|
|
1892
|
+
var containerColorPredicate = colorPredicate.nullish();
|
|
1893
|
+
function assertReturnOfBuilder(input, ExpectedInstanceOf) {
|
|
1894
|
+
import_shapeshift7.s.instance(ExpectedInstanceOf).setValidationEnabled(isValidationEnabled).parse(input);
|
|
1895
|
+
}
|
|
1896
|
+
__name(assertReturnOfBuilder, "assertReturnOfBuilder");
|
|
1897
|
+
function validateComponentArray(input, min, max, ExpectedInstanceOf) {
|
|
1898
|
+
(ExpectedInstanceOf ? import_shapeshift7.s.instance(ExpectedInstanceOf) : import_shapeshift7.s.instance(ComponentBuilder)).array().lengthGreaterThanOrEqual(min).lengthLessThanOrEqual(max).setValidationEnabled(isValidationEnabled).parse(input);
|
|
1899
|
+
}
|
|
1900
|
+
__name(validateComponentArray, "validateComponentArray");
|
|
1901
|
+
|
|
1902
|
+
// src/components/v2/File.ts
|
|
1903
|
+
var import_v1017 = require("discord-api-types/v10");
|
|
1904
|
+
var FileBuilder = class extends ComponentBuilder {
|
|
1905
|
+
static {
|
|
1906
|
+
__name(this, "FileBuilder");
|
|
1907
|
+
}
|
|
1908
|
+
/**
|
|
1909
|
+
* Creates a new file from API data.
|
|
1910
|
+
*
|
|
1911
|
+
* @param data - The API data to create this file with
|
|
1912
|
+
* @example
|
|
1913
|
+
* Creating a file from an API data object:
|
|
1914
|
+
* ```ts
|
|
1915
|
+
* const file = new FileBuilder({
|
|
1916
|
+
* spoiler: true,
|
|
1917
|
+
* file: {
|
|
1918
|
+
* url: 'attachment://file.png',
|
|
1919
|
+
* },
|
|
1920
|
+
* });
|
|
1921
|
+
* ```
|
|
1922
|
+
* @example
|
|
1923
|
+
* Creating a file using setters and API data:
|
|
1924
|
+
* ```ts
|
|
1925
|
+
* const file = new FileBuilder({
|
|
1926
|
+
* file: {
|
|
1927
|
+
* url: 'attachment://image.jpg',
|
|
1928
|
+
* },
|
|
1929
|
+
* })
|
|
1930
|
+
* .setSpoiler(false);
|
|
1931
|
+
* ```
|
|
1932
|
+
*/
|
|
1933
|
+
constructor(data = {}) {
|
|
1934
|
+
super({ type: import_v1017.ComponentType.File, ...data, file: data.file ? { url: data.file.url } : void 0 });
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Sets the spoiler status of this file.
|
|
1938
|
+
*
|
|
1939
|
+
* @param spoiler - The spoiler status to use
|
|
1940
|
+
*/
|
|
1941
|
+
setSpoiler(spoiler = true) {
|
|
1942
|
+
this.data.spoiler = spoilerPredicate.parse(spoiler);
|
|
1943
|
+
return this;
|
|
1944
|
+
}
|
|
1945
|
+
/**
|
|
1946
|
+
* Sets the media URL of this file.
|
|
1947
|
+
*
|
|
1948
|
+
* @param url - The URL to use
|
|
1949
|
+
*/
|
|
1950
|
+
setURL(url) {
|
|
1951
|
+
this.data.file = filePredicate.parse({ url });
|
|
1952
|
+
return this;
|
|
1953
|
+
}
|
|
1954
|
+
/**
|
|
1955
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
1956
|
+
*/
|
|
1957
|
+
toJSON() {
|
|
1958
|
+
filePredicate.parse(this.data.file);
|
|
1959
|
+
return { ...this.data, file: { ...this.data.file } };
|
|
1960
|
+
}
|
|
1961
|
+
};
|
|
1962
|
+
|
|
1963
|
+
// src/components/v2/Separator.ts
|
|
1964
|
+
var import_v1018 = require("discord-api-types/v10");
|
|
1965
|
+
var SeparatorBuilder = class extends ComponentBuilder {
|
|
1966
|
+
static {
|
|
1967
|
+
__name(this, "SeparatorBuilder");
|
|
1968
|
+
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Creates a new separator from API data.
|
|
1971
|
+
*
|
|
1972
|
+
* @param data - The API data to create this separator with
|
|
1973
|
+
* @example
|
|
1974
|
+
* Creating a separator from an API data object:
|
|
1975
|
+
* ```ts
|
|
1976
|
+
* const separator = new SeparatorBuilder({
|
|
1977
|
+
* spacing: SeparatorSpacingSize.Small,
|
|
1978
|
+
* divider: true,
|
|
1979
|
+
* });
|
|
1980
|
+
* ```
|
|
1981
|
+
* @example
|
|
1982
|
+
* Creating a separator using setters and API data:
|
|
1983
|
+
* ```ts
|
|
1984
|
+
* const separator = new SeparatorBuilder({
|
|
1985
|
+
* spacing: SeparatorSpacingSize.Large,
|
|
1986
|
+
* })
|
|
1987
|
+
* .setDivider(false);
|
|
1988
|
+
* ```
|
|
1989
|
+
*/
|
|
1990
|
+
constructor(data = {}) {
|
|
1991
|
+
super({
|
|
1992
|
+
type: import_v1018.ComponentType.Separator,
|
|
1993
|
+
...data
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* Sets whether this separator should show a divider line.
|
|
1998
|
+
*
|
|
1999
|
+
* @param divider - Whether to show a divider line
|
|
2000
|
+
*/
|
|
2001
|
+
setDivider(divider = true) {
|
|
2002
|
+
this.data.divider = dividerPredicate.parse(divider);
|
|
2003
|
+
return this;
|
|
2004
|
+
}
|
|
2005
|
+
/**
|
|
2006
|
+
* Sets the spacing of this separator.
|
|
2007
|
+
*
|
|
2008
|
+
* @param spacing - The spacing to use
|
|
2009
|
+
*/
|
|
2010
|
+
setSpacing(spacing) {
|
|
2011
|
+
this.data.spacing = spacingPredicate.parse(spacing);
|
|
2012
|
+
return this;
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* Clears the spacing of this separator.
|
|
2016
|
+
*/
|
|
2017
|
+
clearSpacing() {
|
|
2018
|
+
this.data.spacing = void 0;
|
|
2019
|
+
return this;
|
|
2020
|
+
}
|
|
2021
|
+
/**
|
|
2022
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
2023
|
+
*/
|
|
2024
|
+
toJSON() {
|
|
2025
|
+
return { ...this.data };
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
|
|
2029
|
+
// src/components/v2/TextDisplay.ts
|
|
2030
|
+
var import_v1019 = require("discord-api-types/v10");
|
|
2031
|
+
var TextDisplayBuilder = class extends ComponentBuilder {
|
|
2032
|
+
static {
|
|
2033
|
+
__name(this, "TextDisplayBuilder");
|
|
2034
|
+
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Creates a new text display from API data.
|
|
2037
|
+
*
|
|
2038
|
+
* @param data - The API data to create this text display with
|
|
2039
|
+
* @example
|
|
2040
|
+
* Creating a text display from an API data object:
|
|
2041
|
+
* ```ts
|
|
2042
|
+
* const textDisplay = new TextDisplayBuilder({
|
|
2043
|
+
* content: 'some text',
|
|
2044
|
+
* });
|
|
2045
|
+
* ```
|
|
2046
|
+
* @example
|
|
2047
|
+
* Creating a text display using setters and API data:
|
|
2048
|
+
* ```ts
|
|
2049
|
+
* const textDisplay = new TextDisplayBuilder({
|
|
2050
|
+
* content: 'old text',
|
|
2051
|
+
* })
|
|
2052
|
+
* .setContent('new text');
|
|
2053
|
+
* ```
|
|
2054
|
+
*/
|
|
2055
|
+
constructor(data = {}) {
|
|
2056
|
+
super({
|
|
2057
|
+
type: import_v1019.ComponentType.TextDisplay,
|
|
2058
|
+
...data
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Sets the text of this text display.
|
|
2063
|
+
*
|
|
2064
|
+
* @param content - The text to use
|
|
2065
|
+
*/
|
|
2066
|
+
setContent(content) {
|
|
2067
|
+
this.data.content = textDisplayContentPredicate.parse(content);
|
|
2068
|
+
return this;
|
|
2069
|
+
}
|
|
2070
|
+
/**
|
|
2071
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
2072
|
+
*/
|
|
2073
|
+
toJSON() {
|
|
2074
|
+
textDisplayContentPredicate.parse(this.data.content);
|
|
2075
|
+
return { ...this.data };
|
|
2076
|
+
}
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
// src/components/v2/Container.ts
|
|
2080
|
+
var ContainerBuilder = class extends ComponentBuilder {
|
|
2081
|
+
static {
|
|
2082
|
+
__name(this, "ContainerBuilder");
|
|
2083
|
+
}
|
|
2084
|
+
/**
|
|
2085
|
+
* The components within this container.
|
|
2086
|
+
*/
|
|
2087
|
+
components;
|
|
2088
|
+
/**
|
|
2089
|
+
* Creates a new container from API data.
|
|
2090
|
+
*
|
|
2091
|
+
* @param data - The API data to create this container with
|
|
2092
|
+
* @example
|
|
2093
|
+
* Creating a container from an API data object:
|
|
2094
|
+
* ```ts
|
|
2095
|
+
* const container = new ContainerBuilder({
|
|
2096
|
+
* components: [
|
|
2097
|
+
* {
|
|
2098
|
+
* content: "Some text here",
|
|
2099
|
+
* type: ComponentType.TextDisplay,
|
|
2100
|
+
* },
|
|
2101
|
+
* ],
|
|
2102
|
+
* });
|
|
2103
|
+
* ```
|
|
2104
|
+
* @example
|
|
2105
|
+
* Creating a container using setters and API data:
|
|
2106
|
+
* ```ts
|
|
2107
|
+
* const container = new ContainerBuilder({
|
|
2108
|
+
* components: [
|
|
2109
|
+
* {
|
|
2110
|
+
* content: "# Heading",
|
|
2111
|
+
* type: ComponentType.TextDisplay,
|
|
2112
|
+
* },
|
|
2113
|
+
* ],
|
|
2114
|
+
* })
|
|
2115
|
+
* .addSeparatorComponents(separator)
|
|
2116
|
+
* .addSectionComponents(section);
|
|
2117
|
+
* ```
|
|
2118
|
+
*/
|
|
2119
|
+
constructor({ components, ...data } = {}) {
|
|
2120
|
+
super({ type: import_v1020.ComponentType.Container, ...data });
|
|
2121
|
+
this.components = components?.map((component) => createComponentBuilder(component)) ?? [];
|
|
2122
|
+
}
|
|
2123
|
+
/**
|
|
2124
|
+
* Sets the accent color of this container.
|
|
2125
|
+
*
|
|
2126
|
+
* @param color - The color to use
|
|
2127
|
+
*/
|
|
2128
|
+
setAccentColor(color) {
|
|
2129
|
+
containerColorPredicate.parse(color);
|
|
2130
|
+
if (Array.isArray(color)) {
|
|
2131
|
+
const [red, green, blue] = color;
|
|
2132
|
+
this.data.accent_color = (red << 16) + (green << 8) + blue;
|
|
2133
|
+
return this;
|
|
2134
|
+
}
|
|
2135
|
+
this.data.accent_color = color;
|
|
2136
|
+
return this;
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Clears the accent color of this container.
|
|
2140
|
+
*/
|
|
2141
|
+
clearAccentColor() {
|
|
2142
|
+
this.data.accent_color = void 0;
|
|
2143
|
+
return this;
|
|
2144
|
+
}
|
|
2145
|
+
/**
|
|
2146
|
+
* Adds action row components to this container.
|
|
2147
|
+
*
|
|
2148
|
+
* @param components - The action row components to add
|
|
2149
|
+
*/
|
|
2150
|
+
addActionRowComponents(...components) {
|
|
2151
|
+
this.components.push(
|
|
2152
|
+
...normalizeArray(components).map((component) => resolveBuilder(component, ActionRowBuilder))
|
|
2153
|
+
);
|
|
2154
|
+
return this;
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* Adds file components to this container.
|
|
2158
|
+
*
|
|
2159
|
+
* @param components - The file components to add
|
|
2160
|
+
*/
|
|
2161
|
+
addFileComponents(...components) {
|
|
2162
|
+
this.components.push(...normalizeArray(components).map((component) => resolveBuilder(component, FileBuilder)));
|
|
2163
|
+
return this;
|
|
2164
|
+
}
|
|
2165
|
+
/**
|
|
2166
|
+
* Adds media gallery components to this container.
|
|
2167
|
+
*
|
|
2168
|
+
* @param components - The media gallery components to add
|
|
2169
|
+
*/
|
|
2170
|
+
addMediaGalleryComponents(...components) {
|
|
2171
|
+
this.components.push(
|
|
2172
|
+
...normalizeArray(components).map((component) => resolveBuilder(component, MediaGalleryBuilder))
|
|
2173
|
+
);
|
|
2174
|
+
return this;
|
|
2175
|
+
}
|
|
2176
|
+
/**
|
|
2177
|
+
* Adds section components to this container.
|
|
2178
|
+
*
|
|
2179
|
+
* @param components - The section components to add
|
|
2180
|
+
*/
|
|
2181
|
+
addSectionComponents(...components) {
|
|
2182
|
+
this.components.push(...normalizeArray(components).map((component) => resolveBuilder(component, SectionBuilder)));
|
|
2183
|
+
return this;
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* Adds separator components to this container.
|
|
2187
|
+
*
|
|
2188
|
+
* @param components - The separator components to add
|
|
2189
|
+
*/
|
|
2190
|
+
addSeparatorComponents(...components) {
|
|
2191
|
+
this.components.push(...normalizeArray(components).map((component) => resolveBuilder(component, SeparatorBuilder)));
|
|
2192
|
+
return this;
|
|
2193
|
+
}
|
|
2194
|
+
/**
|
|
2195
|
+
* Adds text display components to this container.
|
|
2196
|
+
*
|
|
2197
|
+
* @param components - The text display components to add
|
|
2198
|
+
*/
|
|
2199
|
+
addTextDisplayComponents(...components) {
|
|
2200
|
+
this.components.push(
|
|
2201
|
+
...normalizeArray(components).map((component) => resolveBuilder(component, TextDisplayBuilder))
|
|
2202
|
+
);
|
|
2203
|
+
return this;
|
|
2204
|
+
}
|
|
2205
|
+
/**
|
|
2206
|
+
* Removes, replaces, or inserts components for this container.
|
|
2207
|
+
*
|
|
2208
|
+
* @param index - The index to start removing, replacing or inserting components
|
|
2209
|
+
* @param deleteCount - The amount of components to remove
|
|
2210
|
+
* @param components - The components to set
|
|
2211
|
+
*/
|
|
2212
|
+
spliceComponents(index, deleteCount, ...components) {
|
|
2213
|
+
this.components.splice(
|
|
2214
|
+
index,
|
|
2215
|
+
deleteCount,
|
|
2216
|
+
...normalizeArray(components).map(
|
|
2217
|
+
(component) => component instanceof ComponentBuilder ? component : createComponentBuilder(component)
|
|
2218
|
+
)
|
|
2219
|
+
);
|
|
2220
|
+
return this;
|
|
2221
|
+
}
|
|
2222
|
+
/**
|
|
2223
|
+
* Sets the spoiler status of this container.
|
|
2224
|
+
*
|
|
2225
|
+
* @param spoiler - The spoiler status to use
|
|
2226
|
+
*/
|
|
2227
|
+
setSpoiler(spoiler = true) {
|
|
2228
|
+
this.data.spoiler = spoilerPredicate.parse(spoiler);
|
|
2229
|
+
return this;
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
2233
|
+
*/
|
|
2234
|
+
toJSON() {
|
|
2235
|
+
return {
|
|
2236
|
+
...this.data,
|
|
2237
|
+
components: this.components.map((component) => component.toJSON())
|
|
2238
|
+
};
|
|
2239
|
+
}
|
|
2240
|
+
};
|
|
2241
|
+
|
|
2242
|
+
// src/components/v2/MediaGallery.ts
|
|
2243
|
+
var import_v1021 = require("discord-api-types/v10");
|
|
2244
|
+
|
|
2245
|
+
// src/components/v2/MediaGalleryItem.ts
|
|
2246
|
+
var MediaGalleryItemBuilder = class {
|
|
2247
|
+
static {
|
|
2248
|
+
__name(this, "MediaGalleryItemBuilder");
|
|
2249
|
+
}
|
|
2250
|
+
/**
|
|
2251
|
+
* The API data associated with this media gallery item.
|
|
2252
|
+
*/
|
|
2253
|
+
data;
|
|
2254
|
+
/**
|
|
2255
|
+
* Creates a new media gallery item from API data.
|
|
2256
|
+
*
|
|
2257
|
+
* @param data - The API data to create this media gallery item with
|
|
2258
|
+
* @example
|
|
2259
|
+
* Creating a media gallery item from an API data object:
|
|
2260
|
+
* ```ts
|
|
2261
|
+
* const item = new MediaGalleryItemBuilder({
|
|
2262
|
+
* description: "Some text here",
|
|
2263
|
+
* media: {
|
|
2264
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
|
|
2265
|
+
* },
|
|
2266
|
+
* });
|
|
2267
|
+
* ```
|
|
2268
|
+
* @example
|
|
2269
|
+
* Creating a media gallery item using setters and API data:
|
|
2270
|
+
* ```ts
|
|
2271
|
+
* const item = new MediaGalleryItemBuilder({
|
|
2272
|
+
* media: {
|
|
2273
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
|
|
2274
|
+
* },
|
|
2275
|
+
* })
|
|
2276
|
+
* .setDescription("alt text");
|
|
2277
|
+
* ```
|
|
2278
|
+
*/
|
|
2279
|
+
constructor(data = {}) {
|
|
2280
|
+
this.data = data;
|
|
2281
|
+
}
|
|
2282
|
+
/**
|
|
2283
|
+
* Sets the description of this media gallery item.
|
|
2284
|
+
*
|
|
2285
|
+
* @param description - The description to use
|
|
2286
|
+
*/
|
|
2287
|
+
setDescription(description) {
|
|
2288
|
+
this.data.description = descriptionPredicate2.parse(description);
|
|
2289
|
+
return this;
|
|
2290
|
+
}
|
|
2291
|
+
/**
|
|
2292
|
+
* Clears the description of this media gallery item.
|
|
2293
|
+
*/
|
|
2294
|
+
clearDescription() {
|
|
2295
|
+
this.data.description = void 0;
|
|
2296
|
+
return this;
|
|
2297
|
+
}
|
|
2298
|
+
/**
|
|
2299
|
+
* Sets the spoiler status of this media gallery item.
|
|
2300
|
+
*
|
|
2301
|
+
* @param spoiler - The spoiler status to use
|
|
2302
|
+
*/
|
|
2303
|
+
setSpoiler(spoiler = true) {
|
|
2304
|
+
this.data.spoiler = spoilerPredicate.parse(spoiler);
|
|
2305
|
+
return this;
|
|
2306
|
+
}
|
|
2307
|
+
/**
|
|
2308
|
+
* Sets the media URL of this media gallery item.
|
|
2309
|
+
*
|
|
2310
|
+
* @param url - The URL to use
|
|
2311
|
+
*/
|
|
2312
|
+
setURL(url) {
|
|
2313
|
+
this.data.media = unfurledMediaItemPredicate.parse({ url });
|
|
2314
|
+
return this;
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Serializes this builder to API-compatible JSON data.
|
|
2318
|
+
*
|
|
2319
|
+
* @remarks
|
|
2320
|
+
* This method runs validations on the data before serializing it.
|
|
2321
|
+
* As such, it may throw an error if the data is invalid.
|
|
2322
|
+
*/
|
|
2323
|
+
toJSON() {
|
|
2324
|
+
unfurledMediaItemPredicate.parse(this.data.media);
|
|
2325
|
+
return { ...this.data };
|
|
2326
|
+
}
|
|
2327
|
+
};
|
|
2328
|
+
|
|
2329
|
+
// src/components/v2/MediaGallery.ts
|
|
2330
|
+
var MediaGalleryBuilder = class extends ComponentBuilder {
|
|
2331
|
+
static {
|
|
2332
|
+
__name(this, "MediaGalleryBuilder");
|
|
2333
|
+
}
|
|
2334
|
+
/**
|
|
2335
|
+
* The components within this container.
|
|
2336
|
+
*/
|
|
2337
|
+
items;
|
|
2338
|
+
/**
|
|
2339
|
+
* Creates a new media gallery from API data.
|
|
2340
|
+
*
|
|
2341
|
+
* @param data - The API data to create this media gallery with
|
|
2342
|
+
* @example
|
|
2343
|
+
* Creating a media gallery from an API data object:
|
|
2344
|
+
* ```ts
|
|
2345
|
+
* const mediaGallery = new MediaGalleryBuilder({
|
|
2346
|
+
* items: [
|
|
2347
|
+
* {
|
|
2348
|
+
* description: "Some text here",
|
|
2349
|
+
* media: {
|
|
2350
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
|
|
2351
|
+
* },
|
|
2352
|
+
* },
|
|
2353
|
+
* ],
|
|
2354
|
+
* });
|
|
2355
|
+
* ```
|
|
2356
|
+
* @example
|
|
2357
|
+
* Creating a media gallery using setters and API data:
|
|
2358
|
+
* ```ts
|
|
2359
|
+
* const mediaGallery = new MediaGalleryBuilder({
|
|
2360
|
+
* items: [
|
|
2361
|
+
* {
|
|
2362
|
+
* description: "alt text",
|
|
2363
|
+
* media: {
|
|
2364
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
|
|
2365
|
+
* },
|
|
2366
|
+
* },
|
|
2367
|
+
* ],
|
|
2368
|
+
* })
|
|
2369
|
+
* .addItems(item2, item3);
|
|
2370
|
+
* ```
|
|
2371
|
+
*/
|
|
2372
|
+
constructor({ items, ...data } = {}) {
|
|
2373
|
+
super({ type: import_v1021.ComponentType.MediaGallery, ...data });
|
|
2374
|
+
this.items = items?.map((item) => new MediaGalleryItemBuilder(item)) ?? [];
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* Adds items to this media gallery.
|
|
2378
|
+
*
|
|
2379
|
+
* @param items - The items to add
|
|
2380
|
+
*/
|
|
2381
|
+
addItems(...items) {
|
|
2382
|
+
this.items.push(
|
|
2383
|
+
...normalizeArray(items).map((input) => {
|
|
2384
|
+
const result = resolveBuilder(input, MediaGalleryItemBuilder);
|
|
2385
|
+
assertReturnOfBuilder(result, MediaGalleryItemBuilder);
|
|
2386
|
+
return result;
|
|
2387
|
+
})
|
|
2388
|
+
);
|
|
2389
|
+
return this;
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Removes, replaces, or inserts media gallery items for this media gallery.
|
|
2393
|
+
*
|
|
2394
|
+
* @param index - The index to start removing, replacing or inserting items
|
|
2395
|
+
* @param deleteCount - The amount of items to remove
|
|
2396
|
+
* @param items - The items to insert
|
|
2397
|
+
*/
|
|
2398
|
+
spliceItems(index, deleteCount, ...items) {
|
|
2399
|
+
this.items.splice(
|
|
2400
|
+
index,
|
|
2401
|
+
deleteCount,
|
|
2402
|
+
...normalizeArray(items).map((input) => {
|
|
2403
|
+
const result = resolveBuilder(input, MediaGalleryItemBuilder);
|
|
2404
|
+
assertReturnOfBuilder(result, MediaGalleryItemBuilder);
|
|
2405
|
+
return result;
|
|
2406
|
+
})
|
|
2407
|
+
);
|
|
2408
|
+
return this;
|
|
2409
|
+
}
|
|
2410
|
+
/**
|
|
2411
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
2412
|
+
*/
|
|
2413
|
+
toJSON() {
|
|
2414
|
+
validateComponentArray(this.items, 1, 10, MediaGalleryItemBuilder);
|
|
2415
|
+
return {
|
|
2416
|
+
...this.data,
|
|
2417
|
+
items: this.items.map((item) => item.toJSON())
|
|
2418
|
+
};
|
|
2419
|
+
}
|
|
2420
|
+
};
|
|
2421
|
+
|
|
2422
|
+
// src/components/v2/Section.ts
|
|
2423
|
+
var import_v1022 = require("discord-api-types/v10");
|
|
2424
|
+
var SectionBuilder = class extends ComponentBuilder {
|
|
2425
|
+
static {
|
|
2426
|
+
__name(this, "SectionBuilder");
|
|
2427
|
+
}
|
|
2428
|
+
/**
|
|
2429
|
+
* The components within this section.
|
|
2430
|
+
*/
|
|
2431
|
+
components;
|
|
2432
|
+
/**
|
|
2433
|
+
* The accessory of this section.
|
|
2434
|
+
*/
|
|
2435
|
+
accessory;
|
|
2436
|
+
/**
|
|
2437
|
+
* Creates a new section from API data.
|
|
2438
|
+
*
|
|
2439
|
+
* @param data - The API data to create this section with
|
|
2440
|
+
* @example
|
|
2441
|
+
* Creating a section from an API data object:
|
|
2442
|
+
* ```ts
|
|
2443
|
+
* const section = new SectionBuilder({
|
|
2444
|
+
* components: [
|
|
2445
|
+
* {
|
|
2446
|
+
* content: "Some text here",
|
|
2447
|
+
* type: ComponentType.TextDisplay,
|
|
2448
|
+
* },
|
|
2449
|
+
* ],
|
|
2450
|
+
* accessory: {
|
|
2451
|
+
* media: {
|
|
2452
|
+
* url: 'https://cdn.discordapp.com/embed/avatars/3.png',
|
|
2453
|
+
* },
|
|
2454
|
+
* }
|
|
2455
|
+
* });
|
|
2456
|
+
* ```
|
|
2457
|
+
* @example
|
|
2458
|
+
* Creating a section using setters and API data:
|
|
2459
|
+
* ```ts
|
|
2460
|
+
* const section = new SectionBuilder({
|
|
2461
|
+
* components: [
|
|
2462
|
+
* {
|
|
2463
|
+
* content: "# Heading",
|
|
2464
|
+
* type: ComponentType.TextDisplay,
|
|
2465
|
+
* },
|
|
2466
|
+
* ],
|
|
2467
|
+
* })
|
|
2468
|
+
* .setPrimaryButtonAccessory(button);
|
|
2469
|
+
* ```
|
|
2470
|
+
*/
|
|
2471
|
+
constructor({ components, accessory, ...data } = {}) {
|
|
2472
|
+
super({ type: import_v1022.ComponentType.Section, ...data });
|
|
2473
|
+
this.components = components?.map((component) => createComponentBuilder(component)) ?? [];
|
|
2474
|
+
this.accessory = accessory ? createComponentBuilder(accessory) : void 0;
|
|
2475
|
+
}
|
|
2476
|
+
/**
|
|
2477
|
+
* Sets the accessory of this section to a button.
|
|
2478
|
+
*
|
|
2479
|
+
* @param accessory - The accessory to use
|
|
2480
|
+
*/
|
|
2481
|
+
setButtonAccessory(accessory) {
|
|
2482
|
+
Reflect.set(this, "accessory", accessoryPredicate.parse(resolveBuilder(accessory, ButtonBuilder)));
|
|
2483
|
+
return this;
|
|
2484
|
+
}
|
|
2485
|
+
/**
|
|
2486
|
+
* Sets the accessory of this section to a thumbnail.
|
|
2487
|
+
*
|
|
2488
|
+
* @param accessory - The accessory to use
|
|
2489
|
+
*/
|
|
2490
|
+
setThumbnailAccessory(accessory) {
|
|
2491
|
+
Reflect.set(this, "accessory", accessoryPredicate.parse(resolveBuilder(accessory, ThumbnailBuilder)));
|
|
2492
|
+
return this;
|
|
2493
|
+
}
|
|
2494
|
+
/**
|
|
2495
|
+
* Adds text display components to this section.
|
|
2496
|
+
*
|
|
2497
|
+
* @param components - The text display components to add
|
|
2498
|
+
*/
|
|
2499
|
+
addTextDisplayComponents(...components) {
|
|
2500
|
+
this.components.push(
|
|
2501
|
+
...normalizeArray(components).map((input) => {
|
|
2502
|
+
const result = resolveBuilder(input, TextDisplayBuilder);
|
|
2503
|
+
assertReturnOfBuilder(result, TextDisplayBuilder);
|
|
2504
|
+
return result;
|
|
2505
|
+
})
|
|
2506
|
+
);
|
|
2507
|
+
return this;
|
|
2508
|
+
}
|
|
2509
|
+
/**
|
|
2510
|
+
* Removes, replaces, or inserts text display components for this section.
|
|
2511
|
+
*
|
|
2512
|
+
* @param index - The index to start removing, replacing or inserting text display components
|
|
2513
|
+
* @param deleteCount - The amount of text display components to remove
|
|
2514
|
+
* @param components - The text display components to insert
|
|
2515
|
+
*/
|
|
2516
|
+
spliceTextDisplayComponents(index, deleteCount, ...components) {
|
|
2517
|
+
this.components.splice(
|
|
2518
|
+
index,
|
|
2519
|
+
deleteCount,
|
|
2520
|
+
...normalizeArray(components).map((input) => {
|
|
2521
|
+
const result = resolveBuilder(input, TextDisplayBuilder);
|
|
2522
|
+
assertReturnOfBuilder(result, TextDisplayBuilder);
|
|
2523
|
+
return result;
|
|
2524
|
+
})
|
|
2525
|
+
);
|
|
2526
|
+
return this;
|
|
2527
|
+
}
|
|
2528
|
+
/**
|
|
2529
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
2530
|
+
*/
|
|
2531
|
+
toJSON() {
|
|
2532
|
+
validateComponentArray(this.components, 1, 3, TextDisplayBuilder);
|
|
2533
|
+
return {
|
|
2534
|
+
...this.data,
|
|
2535
|
+
components: this.components.map((component) => component.toJSON()),
|
|
2536
|
+
accessory: accessoryPredicate.parse(this.accessory).toJSON()
|
|
2537
|
+
};
|
|
2538
|
+
}
|
|
2539
|
+
};
|
|
2540
|
+
|
|
2541
|
+
// src/components/Components.ts
|
|
2542
|
+
function createComponentBuilder(data) {
|
|
2543
|
+
if (data instanceof ComponentBuilder) {
|
|
2544
|
+
return data;
|
|
2545
|
+
}
|
|
2546
|
+
switch (data.type) {
|
|
2547
|
+
case import_v1023.ComponentType.ActionRow:
|
|
2548
|
+
return new ActionRowBuilder(data);
|
|
2549
|
+
case import_v1023.ComponentType.Button:
|
|
2550
|
+
return new ButtonBuilder(data);
|
|
2551
|
+
case import_v1023.ComponentType.StringSelect:
|
|
2552
|
+
return new StringSelectMenuBuilder(data);
|
|
2553
|
+
case import_v1023.ComponentType.TextInput:
|
|
2554
|
+
return new TextInputBuilder(data);
|
|
2555
|
+
case import_v1023.ComponentType.UserSelect:
|
|
2556
|
+
return new UserSelectMenuBuilder(data);
|
|
2557
|
+
case import_v1023.ComponentType.RoleSelect:
|
|
2558
|
+
return new RoleSelectMenuBuilder(data);
|
|
2559
|
+
case import_v1023.ComponentType.MentionableSelect:
|
|
2560
|
+
return new MentionableSelectMenuBuilder(data);
|
|
2561
|
+
case import_v1023.ComponentType.ChannelSelect:
|
|
2562
|
+
return new ChannelSelectMenuBuilder(data);
|
|
2563
|
+
case import_v1023.ComponentType.File:
|
|
2564
|
+
return new FileBuilder(data);
|
|
2565
|
+
case import_v1023.ComponentType.Container:
|
|
2566
|
+
return new ContainerBuilder(data);
|
|
2567
|
+
case import_v1023.ComponentType.Section:
|
|
2568
|
+
return new SectionBuilder(data);
|
|
2569
|
+
case import_v1023.ComponentType.Separator:
|
|
2570
|
+
return new SeparatorBuilder(data);
|
|
2571
|
+
case import_v1023.ComponentType.TextDisplay:
|
|
2572
|
+
return new TextDisplayBuilder(data);
|
|
2573
|
+
case import_v1023.ComponentType.Thumbnail:
|
|
2574
|
+
return new ThumbnailBuilder(data);
|
|
2575
|
+
case import_v1023.ComponentType.MediaGallery:
|
|
2576
|
+
return new MediaGalleryBuilder(data);
|
|
2577
|
+
case import_v1023.ComponentType.Label:
|
|
2578
|
+
return new LabelBuilder(data);
|
|
2579
|
+
case import_v1023.ComponentType.FileUpload:
|
|
2580
|
+
return new FileUploadBuilder(data);
|
|
2581
|
+
default:
|
|
2582
|
+
throw new Error(`Cannot properly serialize component type: ${data.type}`);
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
__name(createComponentBuilder, "createComponentBuilder");
|
|
2586
|
+
function isBuilder(builder, Constructor) {
|
|
2587
|
+
return builder instanceof Constructor;
|
|
2588
|
+
}
|
|
2589
|
+
__name(isBuilder, "isBuilder");
|
|
2590
|
+
function resolveBuilder(builder, Constructor) {
|
|
2591
|
+
if (isBuilder(builder, Constructor)) {
|
|
2592
|
+
return builder;
|
|
2593
|
+
}
|
|
2594
|
+
if (typeof builder === "function") {
|
|
2595
|
+
return builder(new Constructor());
|
|
2596
|
+
}
|
|
2597
|
+
return new Constructor(builder);
|
|
2598
|
+
}
|
|
2599
|
+
__name(resolveBuilder, "resolveBuilder");
|
|
2600
|
+
|
|
2601
|
+
// src/components/ActionRow.ts
|
|
2602
|
+
var ActionRowBuilder = class extends ComponentBuilder {
|
|
2603
|
+
static {
|
|
2604
|
+
__name(this, "ActionRowBuilder");
|
|
2605
|
+
}
|
|
2606
|
+
/**
|
|
2607
|
+
* The components within this action row.
|
|
2608
|
+
*/
|
|
2609
|
+
components;
|
|
2610
|
+
/**
|
|
2611
|
+
* Creates a new action row from API data.
|
|
2612
|
+
*
|
|
2613
|
+
* @param data - The API data to create this action row with
|
|
2614
|
+
* @example
|
|
2615
|
+
* Creating an action row from an API data object:
|
|
2616
|
+
* ```ts
|
|
2617
|
+
* const actionRow = new ActionRowBuilder({
|
|
2618
|
+
* components: [
|
|
2619
|
+
* {
|
|
2620
|
+
* custom_id: "custom id",
|
|
2621
|
+
* label: "Type something",
|
|
2622
|
+
* style: TextInputStyle.Short,
|
|
2623
|
+
* type: ComponentType.TextInput,
|
|
2624
|
+
* },
|
|
2625
|
+
* ],
|
|
2626
|
+
* });
|
|
2627
|
+
* ```
|
|
2628
|
+
* @example
|
|
2629
|
+
* Creating an action row using setters and API data:
|
|
2630
|
+
* ```ts
|
|
2631
|
+
* const actionRow = new ActionRowBuilder({
|
|
2632
|
+
* components: [
|
|
2633
|
+
* {
|
|
2634
|
+
* custom_id: "custom id",
|
|
2635
|
+
* label: "Click me",
|
|
2636
|
+
* style: ButtonStyle.Primary,
|
|
2637
|
+
* type: ComponentType.Button,
|
|
2638
|
+
* },
|
|
2639
|
+
* ],
|
|
2640
|
+
* })
|
|
2641
|
+
* .addComponents(button2, button3);
|
|
2642
|
+
* ```
|
|
2643
|
+
*/
|
|
2644
|
+
constructor({ components, ...data } = {}) {
|
|
2645
|
+
super({ type: import_v1024.ComponentType.ActionRow, ...data });
|
|
2646
|
+
this.components = components?.map((component) => createComponentBuilder(component)) ?? [];
|
|
2647
|
+
}
|
|
2648
|
+
/**
|
|
2649
|
+
* Adds components to this action row.
|
|
2650
|
+
*
|
|
2651
|
+
* @param components - The components to add
|
|
2652
|
+
*/
|
|
2653
|
+
addComponents(...components) {
|
|
2654
|
+
this.components.push(...normalizeArray(components));
|
|
2655
|
+
return this;
|
|
2656
|
+
}
|
|
2657
|
+
/**
|
|
2658
|
+
* Sets components for this action row.
|
|
2659
|
+
*
|
|
2660
|
+
* @param components - The components to set
|
|
2661
|
+
*/
|
|
2662
|
+
setComponents(...components) {
|
|
2663
|
+
this.components.splice(0, this.components.length, ...normalizeArray(components));
|
|
2664
|
+
return this;
|
|
2665
|
+
}
|
|
2666
|
+
/**
|
|
2667
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
2668
|
+
*/
|
|
2669
|
+
toJSON() {
|
|
2670
|
+
return {
|
|
2671
|
+
...this.data,
|
|
2672
|
+
components: this.components.map((component) => component.toJSON())
|
|
2673
|
+
};
|
|
2674
|
+
}
|
|
2675
|
+
};
|
|
2676
|
+
|
|
2677
|
+
// src/interactions/modals/Modal.ts
|
|
2678
|
+
var import_v1025 = require("discord-api-types/v10");
|
|
2679
|
+
|
|
2680
|
+
// src/interactions/modals/Assertions.ts
|
|
2681
|
+
var Assertions_exports8 = {};
|
|
2682
|
+
__export(Assertions_exports8, {
|
|
2683
|
+
componentsValidator: () => componentsValidator,
|
|
2684
|
+
titleValidator: () => titleValidator,
|
|
2685
|
+
validateRequiredParameters: () => validateRequiredParameters2
|
|
2686
|
+
});
|
|
2687
|
+
var import_shapeshift8 = require("@sapphire/shapeshift");
|
|
2688
|
+
var titleValidator = import_shapeshift8.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45).setValidationEnabled(isValidationEnabled);
|
|
2689
|
+
var componentsValidator = import_shapeshift8.s.union([import_shapeshift8.s.instance(ActionRowBuilder), import_shapeshift8.s.instance(LabelBuilder), import_shapeshift8.s.instance(TextDisplayBuilder)]).array().lengthGreaterThanOrEqual(1).setValidationEnabled(isValidationEnabled);
|
|
2690
|
+
function validateRequiredParameters2(customId, title, components) {
|
|
2691
|
+
customIdValidator.parse(customId);
|
|
2692
|
+
titleValidator.parse(title);
|
|
2693
|
+
componentsValidator.parse(components);
|
|
2694
|
+
}
|
|
2695
|
+
__name(validateRequiredParameters2, "validateRequiredParameters");
|
|
2696
|
+
|
|
2697
|
+
// src/interactions/modals/Modal.ts
|
|
2698
|
+
var ModalBuilder = class {
|
|
2699
|
+
static {
|
|
2700
|
+
__name(this, "ModalBuilder");
|
|
2701
|
+
}
|
|
2702
|
+
/**
|
|
2703
|
+
* The API data associated with this modal.
|
|
2704
|
+
*/
|
|
2705
|
+
data;
|
|
2706
|
+
/**
|
|
2707
|
+
* The components within this modal.
|
|
2708
|
+
*/
|
|
2709
|
+
components = [];
|
|
2710
|
+
/**
|
|
2711
|
+
* Creates a new modal from API data.
|
|
2712
|
+
*
|
|
2713
|
+
* @param data - The API data to create this modal with
|
|
2714
|
+
*/
|
|
2715
|
+
constructor({ components, ...data } = {}) {
|
|
2716
|
+
this.data = { ...data };
|
|
2717
|
+
this.components = components?.map((component) => createComponentBuilder(component)) ?? [];
|
|
2718
|
+
}
|
|
2719
|
+
/**
|
|
2720
|
+
* Sets the title of this modal.
|
|
2721
|
+
*
|
|
2722
|
+
* @param title - The title to use
|
|
2723
|
+
*/
|
|
2724
|
+
setTitle(title) {
|
|
2725
|
+
this.data.title = titleValidator.parse(title);
|
|
2726
|
+
return this;
|
|
2727
|
+
}
|
|
2728
|
+
/**
|
|
2729
|
+
* Sets the custom id of this modal.
|
|
2730
|
+
*
|
|
2731
|
+
* @param customId - The custom id to use
|
|
2732
|
+
*/
|
|
2733
|
+
setCustomId(customId) {
|
|
2734
|
+
this.data.custom_id = customIdValidator.parse(customId);
|
|
2735
|
+
return this;
|
|
2736
|
+
}
|
|
2737
|
+
/**
|
|
2738
|
+
* Adds components to this modal.
|
|
2739
|
+
*
|
|
2740
|
+
* @param components - The components to add
|
|
2741
|
+
* @deprecated Use {@link ModalBuilder.addLabelComponents} or {@link ModalBuilder.addTextDisplayComponents} instead
|
|
2742
|
+
*/
|
|
2743
|
+
addComponents(...components) {
|
|
2744
|
+
this.components.push(
|
|
2745
|
+
...normalizeArray(components).map((component, idx) => {
|
|
2746
|
+
if (component instanceof ActionRowBuilder || component instanceof LabelBuilder || component instanceof TextDisplayBuilder) {
|
|
2747
|
+
return component;
|
|
2748
|
+
}
|
|
2749
|
+
if (component instanceof TextInputBuilder) {
|
|
2750
|
+
return new ActionRowBuilder().addComponents(component);
|
|
2751
|
+
}
|
|
2752
|
+
if ("type" in component) {
|
|
2753
|
+
if (component.type === import_v1025.ComponentType.ActionRow) {
|
|
2754
|
+
return new ActionRowBuilder(component);
|
|
2755
|
+
}
|
|
2756
|
+
if (component.type === import_v1025.ComponentType.Label) {
|
|
2757
|
+
return new LabelBuilder(component);
|
|
2758
|
+
}
|
|
2759
|
+
if (component.type === import_v1025.ComponentType.TextDisplay) {
|
|
2760
|
+
return new TextDisplayBuilder(component);
|
|
2761
|
+
}
|
|
2762
|
+
if (component.type === import_v1025.ComponentType.TextInput) {
|
|
2763
|
+
return new ActionRowBuilder().addComponents(
|
|
2764
|
+
new TextInputBuilder(component)
|
|
2765
|
+
);
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
throw new TypeError(`Invalid component passed in ModalBuilder.addComponents at index ${idx}!`);
|
|
2769
|
+
})
|
|
2770
|
+
);
|
|
2771
|
+
return this;
|
|
2772
|
+
}
|
|
2773
|
+
/**
|
|
2774
|
+
* Adds label components to this modal.
|
|
2775
|
+
*
|
|
2776
|
+
* @param components - The components to add
|
|
2777
|
+
*/
|
|
2778
|
+
addLabelComponents(...components) {
|
|
2779
|
+
const normalized = normalizeArray(components);
|
|
2780
|
+
const resolved = normalized.map((label) => resolveBuilder(label, LabelBuilder));
|
|
2781
|
+
this.components.push(...resolved);
|
|
2782
|
+
return this;
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* Adds text display components to this modal.
|
|
2786
|
+
*
|
|
2787
|
+
* @param components - The components to add
|
|
2788
|
+
*/
|
|
2789
|
+
addTextDisplayComponents(...components) {
|
|
2790
|
+
const normalized = normalizeArray(components);
|
|
2791
|
+
const resolved = normalized.map((row) => resolveBuilder(row, TextDisplayBuilder));
|
|
2792
|
+
this.components.push(...resolved);
|
|
2793
|
+
return this;
|
|
2794
|
+
}
|
|
2795
|
+
/**
|
|
2796
|
+
* Adds action rows to this modal.
|
|
2797
|
+
*
|
|
2798
|
+
* @param components - The components to add
|
|
2799
|
+
* @deprecated Use {@link ModalBuilder.addLabelComponents} instead
|
|
2800
|
+
*/
|
|
2801
|
+
addActionRowComponents(...components) {
|
|
2802
|
+
const normalized = normalizeArray(components);
|
|
2803
|
+
const resolved = normalized.map((row) => resolveBuilder(row, ActionRowBuilder));
|
|
2804
|
+
this.components.push(...resolved);
|
|
2805
|
+
return this;
|
|
2806
|
+
}
|
|
2807
|
+
/**
|
|
2808
|
+
* Sets the labels for this modal.
|
|
2809
|
+
*
|
|
2810
|
+
* @param components - The components to set
|
|
2811
|
+
*/
|
|
2812
|
+
setLabelComponents(...components) {
|
|
2813
|
+
const normalized = normalizeArray(components);
|
|
2814
|
+
this.spliceLabelComponents(0, this.components.length, ...normalized);
|
|
2815
|
+
return this;
|
|
2816
|
+
}
|
|
2817
|
+
/**
|
|
2818
|
+
* Removes, replaces, or inserts labels for this modal.
|
|
2819
|
+
*
|
|
2820
|
+
* @remarks
|
|
2821
|
+
* This method behaves similarly
|
|
2822
|
+
* to {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
|
|
2823
|
+
* The maximum amount of labels that can be added is 5.
|
|
2824
|
+
*
|
|
2825
|
+
* It's useful for modifying and adjusting order of the already-existing labels of a modal.
|
|
2826
|
+
* @example
|
|
2827
|
+
* Remove the first label:
|
|
2828
|
+
* ```ts
|
|
2829
|
+
* modal.spliceLabelComponents(0, 1);
|
|
2830
|
+
* ```
|
|
2831
|
+
* @example
|
|
2832
|
+
* Remove the first n labels:
|
|
2833
|
+
* ```ts
|
|
2834
|
+
* const n = 4;
|
|
2835
|
+
* modal.spliceLabelComponents(0, n);
|
|
2836
|
+
* ```
|
|
2837
|
+
* @example
|
|
2838
|
+
* Remove the last label:
|
|
2839
|
+
* ```ts
|
|
2840
|
+
* modal.spliceLabelComponents(-1, 1);
|
|
2841
|
+
* ```
|
|
2842
|
+
* @param index - The index to start at
|
|
2843
|
+
* @param deleteCount - The number of labels to remove
|
|
2844
|
+
* @param labels - The replacing label objects
|
|
2845
|
+
*/
|
|
2846
|
+
spliceLabelComponents(index, deleteCount, ...labels) {
|
|
2847
|
+
const resolved = labels.map((label) => resolveBuilder(label, LabelBuilder));
|
|
2848
|
+
this.components.splice(index, deleteCount, ...resolved);
|
|
2849
|
+
return this;
|
|
2850
|
+
}
|
|
2851
|
+
/**
|
|
2852
|
+
* Sets components for this modal.
|
|
2853
|
+
*
|
|
2854
|
+
* @param components - The components to set
|
|
2855
|
+
* @deprecated Use {@link ModalBuilder.setLabelComponents} instead
|
|
2856
|
+
*/
|
|
2857
|
+
setComponents(...components) {
|
|
2858
|
+
this.components.splice(0, this.components.length, ...normalizeArray(components));
|
|
2859
|
+
return this;
|
|
2860
|
+
}
|
|
2861
|
+
/**
|
|
2862
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
2863
|
+
*/
|
|
2864
|
+
toJSON() {
|
|
2865
|
+
validateRequiredParameters2(this.data.custom_id, this.data.title, this.components);
|
|
2866
|
+
return {
|
|
2867
|
+
...this.data,
|
|
2868
|
+
components: this.components.map((component) => component.toJSON())
|
|
2869
|
+
};
|
|
2870
|
+
}
|
|
2871
|
+
};
|
|
2872
|
+
|
|
2873
|
+
// src/interactions/slashCommands/Assertions.ts
|
|
2874
|
+
var Assertions_exports9 = {};
|
|
2875
|
+
__export(Assertions_exports9, {
|
|
2876
|
+
assertReturnOfBuilder: () => assertReturnOfBuilder2,
|
|
2877
|
+
contextsPredicate: () => contextsPredicate,
|
|
2878
|
+
integrationTypesPredicate: () => integrationTypesPredicate,
|
|
2879
|
+
localizationMapPredicate: () => localizationMapPredicate,
|
|
2880
|
+
validateChoicesLength: () => validateChoicesLength,
|
|
2881
|
+
validateDMPermission: () => validateDMPermission,
|
|
2882
|
+
validateDefaultMemberPermissions: () => validateDefaultMemberPermissions,
|
|
2883
|
+
validateDefaultPermission: () => validateDefaultPermission,
|
|
2884
|
+
validateDescription: () => validateDescription,
|
|
2885
|
+
validateLocale: () => validateLocale,
|
|
2886
|
+
validateLocalizationMap: () => validateLocalizationMap,
|
|
2887
|
+
validateMaxOptionsLength: () => validateMaxOptionsLength,
|
|
2888
|
+
validateNSFW: () => validateNSFW,
|
|
2889
|
+
validateName: () => validateName,
|
|
2890
|
+
validateRequired: () => validateRequired,
|
|
2891
|
+
validateRequiredParameters: () => validateRequiredParameters3
|
|
2892
|
+
});
|
|
2893
|
+
var import_shapeshift9 = require("@sapphire/shapeshift");
|
|
2894
|
+
var import_v1026 = require("discord-api-types/v10");
|
|
2895
|
+
var namePredicate = import_shapeshift9.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u).setValidationEnabled(isValidationEnabled);
|
|
2896
|
+
function validateName(name) {
|
|
2897
|
+
namePredicate.parse(name);
|
|
2898
|
+
}
|
|
2899
|
+
__name(validateName, "validateName");
|
|
2900
|
+
var descriptionPredicate3 = import_shapeshift9.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
|
|
2901
|
+
var localePredicate = import_shapeshift9.s.nativeEnum(import_v1026.Locale);
|
|
2902
|
+
function validateDescription(description) {
|
|
2903
|
+
descriptionPredicate3.parse(description);
|
|
2904
|
+
}
|
|
2905
|
+
__name(validateDescription, "validateDescription");
|
|
2906
|
+
var maxArrayLengthPredicate = import_shapeshift9.s.unknown().array().lengthLessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
|
|
2907
|
+
function validateLocale(locale) {
|
|
2908
|
+
return localePredicate.parse(locale);
|
|
2909
|
+
}
|
|
2910
|
+
__name(validateLocale, "validateLocale");
|
|
2911
|
+
function validateMaxOptionsLength(options) {
|
|
2912
|
+
maxArrayLengthPredicate.parse(options);
|
|
2913
|
+
}
|
|
2914
|
+
__name(validateMaxOptionsLength, "validateMaxOptionsLength");
|
|
2915
|
+
function validateRequiredParameters3(name, description, options) {
|
|
2916
|
+
validateName(name);
|
|
2917
|
+
validateDescription(description);
|
|
2918
|
+
validateMaxOptionsLength(options);
|
|
2919
|
+
}
|
|
2920
|
+
__name(validateRequiredParameters3, "validateRequiredParameters");
|
|
2921
|
+
var booleanPredicate = import_shapeshift9.s.boolean();
|
|
2922
|
+
function validateDefaultPermission(value) {
|
|
2923
|
+
booleanPredicate.parse(value);
|
|
2924
|
+
}
|
|
2925
|
+
__name(validateDefaultPermission, "validateDefaultPermission");
|
|
2926
|
+
function validateRequired(required) {
|
|
2927
|
+
booleanPredicate.parse(required);
|
|
2928
|
+
}
|
|
2929
|
+
__name(validateRequired, "validateRequired");
|
|
2930
|
+
var choicesLengthPredicate = import_shapeshift9.s.number().lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
|
|
2931
|
+
function validateChoicesLength(amountAdding, choices) {
|
|
2932
|
+
choicesLengthPredicate.parse((choices?.length ?? 0) + amountAdding);
|
|
2933
|
+
}
|
|
2934
|
+
__name(validateChoicesLength, "validateChoicesLength");
|
|
2935
|
+
function assertReturnOfBuilder2(input, ExpectedInstanceOf) {
|
|
2936
|
+
import_shapeshift9.s.instance(ExpectedInstanceOf).parse(input);
|
|
2937
|
+
}
|
|
2938
|
+
__name(assertReturnOfBuilder2, "assertReturnOfBuilder");
|
|
2939
|
+
var localizationMapPredicate = import_shapeshift9.s.object(Object.fromEntries(Object.values(import_v1026.Locale).map((locale) => [locale, import_shapeshift9.s.string().nullish()]))).strict().nullish().setValidationEnabled(isValidationEnabled);
|
|
2940
|
+
function validateLocalizationMap(value) {
|
|
2941
|
+
localizationMapPredicate.parse(value);
|
|
2942
|
+
}
|
|
2943
|
+
__name(validateLocalizationMap, "validateLocalizationMap");
|
|
2944
|
+
var dmPermissionPredicate = import_shapeshift9.s.boolean().nullish();
|
|
2945
|
+
function validateDMPermission(value) {
|
|
2946
|
+
dmPermissionPredicate.parse(value);
|
|
2947
|
+
}
|
|
2948
|
+
__name(validateDMPermission, "validateDMPermission");
|
|
2949
|
+
var memberPermissionPredicate = import_shapeshift9.s.union([
|
|
2950
|
+
import_shapeshift9.s.bigint().transform((value) => value.toString()),
|
|
2951
|
+
import_shapeshift9.s.number().safeInt().transform((value) => value.toString()),
|
|
2952
|
+
import_shapeshift9.s.string().regex(/^\d+$/)
|
|
2953
|
+
]).nullish();
|
|
2954
|
+
function validateDefaultMemberPermissions(permissions) {
|
|
2955
|
+
return memberPermissionPredicate.parse(permissions);
|
|
2956
|
+
}
|
|
2957
|
+
__name(validateDefaultMemberPermissions, "validateDefaultMemberPermissions");
|
|
2958
|
+
function validateNSFW(value) {
|
|
2959
|
+
booleanPredicate.parse(value);
|
|
2960
|
+
}
|
|
2961
|
+
__name(validateNSFW, "validateNSFW");
|
|
2962
|
+
var contextsPredicate = import_shapeshift9.s.array(
|
|
2963
|
+
import_shapeshift9.s.nativeEnum(import_v1026.InteractionContextType).setValidationEnabled(isValidationEnabled)
|
|
2964
|
+
);
|
|
2965
|
+
var integrationTypesPredicate = import_shapeshift9.s.array(
|
|
2966
|
+
import_shapeshift9.s.nativeEnum(import_v1026.ApplicationIntegrationType).setValidationEnabled(isValidationEnabled)
|
|
2967
|
+
);
|
|
2968
|
+
|
|
2969
|
+
// src/interactions/slashCommands/SlashCommandBuilder.ts
|
|
2970
|
+
var import_ts_mixer6 = require("ts-mixer");
|
|
2971
|
+
|
|
2972
|
+
// src/interactions/slashCommands/mixins/NameAndDescription.ts
|
|
2973
|
+
var SharedNameAndDescription = class {
|
|
2974
|
+
static {
|
|
2975
|
+
__name(this, "SharedNameAndDescription");
|
|
2976
|
+
}
|
|
2977
|
+
/**
|
|
2978
|
+
* The name of this command.
|
|
2979
|
+
*/
|
|
2980
|
+
name;
|
|
2981
|
+
/**
|
|
2982
|
+
* The name localizations of this command.
|
|
2983
|
+
*/
|
|
2984
|
+
name_localizations;
|
|
2985
|
+
/**
|
|
2986
|
+
* The description of this command.
|
|
2987
|
+
*/
|
|
2988
|
+
description;
|
|
2989
|
+
/**
|
|
2990
|
+
* The description localizations of this command.
|
|
2991
|
+
*/
|
|
2992
|
+
description_localizations;
|
|
2993
|
+
/**
|
|
2994
|
+
* Sets the name of this command.
|
|
2995
|
+
*
|
|
2996
|
+
* @param name - The name to use
|
|
2997
|
+
*/
|
|
2998
|
+
setName(name) {
|
|
2999
|
+
validateName(name);
|
|
3000
|
+
Reflect.set(this, "name", name);
|
|
3001
|
+
return this;
|
|
3002
|
+
}
|
|
3003
|
+
/**
|
|
3004
|
+
* Sets the description of this command.
|
|
3005
|
+
*
|
|
3006
|
+
* @param description - The description to use
|
|
3007
|
+
*/
|
|
3008
|
+
setDescription(description) {
|
|
3009
|
+
validateDescription(description);
|
|
3010
|
+
Reflect.set(this, "description", description);
|
|
3011
|
+
return this;
|
|
3012
|
+
}
|
|
3013
|
+
/**
|
|
3014
|
+
* Sets a name localization for this command.
|
|
3015
|
+
*
|
|
3016
|
+
* @param locale - The locale to set
|
|
3017
|
+
* @param localizedName - The localized name for the given `locale`
|
|
3018
|
+
*/
|
|
3019
|
+
setNameLocalization(locale, localizedName) {
|
|
3020
|
+
if (!this.name_localizations) {
|
|
3021
|
+
Reflect.set(this, "name_localizations", {});
|
|
3022
|
+
}
|
|
3023
|
+
const parsedLocale = validateLocale(locale);
|
|
3024
|
+
if (localizedName === null) {
|
|
3025
|
+
this.name_localizations[parsedLocale] = null;
|
|
3026
|
+
return this;
|
|
3027
|
+
}
|
|
3028
|
+
validateName(localizedName);
|
|
3029
|
+
this.name_localizations[parsedLocale] = localizedName;
|
|
3030
|
+
return this;
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* Sets the name localizations for this command.
|
|
3034
|
+
*
|
|
3035
|
+
* @param localizedNames - The object of localized names to set
|
|
3036
|
+
*/
|
|
3037
|
+
setNameLocalizations(localizedNames) {
|
|
3038
|
+
if (localizedNames === null) {
|
|
3039
|
+
Reflect.set(this, "name_localizations", null);
|
|
3040
|
+
return this;
|
|
3041
|
+
}
|
|
3042
|
+
Reflect.set(this, "name_localizations", {});
|
|
3043
|
+
for (const args of Object.entries(localizedNames)) {
|
|
3044
|
+
this.setNameLocalization(...args);
|
|
3045
|
+
}
|
|
3046
|
+
return this;
|
|
3047
|
+
}
|
|
3048
|
+
/**
|
|
3049
|
+
* Sets a description localization for this command.
|
|
3050
|
+
*
|
|
3051
|
+
* @param locale - The locale to set
|
|
3052
|
+
* @param localizedDescription - The localized description for the given locale
|
|
3053
|
+
*/
|
|
3054
|
+
setDescriptionLocalization(locale, localizedDescription) {
|
|
3055
|
+
if (!this.description_localizations) {
|
|
3056
|
+
Reflect.set(this, "description_localizations", {});
|
|
3057
|
+
}
|
|
3058
|
+
const parsedLocale = validateLocale(locale);
|
|
3059
|
+
if (localizedDescription === null) {
|
|
3060
|
+
this.description_localizations[parsedLocale] = null;
|
|
3061
|
+
return this;
|
|
3062
|
+
}
|
|
3063
|
+
validateDescription(localizedDescription);
|
|
3064
|
+
this.description_localizations[parsedLocale] = localizedDescription;
|
|
3065
|
+
return this;
|
|
3066
|
+
}
|
|
3067
|
+
/**
|
|
3068
|
+
* Sets the description localizations for this command.
|
|
3069
|
+
*
|
|
3070
|
+
* @param localizedDescriptions - The object of localized descriptions to set
|
|
3071
|
+
*/
|
|
3072
|
+
setDescriptionLocalizations(localizedDescriptions) {
|
|
3073
|
+
if (localizedDescriptions === null) {
|
|
3074
|
+
Reflect.set(this, "description_localizations", null);
|
|
3075
|
+
return this;
|
|
3076
|
+
}
|
|
3077
|
+
Reflect.set(this, "description_localizations", {});
|
|
3078
|
+
for (const args of Object.entries(localizedDescriptions)) {
|
|
3079
|
+
this.setDescriptionLocalization(...args);
|
|
3080
|
+
}
|
|
3081
|
+
return this;
|
|
3082
|
+
}
|
|
3083
|
+
};
|
|
3084
|
+
|
|
3085
|
+
// src/interactions/slashCommands/mixins/SharedSlashCommand.ts
|
|
3086
|
+
var import_v1027 = require("discord-api-types/v10");
|
|
3087
|
+
var SharedSlashCommand = class {
|
|
3088
|
+
static {
|
|
3089
|
+
__name(this, "SharedSlashCommand");
|
|
3090
|
+
}
|
|
3091
|
+
name = void 0;
|
|
3092
|
+
name_localizations;
|
|
3093
|
+
description = void 0;
|
|
3094
|
+
description_localizations;
|
|
3095
|
+
options = [];
|
|
3096
|
+
contexts;
|
|
3097
|
+
/**
|
|
3098
|
+
* @deprecated Use {@link SharedSlashCommand.setDefaultMemberPermissions} or {@link SharedSlashCommand.setDMPermission} instead.
|
|
3099
|
+
*/
|
|
3100
|
+
default_permission = void 0;
|
|
3101
|
+
default_member_permissions = void 0;
|
|
3102
|
+
/**
|
|
3103
|
+
* @deprecated Use {@link SharedSlashCommand.contexts} instead.
|
|
3104
|
+
*/
|
|
3105
|
+
dm_permission = void 0;
|
|
3106
|
+
integration_types;
|
|
3107
|
+
nsfw = void 0;
|
|
3108
|
+
/**
|
|
3109
|
+
* Sets the contexts of this command.
|
|
3110
|
+
*
|
|
3111
|
+
* @param contexts - The contexts
|
|
3112
|
+
*/
|
|
3113
|
+
setContexts(...contexts) {
|
|
3114
|
+
Reflect.set(this, "contexts", contextsPredicate.parse(normalizeArray(contexts)));
|
|
3115
|
+
return this;
|
|
3116
|
+
}
|
|
3117
|
+
/**
|
|
3118
|
+
* Sets the integration types of this command.
|
|
3119
|
+
*
|
|
3120
|
+
* @param integrationTypes - The integration types
|
|
3121
|
+
*/
|
|
3122
|
+
setIntegrationTypes(...integrationTypes) {
|
|
3123
|
+
Reflect.set(this, "integration_types", integrationTypesPredicate.parse(normalizeArray(integrationTypes)));
|
|
3124
|
+
return this;
|
|
3125
|
+
}
|
|
3126
|
+
/**
|
|
3127
|
+
* Sets whether the command is enabled by default when the application is added to a guild.
|
|
3128
|
+
*
|
|
3129
|
+
* @remarks
|
|
3130
|
+
* If set to `false`, you will have to later `PUT` the permissions for this command.
|
|
3131
|
+
* @param value - Whether or not to enable this command by default
|
|
3132
|
+
* @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
|
|
3133
|
+
* @deprecated Use {@link SharedSlashCommand.setDefaultMemberPermissions} or {@link SharedSlashCommand.setDMPermission} instead.
|
|
3134
|
+
*/
|
|
3135
|
+
setDefaultPermission(value) {
|
|
3136
|
+
validateDefaultPermission(value);
|
|
3137
|
+
Reflect.set(this, "default_permission", value);
|
|
3138
|
+
return this;
|
|
3139
|
+
}
|
|
3140
|
+
/**
|
|
3141
|
+
* Sets the default permissions a member should have in order to run the command.
|
|
3142
|
+
*
|
|
3143
|
+
* @remarks
|
|
3144
|
+
* You can set this to `'0'` to disable the command by default.
|
|
3145
|
+
* @param permissions - The permissions bit field to set
|
|
3146
|
+
* @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
|
|
3147
|
+
*/
|
|
3148
|
+
setDefaultMemberPermissions(permissions) {
|
|
3149
|
+
const permissionValue = validateDefaultMemberPermissions(permissions);
|
|
3150
|
+
Reflect.set(this, "default_member_permissions", permissionValue);
|
|
3151
|
+
return this;
|
|
3152
|
+
}
|
|
3153
|
+
/**
|
|
3154
|
+
* Sets if the command is available in direct messages with the application.
|
|
3155
|
+
*
|
|
3156
|
+
* @remarks
|
|
3157
|
+
* By default, commands are visible. This method is only for global commands.
|
|
3158
|
+
* @param enabled - Whether the command should be enabled in direct messages
|
|
3159
|
+
* @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
|
|
3160
|
+
* @deprecated
|
|
3161
|
+
* Use {@link SharedSlashCommand.setContexts} instead.
|
|
3162
|
+
*/
|
|
3163
|
+
setDMPermission(enabled) {
|
|
3164
|
+
validateDMPermission(enabled);
|
|
3165
|
+
Reflect.set(this, "dm_permission", enabled);
|
|
3166
|
+
return this;
|
|
3167
|
+
}
|
|
3168
|
+
/**
|
|
3169
|
+
* Sets whether this command is NSFW.
|
|
3170
|
+
*
|
|
3171
|
+
* @param nsfw - Whether this command is NSFW
|
|
3172
|
+
*/
|
|
3173
|
+
setNSFW(nsfw = true) {
|
|
3174
|
+
validateNSFW(nsfw);
|
|
3175
|
+
Reflect.set(this, "nsfw", nsfw);
|
|
3176
|
+
return this;
|
|
3177
|
+
}
|
|
3178
|
+
/**
|
|
3179
|
+
* Serializes this builder to API-compatible JSON data.
|
|
3180
|
+
*
|
|
3181
|
+
* @remarks
|
|
3182
|
+
* This method runs validations on the data before serializing it.
|
|
3183
|
+
* As such, it may throw an error if the data is invalid.
|
|
3184
|
+
*/
|
|
3185
|
+
toJSON() {
|
|
3186
|
+
validateRequiredParameters3(this.name, this.description, this.options);
|
|
3187
|
+
validateLocalizationMap(this.name_localizations);
|
|
3188
|
+
validateLocalizationMap(this.description_localizations);
|
|
3189
|
+
return {
|
|
3190
|
+
...this,
|
|
3191
|
+
type: import_v1027.ApplicationCommandType.ChatInput,
|
|
3192
|
+
options: this.options.map((option) => option.toJSON())
|
|
3193
|
+
};
|
|
3194
|
+
}
|
|
3195
|
+
};
|
|
3196
|
+
|
|
3197
|
+
// src/interactions/slashCommands/options/attachment.ts
|
|
3198
|
+
var import_v1028 = require("discord-api-types/v10");
|
|
3199
|
+
|
|
3200
|
+
// src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts
|
|
3201
|
+
var ApplicationCommandOptionBase = class extends SharedNameAndDescription {
|
|
3202
|
+
static {
|
|
3203
|
+
__name(this, "ApplicationCommandOptionBase");
|
|
3204
|
+
}
|
|
3205
|
+
/**
|
|
3206
|
+
* Whether this option is required.
|
|
3207
|
+
*
|
|
3208
|
+
* @defaultValue `false`
|
|
3209
|
+
*/
|
|
3210
|
+
required = false;
|
|
3211
|
+
/**
|
|
3212
|
+
* Sets whether this option is required.
|
|
3213
|
+
*
|
|
3214
|
+
* @param required - Whether this option should be required
|
|
3215
|
+
*/
|
|
3216
|
+
setRequired(required) {
|
|
3217
|
+
validateRequired(required);
|
|
3218
|
+
Reflect.set(this, "required", required);
|
|
3219
|
+
return this;
|
|
3220
|
+
}
|
|
3221
|
+
/**
|
|
3222
|
+
* This method runs required validators on this builder.
|
|
3223
|
+
*/
|
|
3224
|
+
runRequiredValidations() {
|
|
3225
|
+
validateRequiredParameters3(this.name, this.description, []);
|
|
3226
|
+
validateLocalizationMap(this.name_localizations);
|
|
3227
|
+
validateLocalizationMap(this.description_localizations);
|
|
3228
|
+
validateRequired(this.required);
|
|
3229
|
+
}
|
|
3230
|
+
};
|
|
3231
|
+
|
|
3232
|
+
// src/interactions/slashCommands/options/attachment.ts
|
|
3233
|
+
var SlashCommandAttachmentOption = class extends ApplicationCommandOptionBase {
|
|
3234
|
+
static {
|
|
3235
|
+
__name(this, "SlashCommandAttachmentOption");
|
|
3236
|
+
}
|
|
3237
|
+
/**
|
|
3238
|
+
* The type of this option.
|
|
3239
|
+
*/
|
|
3240
|
+
type = import_v1028.ApplicationCommandOptionType.Attachment;
|
|
3241
|
+
/**
|
|
3242
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3243
|
+
*/
|
|
3244
|
+
toJSON() {
|
|
3245
|
+
this.runRequiredValidations();
|
|
3246
|
+
return { ...this };
|
|
3247
|
+
}
|
|
3248
|
+
};
|
|
3249
|
+
|
|
3250
|
+
// src/interactions/slashCommands/options/boolean.ts
|
|
3251
|
+
var import_v1029 = require("discord-api-types/v10");
|
|
3252
|
+
var SlashCommandBooleanOption = class extends ApplicationCommandOptionBase {
|
|
3253
|
+
static {
|
|
3254
|
+
__name(this, "SlashCommandBooleanOption");
|
|
3255
|
+
}
|
|
3256
|
+
/**
|
|
3257
|
+
* The type of this option.
|
|
3258
|
+
*/
|
|
3259
|
+
type = import_v1029.ApplicationCommandOptionType.Boolean;
|
|
3260
|
+
/**
|
|
3261
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3262
|
+
*/
|
|
3263
|
+
toJSON() {
|
|
3264
|
+
this.runRequiredValidations();
|
|
3265
|
+
return { ...this };
|
|
3266
|
+
}
|
|
3267
|
+
};
|
|
3268
|
+
|
|
3269
|
+
// src/interactions/slashCommands/options/channel.ts
|
|
3270
|
+
var import_v1031 = require("discord-api-types/v10");
|
|
3271
|
+
var import_ts_mixer = require("ts-mixer");
|
|
3272
|
+
|
|
3273
|
+
// src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts
|
|
3274
|
+
var import_shapeshift10 = require("@sapphire/shapeshift");
|
|
3275
|
+
var import_v1030 = require("discord-api-types/v10");
|
|
3276
|
+
var allowedChannelTypes = [
|
|
3277
|
+
import_v1030.ChannelType.GuildText,
|
|
3278
|
+
import_v1030.ChannelType.GuildVoice,
|
|
3279
|
+
import_v1030.ChannelType.GuildCategory,
|
|
3280
|
+
import_v1030.ChannelType.GuildAnnouncement,
|
|
3281
|
+
import_v1030.ChannelType.AnnouncementThread,
|
|
3282
|
+
import_v1030.ChannelType.PublicThread,
|
|
3283
|
+
import_v1030.ChannelType.PrivateThread,
|
|
3284
|
+
import_v1030.ChannelType.GuildStageVoice,
|
|
3285
|
+
import_v1030.ChannelType.GuildForum,
|
|
3286
|
+
import_v1030.ChannelType.GuildMedia
|
|
3287
|
+
];
|
|
3288
|
+
var channelTypesPredicate = import_shapeshift10.s.array(import_shapeshift10.s.union(allowedChannelTypes.map((type) => import_shapeshift10.s.literal(type))));
|
|
3289
|
+
var ApplicationCommandOptionChannelTypesMixin = class {
|
|
3290
|
+
static {
|
|
3291
|
+
__name(this, "ApplicationCommandOptionChannelTypesMixin");
|
|
3292
|
+
}
|
|
3293
|
+
/**
|
|
3294
|
+
* The channel types of this option.
|
|
3295
|
+
*/
|
|
3296
|
+
channel_types;
|
|
3297
|
+
/**
|
|
3298
|
+
* Adds channel types to this option.
|
|
3299
|
+
*
|
|
3300
|
+
* @param channelTypes - The channel types
|
|
3301
|
+
*/
|
|
3302
|
+
addChannelTypes(...channelTypes) {
|
|
3303
|
+
if (this.channel_types === void 0) {
|
|
3304
|
+
Reflect.set(this, "channel_types", []);
|
|
3305
|
+
}
|
|
3306
|
+
this.channel_types.push(...channelTypesPredicate.parse(normalizeArray(channelTypes)));
|
|
3307
|
+
return this;
|
|
3308
|
+
}
|
|
3309
|
+
};
|
|
3310
|
+
|
|
3311
|
+
// src/interactions/slashCommands/options/channel.ts
|
|
3312
|
+
var SlashCommandChannelOption = class extends ApplicationCommandOptionBase {
|
|
3313
|
+
/**
|
|
3314
|
+
* The type of this option.
|
|
3315
|
+
*/
|
|
3316
|
+
type = import_v1031.ApplicationCommandOptionType.Channel;
|
|
3317
|
+
/**
|
|
3318
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3319
|
+
*/
|
|
3320
|
+
toJSON() {
|
|
3321
|
+
this.runRequiredValidations();
|
|
3322
|
+
return { ...this };
|
|
3323
|
+
}
|
|
3324
|
+
};
|
|
3325
|
+
__name(SlashCommandChannelOption, "SlashCommandChannelOption");
|
|
3326
|
+
SlashCommandChannelOption = __decorateClass([
|
|
3327
|
+
(0, import_ts_mixer.mix)(ApplicationCommandOptionChannelTypesMixin)
|
|
3328
|
+
], SlashCommandChannelOption);
|
|
3329
|
+
|
|
3330
|
+
// src/interactions/slashCommands/options/integer.ts
|
|
3331
|
+
var import_shapeshift13 = require("@sapphire/shapeshift");
|
|
3332
|
+
var import_v1033 = require("discord-api-types/v10");
|
|
3333
|
+
var import_ts_mixer2 = require("ts-mixer");
|
|
3334
|
+
|
|
3335
|
+
// src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts
|
|
3336
|
+
var ApplicationCommandNumericOptionMinMaxValueMixin = class {
|
|
3337
|
+
static {
|
|
3338
|
+
__name(this, "ApplicationCommandNumericOptionMinMaxValueMixin");
|
|
3339
|
+
}
|
|
3340
|
+
/**
|
|
3341
|
+
* The maximum value of this option.
|
|
3342
|
+
*/
|
|
3343
|
+
max_value;
|
|
3344
|
+
/**
|
|
3345
|
+
* The minimum value of this option.
|
|
3346
|
+
*/
|
|
3347
|
+
min_value;
|
|
3348
|
+
};
|
|
3349
|
+
|
|
3350
|
+
// src/interactions/slashCommands/mixins/ApplicationCommandOptionWithAutocompleteMixin.ts
|
|
3351
|
+
var import_shapeshift11 = require("@sapphire/shapeshift");
|
|
3352
|
+
var booleanPredicate2 = import_shapeshift11.s.boolean();
|
|
3353
|
+
var ApplicationCommandOptionWithAutocompleteMixin = class {
|
|
3354
|
+
static {
|
|
3355
|
+
__name(this, "ApplicationCommandOptionWithAutocompleteMixin");
|
|
3356
|
+
}
|
|
3357
|
+
/**
|
|
3358
|
+
* Whether this option utilizes autocomplete.
|
|
3359
|
+
*/
|
|
3360
|
+
autocomplete;
|
|
3361
|
+
/**
|
|
3362
|
+
* The type of this option.
|
|
3363
|
+
*
|
|
3364
|
+
* @privateRemarks Since this is present and this is a mixin, this is needed.
|
|
3365
|
+
*/
|
|
3366
|
+
type;
|
|
3367
|
+
/**
|
|
3368
|
+
* Whether this option uses autocomplete.
|
|
3369
|
+
*
|
|
3370
|
+
* @param autocomplete - Whether this option should use autocomplete
|
|
3371
|
+
*/
|
|
3372
|
+
setAutocomplete(autocomplete) {
|
|
3373
|
+
booleanPredicate2.parse(autocomplete);
|
|
3374
|
+
if (autocomplete && "choices" in this && Array.isArray(this.choices) && this.choices.length > 0) {
|
|
3375
|
+
throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
|
|
3376
|
+
}
|
|
3377
|
+
Reflect.set(this, "autocomplete", autocomplete);
|
|
3378
|
+
return this;
|
|
3379
|
+
}
|
|
3380
|
+
};
|
|
3381
|
+
|
|
3382
|
+
// src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesMixin.ts
|
|
3383
|
+
var import_shapeshift12 = require("@sapphire/shapeshift");
|
|
3384
|
+
var import_v1032 = require("discord-api-types/v10");
|
|
3385
|
+
var stringPredicate = import_shapeshift12.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100);
|
|
3386
|
+
var numberPredicate = import_shapeshift12.s.number().greaterThan(Number.NEGATIVE_INFINITY).lessThan(Number.POSITIVE_INFINITY);
|
|
3387
|
+
var choicesPredicate = import_shapeshift12.s.object({
|
|
3388
|
+
name: stringPredicate,
|
|
3389
|
+
name_localizations: localizationMapPredicate,
|
|
3390
|
+
value: import_shapeshift12.s.union([stringPredicate, numberPredicate])
|
|
3391
|
+
}).array();
|
|
3392
|
+
var ApplicationCommandOptionWithChoicesMixin = class {
|
|
3393
|
+
static {
|
|
3394
|
+
__name(this, "ApplicationCommandOptionWithChoicesMixin");
|
|
3395
|
+
}
|
|
3396
|
+
/**
|
|
3397
|
+
* The choices of this option.
|
|
3398
|
+
*/
|
|
3399
|
+
choices;
|
|
3400
|
+
/**
|
|
3401
|
+
* The type of this option.
|
|
3402
|
+
*
|
|
3403
|
+
* @privateRemarks Since this is present and this is a mixin, this is needed.
|
|
3404
|
+
*/
|
|
3405
|
+
type;
|
|
3406
|
+
/**
|
|
3407
|
+
* Adds multiple choices to this option.
|
|
3408
|
+
*
|
|
3409
|
+
* @param choices - The choices to add
|
|
3410
|
+
*/
|
|
3411
|
+
addChoices(...choices) {
|
|
3412
|
+
const normalizedChoices = normalizeArray(choices);
|
|
3413
|
+
if (normalizedChoices.length > 0 && "autocomplete" in this && this.autocomplete) {
|
|
3414
|
+
throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
|
|
3415
|
+
}
|
|
3416
|
+
choicesPredicate.parse(normalizedChoices);
|
|
3417
|
+
if (this.choices === void 0) {
|
|
3418
|
+
Reflect.set(this, "choices", []);
|
|
3419
|
+
}
|
|
3420
|
+
validateChoicesLength(normalizedChoices.length, this.choices);
|
|
3421
|
+
for (const { name, name_localizations, value } of normalizedChoices) {
|
|
3422
|
+
if (this.type === import_v1032.ApplicationCommandOptionType.String) {
|
|
3423
|
+
stringPredicate.parse(value);
|
|
3424
|
+
} else {
|
|
3425
|
+
numberPredicate.parse(value);
|
|
3426
|
+
}
|
|
3427
|
+
this.choices.push({ name, name_localizations, value });
|
|
3428
|
+
}
|
|
3429
|
+
return this;
|
|
3430
|
+
}
|
|
3431
|
+
/**
|
|
3432
|
+
* Sets multiple choices for this option.
|
|
3433
|
+
*
|
|
3434
|
+
* @param choices - The choices to set
|
|
3435
|
+
*/
|
|
3436
|
+
setChoices(...choices) {
|
|
3437
|
+
const normalizedChoices = normalizeArray(choices);
|
|
3438
|
+
if (normalizedChoices.length > 0 && "autocomplete" in this && this.autocomplete) {
|
|
3439
|
+
throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
|
|
3440
|
+
}
|
|
3441
|
+
choicesPredicate.parse(normalizedChoices);
|
|
3442
|
+
Reflect.set(this, "choices", []);
|
|
3443
|
+
this.addChoices(normalizedChoices);
|
|
3444
|
+
return this;
|
|
3445
|
+
}
|
|
3446
|
+
};
|
|
3447
|
+
|
|
3448
|
+
// src/interactions/slashCommands/options/integer.ts
|
|
3449
|
+
var numberValidator = import_shapeshift13.s.number().int();
|
|
3450
|
+
var SlashCommandIntegerOption = class extends ApplicationCommandOptionBase {
|
|
3451
|
+
/**
|
|
3452
|
+
* The type of this option.
|
|
3453
|
+
*/
|
|
3454
|
+
type = import_v1033.ApplicationCommandOptionType.Integer;
|
|
3455
|
+
/**
|
|
3456
|
+
* {@inheritDoc ApplicationCommandNumericOptionMinMaxValueMixin.setMaxValue}
|
|
3457
|
+
*/
|
|
3458
|
+
setMaxValue(max) {
|
|
3459
|
+
numberValidator.parse(max);
|
|
3460
|
+
Reflect.set(this, "max_value", max);
|
|
3461
|
+
return this;
|
|
3462
|
+
}
|
|
3463
|
+
/**
|
|
3464
|
+
* {@inheritDoc ApplicationCommandNumericOptionMinMaxValueMixin.setMinValue}
|
|
3465
|
+
*/
|
|
3466
|
+
setMinValue(min) {
|
|
3467
|
+
numberValidator.parse(min);
|
|
3468
|
+
Reflect.set(this, "min_value", min);
|
|
3469
|
+
return this;
|
|
3470
|
+
}
|
|
3471
|
+
/**
|
|
3472
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3473
|
+
*/
|
|
3474
|
+
toJSON() {
|
|
3475
|
+
this.runRequiredValidations();
|
|
3476
|
+
if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
|
|
3477
|
+
throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
|
|
3478
|
+
}
|
|
3479
|
+
return { ...this };
|
|
3480
|
+
}
|
|
3481
|
+
};
|
|
3482
|
+
__name(SlashCommandIntegerOption, "SlashCommandIntegerOption");
|
|
3483
|
+
SlashCommandIntegerOption = __decorateClass([
|
|
3484
|
+
(0, import_ts_mixer2.mix)(
|
|
3485
|
+
ApplicationCommandNumericOptionMinMaxValueMixin,
|
|
3486
|
+
ApplicationCommandOptionWithAutocompleteMixin,
|
|
3487
|
+
ApplicationCommandOptionWithChoicesMixin
|
|
3488
|
+
)
|
|
3489
|
+
], SlashCommandIntegerOption);
|
|
3490
|
+
|
|
3491
|
+
// src/interactions/slashCommands/options/mentionable.ts
|
|
3492
|
+
var import_v1034 = require("discord-api-types/v10");
|
|
3493
|
+
var SlashCommandMentionableOption = class extends ApplicationCommandOptionBase {
|
|
3494
|
+
static {
|
|
3495
|
+
__name(this, "SlashCommandMentionableOption");
|
|
3496
|
+
}
|
|
3497
|
+
/**
|
|
3498
|
+
* The type of this option.
|
|
3499
|
+
*/
|
|
3500
|
+
type = import_v1034.ApplicationCommandOptionType.Mentionable;
|
|
3501
|
+
/**
|
|
3502
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3503
|
+
*/
|
|
3504
|
+
toJSON() {
|
|
3505
|
+
this.runRequiredValidations();
|
|
3506
|
+
return { ...this };
|
|
3507
|
+
}
|
|
3508
|
+
};
|
|
3509
|
+
|
|
3510
|
+
// src/interactions/slashCommands/options/number.ts
|
|
3511
|
+
var import_shapeshift14 = require("@sapphire/shapeshift");
|
|
3512
|
+
var import_v1035 = require("discord-api-types/v10");
|
|
3513
|
+
var import_ts_mixer3 = require("ts-mixer");
|
|
3514
|
+
var numberValidator2 = import_shapeshift14.s.number();
|
|
3515
|
+
var SlashCommandNumberOption = class extends ApplicationCommandOptionBase {
|
|
3516
|
+
/**
|
|
3517
|
+
* The type of this option.
|
|
3518
|
+
*/
|
|
3519
|
+
type = import_v1035.ApplicationCommandOptionType.Number;
|
|
3520
|
+
/**
|
|
3521
|
+
* {@inheritDoc ApplicationCommandNumericOptionMinMaxValueMixin.setMaxValue}
|
|
3522
|
+
*/
|
|
3523
|
+
setMaxValue(max) {
|
|
3524
|
+
numberValidator2.parse(max);
|
|
3525
|
+
Reflect.set(this, "max_value", max);
|
|
3526
|
+
return this;
|
|
3527
|
+
}
|
|
3528
|
+
/**
|
|
3529
|
+
* {@inheritDoc ApplicationCommandNumericOptionMinMaxValueMixin.setMinValue}
|
|
3530
|
+
*/
|
|
3531
|
+
setMinValue(min) {
|
|
3532
|
+
numberValidator2.parse(min);
|
|
3533
|
+
Reflect.set(this, "min_value", min);
|
|
3534
|
+
return this;
|
|
3535
|
+
}
|
|
3536
|
+
/**
|
|
3537
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3538
|
+
*/
|
|
3539
|
+
toJSON() {
|
|
3540
|
+
this.runRequiredValidations();
|
|
3541
|
+
if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
|
|
3542
|
+
throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
|
|
3543
|
+
}
|
|
3544
|
+
return { ...this };
|
|
3545
|
+
}
|
|
3546
|
+
};
|
|
3547
|
+
__name(SlashCommandNumberOption, "SlashCommandNumberOption");
|
|
3548
|
+
SlashCommandNumberOption = __decorateClass([
|
|
3549
|
+
(0, import_ts_mixer3.mix)(
|
|
3550
|
+
ApplicationCommandNumericOptionMinMaxValueMixin,
|
|
3551
|
+
ApplicationCommandOptionWithAutocompleteMixin,
|
|
3552
|
+
ApplicationCommandOptionWithChoicesMixin
|
|
3553
|
+
)
|
|
3554
|
+
], SlashCommandNumberOption);
|
|
3555
|
+
|
|
3556
|
+
// src/interactions/slashCommands/options/role.ts
|
|
3557
|
+
var import_v1036 = require("discord-api-types/v10");
|
|
3558
|
+
var SlashCommandRoleOption = class extends ApplicationCommandOptionBase {
|
|
3559
|
+
static {
|
|
3560
|
+
__name(this, "SlashCommandRoleOption");
|
|
3561
|
+
}
|
|
3562
|
+
/**
|
|
3563
|
+
* The type of this option.
|
|
3564
|
+
*/
|
|
3565
|
+
type = import_v1036.ApplicationCommandOptionType.Role;
|
|
3566
|
+
/**
|
|
3567
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3568
|
+
*/
|
|
3569
|
+
toJSON() {
|
|
3570
|
+
this.runRequiredValidations();
|
|
3571
|
+
return { ...this };
|
|
3572
|
+
}
|
|
3573
|
+
};
|
|
3574
|
+
|
|
3575
|
+
// src/interactions/slashCommands/options/string.ts
|
|
3576
|
+
var import_shapeshift15 = require("@sapphire/shapeshift");
|
|
3577
|
+
var import_v1037 = require("discord-api-types/v10");
|
|
3578
|
+
var import_ts_mixer4 = require("ts-mixer");
|
|
3579
|
+
var minLengthValidator2 = import_shapeshift15.s.number().greaterThanOrEqual(0).lessThanOrEqual(6e3);
|
|
3580
|
+
var maxLengthValidator2 = import_shapeshift15.s.number().greaterThanOrEqual(1).lessThanOrEqual(6e3);
|
|
3581
|
+
var SlashCommandStringOption = class extends ApplicationCommandOptionBase {
|
|
3582
|
+
/**
|
|
3583
|
+
* The type of this option.
|
|
3584
|
+
*/
|
|
3585
|
+
type = import_v1037.ApplicationCommandOptionType.String;
|
|
3586
|
+
/**
|
|
3587
|
+
* The maximum length of this option.
|
|
3588
|
+
*/
|
|
3589
|
+
max_length;
|
|
3590
|
+
/**
|
|
3591
|
+
* The minimum length of this option.
|
|
3592
|
+
*/
|
|
3593
|
+
min_length;
|
|
3594
|
+
/**
|
|
3595
|
+
* Sets the maximum length of this string option.
|
|
3596
|
+
*
|
|
3597
|
+
* @param max - The maximum length this option can be
|
|
3598
|
+
*/
|
|
3599
|
+
setMaxLength(max) {
|
|
3600
|
+
maxLengthValidator2.parse(max);
|
|
3601
|
+
Reflect.set(this, "max_length", max);
|
|
3602
|
+
return this;
|
|
3603
|
+
}
|
|
3604
|
+
/**
|
|
3605
|
+
* Sets the minimum length of this string option.
|
|
3606
|
+
*
|
|
3607
|
+
* @param min - The minimum length this option can be
|
|
3608
|
+
*/
|
|
3609
|
+
setMinLength(min) {
|
|
3610
|
+
minLengthValidator2.parse(min);
|
|
3611
|
+
Reflect.set(this, "min_length", min);
|
|
3612
|
+
return this;
|
|
3613
|
+
}
|
|
3614
|
+
/**
|
|
3615
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3616
|
+
*/
|
|
3617
|
+
toJSON() {
|
|
3618
|
+
this.runRequiredValidations();
|
|
3619
|
+
if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
|
|
3620
|
+
throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
|
|
3621
|
+
}
|
|
3622
|
+
return { ...this };
|
|
3623
|
+
}
|
|
3624
|
+
};
|
|
3625
|
+
__name(SlashCommandStringOption, "SlashCommandStringOption");
|
|
3626
|
+
SlashCommandStringOption = __decorateClass([
|
|
3627
|
+
(0, import_ts_mixer4.mix)(ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin)
|
|
3628
|
+
], SlashCommandStringOption);
|
|
3629
|
+
|
|
3630
|
+
// src/interactions/slashCommands/options/user.ts
|
|
3631
|
+
var import_v1038 = require("discord-api-types/v10");
|
|
3632
|
+
var SlashCommandUserOption = class extends ApplicationCommandOptionBase {
|
|
3633
|
+
static {
|
|
3634
|
+
__name(this, "SlashCommandUserOption");
|
|
3635
|
+
}
|
|
3636
|
+
/**
|
|
3637
|
+
* The type of this option.
|
|
3638
|
+
*/
|
|
3639
|
+
type = import_v1038.ApplicationCommandOptionType.User;
|
|
3640
|
+
/**
|
|
3641
|
+
* {@inheritDoc ApplicationCommandOptionBase.toJSON}
|
|
3642
|
+
*/
|
|
3643
|
+
toJSON() {
|
|
3644
|
+
this.runRequiredValidations();
|
|
3645
|
+
return { ...this };
|
|
3646
|
+
}
|
|
3647
|
+
};
|
|
3648
|
+
|
|
3649
|
+
// src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts
|
|
3650
|
+
var SharedSlashCommandOptions = class {
|
|
3651
|
+
static {
|
|
3652
|
+
__name(this, "SharedSlashCommandOptions");
|
|
3653
|
+
}
|
|
3654
|
+
options;
|
|
3655
|
+
/**
|
|
3656
|
+
* Adds a boolean option.
|
|
3657
|
+
*
|
|
3658
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3659
|
+
*/
|
|
3660
|
+
addBooleanOption(input) {
|
|
3661
|
+
return this._sharedAddOptionMethod(input, SlashCommandBooleanOption);
|
|
3662
|
+
}
|
|
3663
|
+
/**
|
|
3664
|
+
* Adds a user option.
|
|
3665
|
+
*
|
|
3666
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3667
|
+
*/
|
|
3668
|
+
addUserOption(input) {
|
|
3669
|
+
return this._sharedAddOptionMethod(input, SlashCommandUserOption);
|
|
3670
|
+
}
|
|
3671
|
+
/**
|
|
3672
|
+
* Adds a channel option.
|
|
3673
|
+
*
|
|
3674
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3675
|
+
*/
|
|
3676
|
+
addChannelOption(input) {
|
|
3677
|
+
return this._sharedAddOptionMethod(input, SlashCommandChannelOption);
|
|
3678
|
+
}
|
|
3679
|
+
/**
|
|
3680
|
+
* Adds a role option.
|
|
3681
|
+
*
|
|
3682
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3683
|
+
*/
|
|
3684
|
+
addRoleOption(input) {
|
|
3685
|
+
return this._sharedAddOptionMethod(input, SlashCommandRoleOption);
|
|
3686
|
+
}
|
|
3687
|
+
/**
|
|
3688
|
+
* Adds an attachment option.
|
|
3689
|
+
*
|
|
3690
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3691
|
+
*/
|
|
3692
|
+
addAttachmentOption(input) {
|
|
3693
|
+
return this._sharedAddOptionMethod(input, SlashCommandAttachmentOption);
|
|
3694
|
+
}
|
|
3695
|
+
/**
|
|
3696
|
+
* Adds a mentionable option.
|
|
3697
|
+
*
|
|
3698
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3699
|
+
*/
|
|
3700
|
+
addMentionableOption(input) {
|
|
3701
|
+
return this._sharedAddOptionMethod(input, SlashCommandMentionableOption);
|
|
3702
|
+
}
|
|
3703
|
+
/**
|
|
3704
|
+
* Adds a string option.
|
|
3705
|
+
*
|
|
3706
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3707
|
+
*/
|
|
3708
|
+
addStringOption(input) {
|
|
3709
|
+
return this._sharedAddOptionMethod(input, SlashCommandStringOption);
|
|
3710
|
+
}
|
|
3711
|
+
/**
|
|
3712
|
+
* Adds an integer option.
|
|
3713
|
+
*
|
|
3714
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3715
|
+
*/
|
|
3716
|
+
addIntegerOption(input) {
|
|
3717
|
+
return this._sharedAddOptionMethod(input, SlashCommandIntegerOption);
|
|
3718
|
+
}
|
|
3719
|
+
/**
|
|
3720
|
+
* Adds a number option.
|
|
3721
|
+
*
|
|
3722
|
+
* @param input - A function that returns an option builder or an already built builder
|
|
3723
|
+
*/
|
|
3724
|
+
addNumberOption(input) {
|
|
3725
|
+
return this._sharedAddOptionMethod(input, SlashCommandNumberOption);
|
|
3726
|
+
}
|
|
3727
|
+
/**
|
|
3728
|
+
* Where the actual adding magic happens. ✨
|
|
3729
|
+
*
|
|
3730
|
+
* @param input - The input. What else?
|
|
3731
|
+
* @param Instance - The instance of whatever is being added
|
|
3732
|
+
* @internal
|
|
3733
|
+
*/
|
|
3734
|
+
_sharedAddOptionMethod(input, Instance) {
|
|
3735
|
+
const { options } = this;
|
|
3736
|
+
validateMaxOptionsLength(options);
|
|
3737
|
+
const result = typeof input === "function" ? input(new Instance()) : input;
|
|
3738
|
+
assertReturnOfBuilder2(result, Instance);
|
|
3739
|
+
options.push(result);
|
|
3740
|
+
return this;
|
|
3741
|
+
}
|
|
3742
|
+
};
|
|
3743
|
+
|
|
3744
|
+
// src/interactions/slashCommands/SlashCommandSubcommands.ts
|
|
3745
|
+
var import_v1039 = require("discord-api-types/v10");
|
|
3746
|
+
var import_ts_mixer5 = require("ts-mixer");
|
|
3747
|
+
var SlashCommandSubcommandGroupBuilder = class {
|
|
3748
|
+
/**
|
|
3749
|
+
* The name of this subcommand group.
|
|
3750
|
+
*/
|
|
3751
|
+
name = void 0;
|
|
3752
|
+
/**
|
|
3753
|
+
* The description of this subcommand group.
|
|
3754
|
+
*/
|
|
3755
|
+
description = void 0;
|
|
3756
|
+
/**
|
|
3757
|
+
* The subcommands within this subcommand group.
|
|
3758
|
+
*/
|
|
3759
|
+
options = [];
|
|
3760
|
+
/**
|
|
3761
|
+
* Adds a new subcommand to this group.
|
|
3762
|
+
*
|
|
3763
|
+
* @param input - A function that returns a subcommand builder or an already built builder
|
|
3764
|
+
*/
|
|
3765
|
+
addSubcommand(input) {
|
|
3766
|
+
const { options } = this;
|
|
3767
|
+
validateMaxOptionsLength(options);
|
|
3768
|
+
const result = typeof input === "function" ? input(new SlashCommandSubcommandBuilder()) : input;
|
|
3769
|
+
assertReturnOfBuilder2(result, SlashCommandSubcommandBuilder);
|
|
3770
|
+
options.push(result);
|
|
3771
|
+
return this;
|
|
3772
|
+
}
|
|
3773
|
+
/**
|
|
3774
|
+
* Serializes this builder to API-compatible JSON data.
|
|
3775
|
+
*
|
|
3776
|
+
* @remarks
|
|
3777
|
+
* This method runs validations on the data before serializing it.
|
|
3778
|
+
* As such, it may throw an error if the data is invalid.
|
|
3779
|
+
*/
|
|
3780
|
+
toJSON() {
|
|
3781
|
+
validateRequiredParameters3(this.name, this.description, this.options);
|
|
3782
|
+
return {
|
|
3783
|
+
type: import_v1039.ApplicationCommandOptionType.SubcommandGroup,
|
|
3784
|
+
name: this.name,
|
|
3785
|
+
name_localizations: this.name_localizations,
|
|
3786
|
+
description: this.description,
|
|
3787
|
+
description_localizations: this.description_localizations,
|
|
3788
|
+
options: this.options.map((option) => option.toJSON())
|
|
3789
|
+
};
|
|
3790
|
+
}
|
|
3791
|
+
};
|
|
3792
|
+
__name(SlashCommandSubcommandGroupBuilder, "SlashCommandSubcommandGroupBuilder");
|
|
3793
|
+
SlashCommandSubcommandGroupBuilder = __decorateClass([
|
|
3794
|
+
(0, import_ts_mixer5.mix)(SharedNameAndDescription)
|
|
3795
|
+
], SlashCommandSubcommandGroupBuilder);
|
|
3796
|
+
var SlashCommandSubcommandBuilder = class {
|
|
3797
|
+
/**
|
|
3798
|
+
* The name of this subcommand.
|
|
3799
|
+
*/
|
|
3800
|
+
name = void 0;
|
|
3801
|
+
/**
|
|
3802
|
+
* The description of this subcommand.
|
|
3803
|
+
*/
|
|
3804
|
+
description = void 0;
|
|
3805
|
+
/**
|
|
3806
|
+
* The options within this subcommand.
|
|
3807
|
+
*/
|
|
3808
|
+
options = [];
|
|
3809
|
+
/**
|
|
3810
|
+
* Serializes this builder to API-compatible JSON data.
|
|
3811
|
+
*
|
|
3812
|
+
* @remarks
|
|
3813
|
+
* This method runs validations on the data before serializing it.
|
|
3814
|
+
* As such, it may throw an error if the data is invalid.
|
|
3815
|
+
*/
|
|
3816
|
+
toJSON() {
|
|
3817
|
+
validateRequiredParameters3(this.name, this.description, this.options);
|
|
3818
|
+
return {
|
|
3819
|
+
type: import_v1039.ApplicationCommandOptionType.Subcommand,
|
|
3820
|
+
name: this.name,
|
|
3821
|
+
name_localizations: this.name_localizations,
|
|
3822
|
+
description: this.description,
|
|
3823
|
+
description_localizations: this.description_localizations,
|
|
3824
|
+
options: this.options.map((option) => option.toJSON())
|
|
3825
|
+
};
|
|
3826
|
+
}
|
|
3827
|
+
};
|
|
3828
|
+
__name(SlashCommandSubcommandBuilder, "SlashCommandSubcommandBuilder");
|
|
3829
|
+
SlashCommandSubcommandBuilder = __decorateClass([
|
|
3830
|
+
(0, import_ts_mixer5.mix)(SharedNameAndDescription, SharedSlashCommandOptions)
|
|
3831
|
+
], SlashCommandSubcommandBuilder);
|
|
3832
|
+
|
|
3833
|
+
// src/interactions/slashCommands/mixins/SharedSubcommands.ts
|
|
3834
|
+
var SharedSlashCommandSubcommands = class {
|
|
3835
|
+
static {
|
|
3836
|
+
__name(this, "SharedSlashCommandSubcommands");
|
|
3837
|
+
}
|
|
3838
|
+
options = [];
|
|
3839
|
+
/**
|
|
3840
|
+
* Adds a new subcommand group to this command.
|
|
3841
|
+
*
|
|
3842
|
+
* @param input - A function that returns a subcommand group builder or an already built builder
|
|
3843
|
+
*/
|
|
3844
|
+
addSubcommandGroup(input) {
|
|
3845
|
+
const { options } = this;
|
|
3846
|
+
validateMaxOptionsLength(options);
|
|
3847
|
+
const result = typeof input === "function" ? input(new SlashCommandSubcommandGroupBuilder()) : input;
|
|
3848
|
+
assertReturnOfBuilder2(result, SlashCommandSubcommandGroupBuilder);
|
|
3849
|
+
options.push(result);
|
|
3850
|
+
return this;
|
|
3851
|
+
}
|
|
3852
|
+
/**
|
|
3853
|
+
* Adds a new subcommand to this command.
|
|
3854
|
+
*
|
|
3855
|
+
* @param input - A function that returns a subcommand builder or an already built builder
|
|
3856
|
+
*/
|
|
3857
|
+
addSubcommand(input) {
|
|
3858
|
+
const { options } = this;
|
|
3859
|
+
validateMaxOptionsLength(options);
|
|
3860
|
+
const result = typeof input === "function" ? input(new SlashCommandSubcommandBuilder()) : input;
|
|
3861
|
+
assertReturnOfBuilder2(result, SlashCommandSubcommandBuilder);
|
|
3862
|
+
options.push(result);
|
|
3863
|
+
return this;
|
|
3864
|
+
}
|
|
3865
|
+
};
|
|
3866
|
+
|
|
3867
|
+
// src/interactions/slashCommands/SlashCommandBuilder.ts
|
|
3868
|
+
var SlashCommandBuilder = class {
|
|
3869
|
+
/**
|
|
3870
|
+
* The name of this command.
|
|
3871
|
+
*/
|
|
3872
|
+
name = void 0;
|
|
3873
|
+
/**
|
|
3874
|
+
* The name localizations of this command.
|
|
3875
|
+
*/
|
|
3876
|
+
name_localizations;
|
|
3877
|
+
/**
|
|
3878
|
+
* The description of this command.
|
|
3879
|
+
*/
|
|
3880
|
+
description = void 0;
|
|
3881
|
+
/**
|
|
3882
|
+
* The description localizations of this command.
|
|
3883
|
+
*/
|
|
3884
|
+
description_localizations;
|
|
3885
|
+
/**
|
|
3886
|
+
* The options of this command.
|
|
3887
|
+
*/
|
|
3888
|
+
options = [];
|
|
3889
|
+
/**
|
|
3890
|
+
* The contexts for this command.
|
|
3891
|
+
*/
|
|
3892
|
+
contexts;
|
|
3893
|
+
/**
|
|
3894
|
+
* Whether this command is enabled by default when the application is added to a guild.
|
|
3895
|
+
*
|
|
3896
|
+
* @deprecated Use {@link SharedSlashCommand.setDefaultMemberPermissions} or {@link SharedSlashCommand.setDMPermission} instead.
|
|
3897
|
+
*/
|
|
3898
|
+
default_permission = void 0;
|
|
3899
|
+
/**
|
|
3900
|
+
* The set of permissions represented as a bit set for the command.
|
|
3901
|
+
*/
|
|
3902
|
+
default_member_permissions = void 0;
|
|
3903
|
+
/**
|
|
3904
|
+
* Indicates whether the command is available in direct messages with the application.
|
|
3905
|
+
*
|
|
3906
|
+
* @remarks
|
|
3907
|
+
* By default, commands are visible. This property is only for global commands.
|
|
3908
|
+
* @deprecated
|
|
3909
|
+
* Use {@link SlashCommandBuilder.contexts} instead.
|
|
3910
|
+
*/
|
|
3911
|
+
dm_permission = void 0;
|
|
3912
|
+
/**
|
|
3913
|
+
* The integration types for this command.
|
|
3914
|
+
*/
|
|
3915
|
+
integration_types;
|
|
3916
|
+
/**
|
|
3917
|
+
* Whether this command is NSFW.
|
|
3918
|
+
*/
|
|
3919
|
+
nsfw = void 0;
|
|
3920
|
+
};
|
|
3921
|
+
__name(SlashCommandBuilder, "SlashCommandBuilder");
|
|
3922
|
+
SlashCommandBuilder = __decorateClass([
|
|
3923
|
+
(0, import_ts_mixer6.mix)(SharedSlashCommandOptions, SharedNameAndDescription, SharedSlashCommandSubcommands, SharedSlashCommand)
|
|
3924
|
+
], SlashCommandBuilder);
|
|
3925
|
+
|
|
3926
|
+
// src/interactions/contextMenuCommands/Assertions.ts
|
|
3927
|
+
var Assertions_exports10 = {};
|
|
3928
|
+
__export(Assertions_exports10, {
|
|
3929
|
+
contextsPredicate: () => contextsPredicate2,
|
|
3930
|
+
integrationTypesPredicate: () => integrationTypesPredicate2,
|
|
3931
|
+
validateDMPermission: () => validateDMPermission2,
|
|
3932
|
+
validateDefaultMemberPermissions: () => validateDefaultMemberPermissions2,
|
|
3933
|
+
validateDefaultPermission: () => validateDefaultPermission2,
|
|
3934
|
+
validateName: () => validateName2,
|
|
3935
|
+
validateRequiredParameters: () => validateRequiredParameters4,
|
|
3936
|
+
validateType: () => validateType
|
|
3937
|
+
});
|
|
3938
|
+
var import_shapeshift16 = require("@sapphire/shapeshift");
|
|
3939
|
+
var import_v1040 = require("discord-api-types/v10");
|
|
3940
|
+
var namePredicate2 = import_shapeshift16.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/\S/).setValidationEnabled(isValidationEnabled);
|
|
3941
|
+
var typePredicate = import_shapeshift16.s.union([import_shapeshift16.s.literal(import_v1040.ApplicationCommandType.User), import_shapeshift16.s.literal(import_v1040.ApplicationCommandType.Message)]).setValidationEnabled(isValidationEnabled);
|
|
3942
|
+
var booleanPredicate3 = import_shapeshift16.s.boolean();
|
|
3943
|
+
function validateDefaultPermission2(value) {
|
|
3944
|
+
booleanPredicate3.parse(value);
|
|
3945
|
+
}
|
|
3946
|
+
__name(validateDefaultPermission2, "validateDefaultPermission");
|
|
3947
|
+
function validateName2(name) {
|
|
3948
|
+
namePredicate2.parse(name);
|
|
3949
|
+
}
|
|
3950
|
+
__name(validateName2, "validateName");
|
|
3951
|
+
function validateType(type) {
|
|
3952
|
+
typePredicate.parse(type);
|
|
3953
|
+
}
|
|
3954
|
+
__name(validateType, "validateType");
|
|
3955
|
+
function validateRequiredParameters4(name, type) {
|
|
3956
|
+
validateName2(name);
|
|
3957
|
+
validateType(type);
|
|
3958
|
+
}
|
|
3959
|
+
__name(validateRequiredParameters4, "validateRequiredParameters");
|
|
3960
|
+
var dmPermissionPredicate2 = import_shapeshift16.s.boolean().nullish();
|
|
3961
|
+
function validateDMPermission2(value) {
|
|
3962
|
+
dmPermissionPredicate2.parse(value);
|
|
3963
|
+
}
|
|
3964
|
+
__name(validateDMPermission2, "validateDMPermission");
|
|
3965
|
+
var memberPermissionPredicate2 = import_shapeshift16.s.union([
|
|
3966
|
+
import_shapeshift16.s.bigint().transform((value) => value.toString()),
|
|
3967
|
+
import_shapeshift16.s.number().safeInt().transform((value) => value.toString()),
|
|
3968
|
+
import_shapeshift16.s.string().regex(/^\d+$/)
|
|
3969
|
+
]).nullish();
|
|
3970
|
+
function validateDefaultMemberPermissions2(permissions) {
|
|
3971
|
+
return memberPermissionPredicate2.parse(permissions);
|
|
3972
|
+
}
|
|
3973
|
+
__name(validateDefaultMemberPermissions2, "validateDefaultMemberPermissions");
|
|
3974
|
+
var contextsPredicate2 = import_shapeshift16.s.array(
|
|
3975
|
+
import_shapeshift16.s.nativeEnum(import_v1040.InteractionContextType).setValidationEnabled(isValidationEnabled)
|
|
3976
|
+
);
|
|
3977
|
+
var integrationTypesPredicate2 = import_shapeshift16.s.array(
|
|
3978
|
+
import_shapeshift16.s.nativeEnum(import_v1040.ApplicationIntegrationType).setValidationEnabled(isValidationEnabled)
|
|
3979
|
+
);
|
|
3980
|
+
|
|
3981
|
+
// src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts
|
|
3982
|
+
var ContextMenuCommandBuilder = class {
|
|
3983
|
+
static {
|
|
3984
|
+
__name(this, "ContextMenuCommandBuilder");
|
|
3985
|
+
}
|
|
3986
|
+
/**
|
|
3987
|
+
* The name of this command.
|
|
3988
|
+
*/
|
|
3989
|
+
name = void 0;
|
|
3990
|
+
/**
|
|
3991
|
+
* The name localizations of this command.
|
|
3992
|
+
*/
|
|
3993
|
+
name_localizations;
|
|
3994
|
+
/**
|
|
3995
|
+
* The type of this command.
|
|
3996
|
+
*/
|
|
3997
|
+
type = void 0;
|
|
3998
|
+
/**
|
|
3999
|
+
* The contexts for this command.
|
|
4000
|
+
*/
|
|
4001
|
+
contexts;
|
|
4002
|
+
/**
|
|
4003
|
+
* Whether this command is enabled by default when the application is added to a guild.
|
|
4004
|
+
*
|
|
4005
|
+
* @deprecated Use {@link ContextMenuCommandBuilder.setDefaultMemberPermissions} or {@link ContextMenuCommandBuilder.setDMPermission} instead.
|
|
4006
|
+
*/
|
|
4007
|
+
default_permission = void 0;
|
|
4008
|
+
/**
|
|
4009
|
+
* The set of permissions represented as a bit set for the command.
|
|
4010
|
+
*/
|
|
4011
|
+
default_member_permissions = void 0;
|
|
4012
|
+
/**
|
|
4013
|
+
* Indicates whether the command is available in direct messages with the application.
|
|
4014
|
+
*
|
|
4015
|
+
* @remarks
|
|
4016
|
+
* By default, commands are visible. This property is only for global commands.
|
|
4017
|
+
* @deprecated
|
|
4018
|
+
* Use {@link ContextMenuCommandBuilder.contexts} instead.
|
|
4019
|
+
*/
|
|
4020
|
+
dm_permission = void 0;
|
|
4021
|
+
/**
|
|
4022
|
+
* The integration types for this command.
|
|
4023
|
+
*/
|
|
4024
|
+
integration_types;
|
|
4025
|
+
/**
|
|
4026
|
+
* Sets the contexts of this command.
|
|
4027
|
+
*
|
|
4028
|
+
* @param contexts - The contexts
|
|
4029
|
+
*/
|
|
4030
|
+
setContexts(...contexts) {
|
|
4031
|
+
Reflect.set(this, "contexts", contextsPredicate2.parse(normalizeArray(contexts)));
|
|
4032
|
+
return this;
|
|
4033
|
+
}
|
|
4034
|
+
/**
|
|
4035
|
+
* Sets integration types of this command.
|
|
4036
|
+
*
|
|
4037
|
+
* @param integrationTypes - The integration types
|
|
4038
|
+
*/
|
|
4039
|
+
setIntegrationTypes(...integrationTypes) {
|
|
4040
|
+
Reflect.set(this, "integration_types", integrationTypesPredicate2.parse(normalizeArray(integrationTypes)));
|
|
4041
|
+
return this;
|
|
4042
|
+
}
|
|
4043
|
+
/**
|
|
4044
|
+
* Sets the name of this command.
|
|
4045
|
+
*
|
|
4046
|
+
* @param name - The name to use
|
|
4047
|
+
*/
|
|
4048
|
+
setName(name) {
|
|
4049
|
+
validateName2(name);
|
|
4050
|
+
Reflect.set(this, "name", name);
|
|
4051
|
+
return this;
|
|
4052
|
+
}
|
|
4053
|
+
/**
|
|
4054
|
+
* Sets the type of this command.
|
|
4055
|
+
*
|
|
4056
|
+
* @param type - The type to use
|
|
4057
|
+
*/
|
|
4058
|
+
setType(type) {
|
|
4059
|
+
validateType(type);
|
|
4060
|
+
Reflect.set(this, "type", type);
|
|
4061
|
+
return this;
|
|
4062
|
+
}
|
|
4063
|
+
/**
|
|
4064
|
+
* Sets whether the command is enabled by default when the application is added to a guild.
|
|
4065
|
+
*
|
|
4066
|
+
* @remarks
|
|
4067
|
+
* If set to `false`, you will have to later `PUT` the permissions for this command.
|
|
4068
|
+
* @param value - Whether to enable this command by default
|
|
4069
|
+
* @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
|
|
4070
|
+
* @deprecated Use {@link ContextMenuCommandBuilder.setDefaultMemberPermissions} or {@link ContextMenuCommandBuilder.setDMPermission} instead.
|
|
4071
|
+
*/
|
|
4072
|
+
setDefaultPermission(value) {
|
|
4073
|
+
validateDefaultPermission2(value);
|
|
4074
|
+
Reflect.set(this, "default_permission", value);
|
|
4075
|
+
return this;
|
|
4076
|
+
}
|
|
4077
|
+
/**
|
|
4078
|
+
* Sets the default permissions a member should have in order to run this command.
|
|
4079
|
+
*
|
|
4080
|
+
* @remarks
|
|
4081
|
+
* You can set this to `'0'` to disable the command by default.
|
|
4082
|
+
* @param permissions - The permissions bit field to set
|
|
4083
|
+
* @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
|
|
4084
|
+
*/
|
|
4085
|
+
setDefaultMemberPermissions(permissions) {
|
|
4086
|
+
const permissionValue = validateDefaultMemberPermissions2(permissions);
|
|
4087
|
+
Reflect.set(this, "default_member_permissions", permissionValue);
|
|
4088
|
+
return this;
|
|
4089
|
+
}
|
|
4090
|
+
/**
|
|
4091
|
+
* Sets if the command is available in direct messages with the application.
|
|
4092
|
+
*
|
|
4093
|
+
* @remarks
|
|
4094
|
+
* By default, commands are visible. This method is only for global commands.
|
|
4095
|
+
* @param enabled - Whether the command should be enabled in direct messages
|
|
4096
|
+
* @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions}
|
|
4097
|
+
* @deprecated Use {@link ContextMenuCommandBuilder.setContexts} instead.
|
|
4098
|
+
*/
|
|
4099
|
+
setDMPermission(enabled) {
|
|
4100
|
+
validateDMPermission2(enabled);
|
|
4101
|
+
Reflect.set(this, "dm_permission", enabled);
|
|
4102
|
+
return this;
|
|
4103
|
+
}
|
|
4104
|
+
/**
|
|
4105
|
+
* Sets a name localization for this command.
|
|
4106
|
+
*
|
|
4107
|
+
* @param locale - The locale to set
|
|
4108
|
+
* @param localizedName - The localized name for the given `locale`
|
|
4109
|
+
*/
|
|
4110
|
+
setNameLocalization(locale, localizedName) {
|
|
4111
|
+
if (!this.name_localizations) {
|
|
4112
|
+
Reflect.set(this, "name_localizations", {});
|
|
4113
|
+
}
|
|
4114
|
+
const parsedLocale = validateLocale(locale);
|
|
4115
|
+
if (localizedName === null) {
|
|
4116
|
+
this.name_localizations[parsedLocale] = null;
|
|
4117
|
+
return this;
|
|
4118
|
+
}
|
|
4119
|
+
validateName2(localizedName);
|
|
4120
|
+
this.name_localizations[parsedLocale] = localizedName;
|
|
4121
|
+
return this;
|
|
4122
|
+
}
|
|
4123
|
+
/**
|
|
4124
|
+
* Sets the name localizations for this command.
|
|
4125
|
+
*
|
|
4126
|
+
* @param localizedNames - The object of localized names to set
|
|
4127
|
+
*/
|
|
4128
|
+
setNameLocalizations(localizedNames) {
|
|
4129
|
+
if (localizedNames === null) {
|
|
4130
|
+
Reflect.set(this, "name_localizations", null);
|
|
4131
|
+
return this;
|
|
4132
|
+
}
|
|
4133
|
+
Reflect.set(this, "name_localizations", {});
|
|
4134
|
+
for (const args of Object.entries(localizedNames))
|
|
4135
|
+
this.setNameLocalization(...args);
|
|
4136
|
+
return this;
|
|
4137
|
+
}
|
|
4138
|
+
/**
|
|
4139
|
+
* Serializes this builder to API-compatible JSON data.
|
|
4140
|
+
*
|
|
4141
|
+
* @remarks
|
|
4142
|
+
* This method runs validations on the data before serializing it.
|
|
4143
|
+
* As such, it may throw an error if the data is invalid.
|
|
4144
|
+
*/
|
|
4145
|
+
toJSON() {
|
|
4146
|
+
validateRequiredParameters4(this.name, this.type);
|
|
4147
|
+
validateLocalizationMap(this.name_localizations);
|
|
4148
|
+
return { ...this };
|
|
4149
|
+
}
|
|
4150
|
+
};
|
|
4151
|
+
|
|
4152
|
+
// src/util/componentUtil.ts
|
|
4153
|
+
function embedLength(data) {
|
|
4154
|
+
return (data.title?.length ?? 0) + (data.description?.length ?? 0) + (data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) + (data.footer?.text.length ?? 0) + (data.author?.name.length ?? 0);
|
|
4155
|
+
}
|
|
4156
|
+
__name(embedLength, "embedLength");
|
|
4157
|
+
|
|
4158
|
+
// src/index.ts
|
|
4159
|
+
var version = "1.13.1";
|
|
4160
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4161
|
+
0 && (module.exports = {
|
|
4162
|
+
ActionRowBuilder,
|
|
4163
|
+
ApplicationCommandNumericOptionMinMaxValueMixin,
|
|
4164
|
+
ApplicationCommandOptionBase,
|
|
4165
|
+
ApplicationCommandOptionChannelTypesMixin,
|
|
4166
|
+
ApplicationCommandOptionWithAutocompleteMixin,
|
|
4167
|
+
ApplicationCommandOptionWithChoicesMixin,
|
|
4168
|
+
BaseSelectMenuBuilder,
|
|
4169
|
+
ButtonBuilder,
|
|
4170
|
+
ChannelSelectMenuBuilder,
|
|
4171
|
+
ComponentAssertions,
|
|
4172
|
+
ComponentBuilder,
|
|
4173
|
+
ComponentsV2Assertions,
|
|
4174
|
+
ContainerBuilder,
|
|
4175
|
+
ContextMenuCommandAssertions,
|
|
4176
|
+
ContextMenuCommandBuilder,
|
|
4177
|
+
EmbedAssertions,
|
|
4178
|
+
EmbedBuilder,
|
|
4179
|
+
FileBuilder,
|
|
4180
|
+
FileUploadAssertions,
|
|
4181
|
+
FileUploadBuilder,
|
|
4182
|
+
LabelAssertions,
|
|
4183
|
+
LabelBuilder,
|
|
4184
|
+
MediaGalleryBuilder,
|
|
4185
|
+
MediaGalleryItemBuilder,
|
|
4186
|
+
MentionableSelectMenuBuilder,
|
|
4187
|
+
ModalAssertions,
|
|
4188
|
+
ModalBuilder,
|
|
4189
|
+
RoleSelectMenuBuilder,
|
|
4190
|
+
SectionBuilder,
|
|
4191
|
+
SelectMenuAssertions,
|
|
4192
|
+
SelectMenuBuilder,
|
|
4193
|
+
SelectMenuOptionBuilder,
|
|
4194
|
+
SeparatorBuilder,
|
|
4195
|
+
SharedNameAndDescription,
|
|
4196
|
+
SharedSlashCommand,
|
|
4197
|
+
SharedSlashCommandOptions,
|
|
4198
|
+
SharedSlashCommandSubcommands,
|
|
4199
|
+
SlashCommandAssertions,
|
|
4200
|
+
SlashCommandAttachmentOption,
|
|
4201
|
+
SlashCommandBooleanOption,
|
|
4202
|
+
SlashCommandBuilder,
|
|
4203
|
+
SlashCommandChannelOption,
|
|
4204
|
+
SlashCommandIntegerOption,
|
|
4205
|
+
SlashCommandMentionableOption,
|
|
4206
|
+
SlashCommandNumberOption,
|
|
4207
|
+
SlashCommandRoleOption,
|
|
4208
|
+
SlashCommandStringOption,
|
|
4209
|
+
SlashCommandSubcommandBuilder,
|
|
4210
|
+
SlashCommandSubcommandGroupBuilder,
|
|
4211
|
+
SlashCommandUserOption,
|
|
4212
|
+
StringSelectMenuBuilder,
|
|
4213
|
+
StringSelectMenuOptionBuilder,
|
|
4214
|
+
TextDisplayBuilder,
|
|
4215
|
+
TextInputAssertions,
|
|
4216
|
+
TextInputBuilder,
|
|
4217
|
+
ThumbnailBuilder,
|
|
4218
|
+
UserSelectMenuBuilder,
|
|
4219
|
+
createComponentBuilder,
|
|
4220
|
+
disableValidators,
|
|
4221
|
+
embedLength,
|
|
4222
|
+
enableValidators,
|
|
4223
|
+
isValidationEnabled,
|
|
4224
|
+
normalizeArray,
|
|
4225
|
+
resolveBuilder,
|
|
4226
|
+
version,
|
|
4227
|
+
...require("@discordjs/formatters")
|
|
4228
|
+
});
|
|
4229
|
+
//# sourceMappingURL=index.js.map
|