UNPKG

lu-djs-utils

Version:

Un npm de utilidades para discord.js@v13

96 lines 2.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.actividades = void 0; const ids = { youtube: "880218394199220334", youtubedev: "880218832743055411", poker: "755827207812677713", betrayal: "773336526917861400", fishing: "814288819477020702", chess: "832012774040141894", chessdev: "832012586023256104", lettertile: "879863686565621790", wordsnack: "879863976006127627", doodlecrew: "878067389634314250", }; const ss = [ { name: "youtube", value: "yt", return: () => `${ids["youtube"]}`, }, { name: "poker", value: "poker", return: () => `${ids["poker"]}`, }, { name: "betrayal", value: "bet", return: () => `${ids["betrayal"]}`, }, { name: "fishing", value: "fishing", return: () => `${ids["fishing"]}`, }, { name: "chess", value: "chess", return: () => `${ids["chess"]}`, }, { name: "youtubedev", return: () => `${ids["youtubedev"]}`, }, { name: "chessdev", return: () => `${ids["chessdev"]}`, }, { name: "lettertile", return: () => `${ids["lettertile"]}`, }, { name: "wordsnack", return: () => `${ids["wordsnack"]}`, }, { name: "doodlecrew", return: () => `${ids["doodlecrew"]}`, }, ]; /** * @function * @description Actividades */ const actividades = async function (opciones) { const token = opciones.token; const canal = opciones.canalid; if (!canal) throw new Error("Prfavor proporciona la id de un canal."); if (!token) throw new TypeError("Porfavor pon un token."); if (!opciones.actividad) throw new TypeError("Porfavor pon una actividad."); const op = ss.find((ch) => ch.name === opciones.actividad); const data = await fetch(`https://discord.com/api/v8/channels/${canal}/invites`, { method: "POST", body: JSON.stringify({ max_age: 86400, max_uses: 0, target_application_id: op.return(), target_type: 2, temporary: false, validate: null, }), headers: { Authorization: `Bot ${token}`, "Content-Type": "application/json", }, }).then((res) => res.json()); const invite = `https://discord.com/invite/${data.code}`; return invite; }; exports.actividades = actividades; //# sourceMappingURL=actividades.js.map