diff --git a/.sern/ambient.d.ts b/.sern/ambient.d.ts new file mode 100644 index 0000000..dae3d05 --- /dev/null +++ b/.sern/ambient.d.ts @@ -0,0 +1,124 @@ +declare var __DEV__: boolean +declare var __PROD__: boolean +declare var __VERSION__: string +declare namespace NodeJS { + interface ProcessEnv { + SHELL:string + SESSION_MANAGER:string + COLORTERM:string + XDG_CONFIG_DIRS:string + XDG_SESSION_PATH:string + COREPACK_ENABLE_DOWNLOAD_PROMPT:string + NVM_INC:string + XDG_MENU_PREFIX:string + TERM_PROGRAM_VERSION:string + ICEAUTHORITY:string + NODE_OPTIONS:string + LC_ADDRESS:string + LC_NAME:string + MEMORY_PRESSURE_WRITE:string + DESKTOP_SESSION:string + LC_MONETARY:string + GTK_RC_FILES:string + NO_AT_BRIDGE:string + EDITOR:string + XDG_SEAT:string + PWD:string + LOGNAME:string + XDG_SESSION_DESKTOP:string + XDG_SESSION_TYPE:string + SYSTEMD_EXEC_PID:string + _:string + XAUTHORITY:string + VSCODE_GIT_ASKPASS_NODE:string + MOTD_SHOWN:string + GTK2_RC_FILES:string + HOME:string + COREPACK_ROOT:string + LANG:string + LC_PAPER:string + XDG_CURRENT_DESKTOP:string + npm_package_version:string + MEMORY_PRESSURE_WATCH:string + STARSHIP_SHELL:string + WAYLAND_DISPLAY:string + GIT_ASKPASS:string + XDG_SEAT_PATH:string + INVOCATION_ID:string + MANAGERPID:string + INIT_CWD:string + CHROME_DESKTOP:string + STARSHIP_SESSION_KEY:string + KDE_SESSION_UID:string + NVM_DIR:string + VSCODE_GIT_ASKPASS_EXTRA_ARGS:string + XKB_DEFAULT_LAYOUT:string + XDG_ACTIVATION_TOKEN:string + XDG_SESSION_CLASS:string + LC_IDENTIFICATION:string + TERM:string + npm_package_name:string + PROJECT_CWD:string + USER:string + VSCODE_GIT_IPC_HANDLE:string + QT_WAYLAND_RECONNECT:string + KDE_SESSION_VERSION:string + PAM_KWALLET5_LOGIN:string + DISPLAY:string + npm_lifecycle_event:string + SHLVL:string + NVM_CD_FLAGS:string + LC_TELEPHONE:string + LC_MEASUREMENT:string + XDG_VTNR:string + XDG_SESSION_ID:string + npm_config_user_agent:string + npm_execpath:string + XDG_RUNTIME_DIR:string + DEBUGINFOD_URLS:string + npm_package_json:string + LC_TIME:string + BUN_INSTALL:string + BERRY_BIN_FOLDER:string + XKB_DEFAULT_VARIANT:string + VSCODE_GIT_ASKPASS_MAIN:string + QT_AUTO_SCREEN_SCALE_FACTOR:string + JOURNAL_STREAM:string + XDG_DATA_DIRS:string + KDE_FULL_SESSION:string + GDK_BACKEND:string + BROWSER:string + PATH:string + ORIGINAL_XDG_CURRENT_DESKTOP:string + DBUS_SESSION_BUS_ADDRESS:string + KDE_APPLICATIONS_AS_SCOPE:string + MAIL:string + NVM_BIN:string + npm_node_execpath:string + LC_NUMERIC:string + OLDPWD:string + TERM_PROGRAM:string + TOKEN:string + PREFIX:string + MONGODB:string + YOURLS_KEY:string + CATAPI:string + DOGAPI:string + TWITTER:string + MAKESWEET:string + GENIUS:string + SPOTIFY_CLIENT:string + SPOTIFY_SECRET:string + CF_AI_TOKEN:string + CF_AI_ACC:string + GUILDID:string + SUGGESTIONS_CHANNEL:string + MODLOGS_CHANNEL:string + JOINSANDLEAVES_CHANNEL:string + SOCIALS_CHANNEL:string + BIRTHDAYS_CHANNEL:string + MCFORM_CHANNEL:string + CHATGPT_CHANNEL:string + T_CHANNEL:string + } +} diff --git a/.sern/command-data-remote.json b/.sern/command-data-remote.json new file mode 100644 index 0000000..acd1396 --- /dev/null +++ b/.sern/command-data-remote.json @@ -0,0 +1,1273 @@ +{ + "global": [ + { + "id": "1286740576624054273", + "application_id": "1045366661336793098", + "version": "1286740577286885445", + "default_member_permissions": null, + "type": 1, + "name": "ping", + "name_localizations": null, + "description": "A ping command", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740576624054274", + "application_id": "1045366661336793098", + "version": "1286740577458589777", + "default_member_permissions": null, + "type": 1, + "name": "warn", + "name_localizations": null, + "description": "ADMIN: Avisa a usuarios.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 1, + "name": "leve", + "name_localizations": null, + "description": "Aviso leve.", + "description_localizations": null, + "options": [ + { + "type": 6, + "name": "usuario", + "name_localizations": null, + "description": "el usuario al que avisar.", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "razon", + "name_localizations": null, + "description": "la razón aviso.", + "description_localizations": null, + "required": true + } + ] + }, + { + "type": 1, + "name": "grave", + "name_localizations": null, + "description": "Aviso grave.", + "description_localizations": null, + "options": [ + { + "type": 6, + "name": "usuario", + "name_localizations": null, + "description": "el usuario al que avisar.", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "razon", + "name_localizations": null, + "description": "la razón del aviso.", + "description_localizations": null, + "required": true + } + ] + }, + { + "type": 1, + "name": "clear", + "name_localizations": null, + "description": "Elimina los avisos de una persona.", + "description_localizations": null, + "options": [ + { + "type": 6, + "name": "usuario", + "name_localizations": null, + "description": "el usuario al que quitar el aviso.", + "description_localizations": null, + "required": true + } + ] + } + ], + "nsfw": false + }, + { + "id": "1286740576624054275", + "application_id": "1045366661336793098", + "version": "1286740577458589778", + "default_member_permissions": null, + "type": 1, + "name": "timeout", + "name_localizations": null, + "description": "ADMIN: Silencia a usuarios.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 6, + "name": "usuario", + "name_localizations": null, + "description": "Escribe el usuario que silenciar.", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "razon", + "name_localizations": null, + "description": "Escribe el razon que vas a silenciar.", + "description_localizations": null, + "required": true + }, + { + "type": 10, + "name": "minutos", + "name_localizations": null, + "description": "Escribe los minutos que estará silenciado.", + "description_localizations": null, + "required": true, + "min_value": 0 + } + ], + "nsfw": false + }, + { + "id": "1286740576624054276", + "application_id": "1045366661336793098", + "version": "1286740577458589779", + "default_member_permissions": null, + "type": 1, + "name": "slowmode", + "name_localizations": null, + "description": "ADMIN: Pon modo lento a canales de texto", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 10, + "name": "segundos", + "name_localizations": null, + "description": "Los segundos de modo lento", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "razon", + "name_localizations": null, + "description": "La razón del modo lento", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740576624054277", + "application_id": "1045366661336793098", + "version": "1286740577458589780", + "default_member_permissions": null, + "type": 1, + "name": "prune", + "name_localizations": null, + "description": "ADMIN: Elimina hasta 100 mensajes", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 10, + "name": "numero", + "name_localizations": null, + "description": "Escribe un número", + "description_localizations": null, + "required": true, + "min_value": 1, + "max_value": 100 + } + ], + "nsfw": false + }, + { + "id": "1286740576624054278", + "application_id": "1045366661336793098", + "version": "1286740577458589781", + "default_member_permissions": null, + "type": 1, + "name": "kick", + "name_localizations": null, + "description": "ADMIN: Expulsa usuarios.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 6, + "name": "usuario", + "name_localizations": null, + "description": "Escribe un usuario.", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "razon", + "name_localizations": null, + "description": "Escribe la razón.", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740576624054279", + "application_id": "1045366661336793098", + "version": "1286740577458589782", + "default_member_permissions": null, + "type": 1, + "name": "eliminarmensaje", + "name_localizations": null, + "description": "ADMIN: Elimina comandos por su ID.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 7, + "name": "canal", + "name_localizations": null, + "description": "El canal de texto.", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "id", + "name_localizations": null, + "description": "El ID del mensaje.", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740576624054280", + "application_id": "1045366661336793098", + "version": "1286740577458589783", + "default_member_permissions": null, + "type": 1, + "name": "ban", + "name_localizations": null, + "description": "ADMIN: Banea usuarios.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 6, + "name": "usuario", + "name_localizations": null, + "description": "Escribe un usuario.", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "razon", + "name_localizations": null, + "description": "Escribe la razón.", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740576624054281", + "application_id": "1045366661336793098", + "version": "1286740577458589784", + "default_member_permissions": null, + "type": 1, + "name": "wikipedia", + "name_localizations": null, + "description": "Busca cosas por wikipedia", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 1, + "name": "español", + "name_localizations": null, + "description": "Busca cosas por Wikipedia en español", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "busqueda", + "name_localizations": null, + "description": "Escribe qué buscar.", + "description_localizations": null, + "required": true, + "autocomplete": true + } + ] + }, + { + "type": 1, + "name": "ingles", + "name_localizations": null, + "description": "Busca cosas por Wikipedia en inglés", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "search", + "name_localizations": null, + "description": "Escribe qué buscar.", + "description_localizations": null, + "required": true, + "autocomplete": true + } + ] + } + ], + "nsfw": false + }, + { + "id": "1286740577022378116", + "application_id": "1045366661336793098", + "version": "1286740577458589785", + "default_member_permissions": null, + "type": 1, + "name": "uptime", + "name_localizations": null, + "description": "Enseña el tiempo que ha estado encendido el bot.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577022378117", + "application_id": "1045366661336793098", + "version": "1286740577458589786", + "default_member_permissions": null, + "type": 1, + "name": "traducir", + "name_localizations": null, + "description": "Traduce lo que quieras!", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "frase", + "name_localizations": null, + "description": "La frase que traducir", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "idioma", + "name_localizations": null, + "description": "El idioma al que quieras traducir", + "description_localizations": null, + "required": true, + "autocomplete": true + } + ], + "nsfw": false + }, + { + "id": "1286740577022378118", + "application_id": "1045366661336793098", + "version": "1286740577500790978", + "default_member_permissions": null, + "type": 1, + "name": "sugerencias", + "name_localizations": null, + "description": "Envia una sugerencia.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577022378119", + "application_id": "1045366661336793098", + "version": "1286740577500790979", + "default_member_permissions": null, + "type": 1, + "name": "stats", + "name_localizations": null, + "description": "Enseña estadísticas del bot.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577022378120", + "application_id": "1045366661336793098", + "version": "1286740577500790980", + "default_member_permissions": null, + "type": 1, + "name": "acortar", + "name_localizations": null, + "description": "Acorta una URL a vinci.tk", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "url", + "name_localizations": null, + "description": "la URL larga", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740577022378121", + "application_id": "1045366661336793098", + "version": "1286740577500790981", + "default_member_permissions": null, + "type": 1, + "name": "rolemenu", + "name_localizations": null, + "description": "ADMIN: Spawnea un menú de roles", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 7, + "name": "channel", + "name_localizations": null, + "description": "The channel to send the message to", + "description_localizations": null, + "required": true, + "channel_types": [ + 0 + ] + }, + { + "type": 3, + "name": "role", + "name_localizations": null, + "description": "The roles to attach (upto 25)", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "message", + "name_localizations": null, + "description": "The message to send", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740577022378122", + "application_id": "1045366661336793098", + "version": "1286740577500790982", + "default_member_permissions": null, + "type": 1, + "name": "radio", + "name_localizations": null, + "description": "Reproduce la radio", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "reproducir", + "name_localizations": null, + "description": "Reproduce una radio de la lista", + "description_localizations": null, + "required": true, + "autocomplete": true + } + ], + "nsfw": false + }, + { + "id": "1286740577022378123", + "application_id": "1045366661336793098", + "version": "1286740577500790983", + "default_member_permissions": null, + "type": 1, + "name": "letra", + "name_localizations": null, + "description": "Busca la letra de una canción (Genius)", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "busqueda", + "name_localizations": null, + "description": "Qué buscar", + "description_localizations": null, + "required": true, + "autocomplete": true + } + ], + "nsfw": false + }, + { + "id": "1286740577022378124", + "application_id": "1045366661336793098", + "version": "1286740577500790984", + "default_member_permissions": null, + "type": 1, + "name": "infinitecraft", + "name_localizations": null, + "description": "Descifra con un algoritmo cómo llegar a la receta de un objeto en InfiniteCraft", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "objeto", + "name_localizations": null, + "description": "El objeto que quieres descifrar", + "description_localizations": null, + "required": true, + "autocomplete": true + } + ], + "nsfw": false + }, + { + "id": "1286740577022378125", + "application_id": "1045366661336793098", + "version": "1286740577500790985", + "default_member_permissions": null, + "type": 3, + "name": "Clasifica una imagen", + "name_localizations": null, + "description": "", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577148338260", + "application_id": "1045366661336793098", + "version": "1286740577500790986", + "default_member_permissions": null, + "type": 1, + "name": "google", + "name_localizations": null, + "description": "Busca cosas en Google.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "busqueda", + "name_localizations": null, + "description": "Escribe qué quieres buscar", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740577148338261", + "application_id": "1045366661336793098", + "version": "1286740577500790987", + "default_member_permissions": null, + "type": 1, + "name": "faq", + "name_localizations": null, + "description": "Preguntas normalmente preguntadas :pepega:", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 1, + "name": "minecraft", + "name_localizations": null, + "description": "Preguntas normalmente preguntadas de Minecraft", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "pregunta", + "name_localizations": null, + "description": "La pregunta", + "description_localizations": null, + "required": true, + "autocomplete": true + }, + { + "type": 6, + "name": "para", + "name_localizations": null, + "description": "Menciona a la persona a la que vaya esto.", + "description_localizations": null + } + ] + } + ], + "nsfw": false + }, + { + "id": "1286740577148338262", + "application_id": "1045366661336793098", + "version": "1286740577647464492", + "default_member_permissions": null, + "type": 1, + "name": "cumple", + "name_localizations": null, + "description": "Pon tu cumpleaños en la base de datos para ser felicitado!", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "fecha", + "name_localizations": null, + "description": "La fecha de tu cumple (D-M) (elige en el autocompletado)", + "description_localizations": null, + "required": true, + "autocomplete": true + } + ], + "nsfw": false + }, + { + "id": "1286740577148338263", + "application_id": "1045366661336793098", + "version": "1286740577647464493", + "default_member_permissions": null, + "type": 1, + "name": "creditos", + "name_localizations": null, + "description": "Créditos del bot (en inglés)", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577148338264", + "application_id": "1045366661336793098", + "version": "1286740577647464494", + "default_member_permissions": null, + "type": 1, + "name": "askjavi", + "name_localizations": null, + "description": "TEMP: Pregunta a Javi LO QUE SEA!", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 1, + "name": "new", + "name_localizations": null, + "description": "Haz una nueva pregunta", + "description_localizations": null + }, + { + "type": 1, + "name": "get", + "name_localizations": null, + "description": "Mira una pregunta teniendo su ID.", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "id", + "name_localizations": null, + "description": "El ID de la pregunta", + "description_localizations": null, + "required": true + } + ] + }, + { + "type": 1, + "name": "you", + "name_localizations": null, + "description": "Todos los IDs de las preguntas que hayas hecho", + "description_localizations": null + }, + { + "type": 1, + "name": "answered", + "name_localizations": null, + "description": "ORGANIZADOR: Todos los IDs de las preguntas que hayas hecho", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "id", + "name_localizations": null, + "description": "El ID de la pregunta", + "description_localizations": null, + "required": true + } + ] + } + ], + "nsfw": false + }, + { + "id": "1286740577148338265", + "application_id": "1045366661336793098", + "version": "1286740577647464495", + "default_member_permissions": null, + "type": 1, + "name": "afk", + "name_localizations": null, + "description": "afk command", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 1, + "name": "añadir", + "name_localizations": null, + "description": "Di que estás AFK o inactivo por la razón que quieras.", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "motivo", + "name_localizations": null, + "description": "El motivo por el que estarás AFK", + "description_localizations": null, + "required": true + } + ] + }, + { + "type": 1, + "name": "eliminar", + "name_localizations": null, + "description": "Elimina tu AFK", + "description_localizations": null + }, + { + "type": 1, + "name": "lista", + "name_localizations": null, + "description": "Listado de todas las personas AFK", + "description_localizations": null + } + ], + "nsfw": false + }, + { + "id": "1286740577148338266", + "application_id": "1045366661336793098", + "version": "1286740577647464496", + "default_member_permissions": null, + "type": 1, + "name": "mcform", + "name_localizations": null, + "description": "Envia el formulario para entrar al servidor.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577148338267", + "application_id": "1045366661336793098", + "version": "1286740577647464497", + "default_member_permissions": null, + "type": 1, + "name": "ip", + "name_localizations": null, + "description": "La IP del servidor de Minecraft", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 6, + "name": "usuario", + "name_localizations": null, + "description": "Menciona al usuario al que va dirigido el comando.", + "description_localizations": null + } + ], + "nsfw": false + }, + { + "id": "1286740577148338268", + "application_id": "1045366661336793098", + "version": "1286740577647464498", + "default_member_permissions": null, + "type": 3, + "name": "bonzify", + "name_localizations": null, + "description": "", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577148338269", + "application_id": "1045366661336793098", + "version": "1286740577647464499", + "default_member_permissions": null, + "type": 1, + "name": "tictactoe", + "name_localizations": null, + "description": "tres en raya", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 6, + "name": "opponent", + "name_localizations": null, + "description": "opponent", + "description_localizations": null + } + ], + "nsfw": false + }, + { + "id": "1286740577286885436", + "application_id": "1045366661336793098", + "version": "1286740577647464500", + "default_member_permissions": null, + "type": 1, + "name": "rps", + "name_localizations": null, + "description": "Juega piedra papel tijeras con los panas", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 6, + "name": "usuario", + "name_localizations": null, + "description": "El usuario con el que enfrentarse", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740577286885437", + "application_id": "1045366661336793098", + "version": "1286740577647464501", + "default_member_permissions": null, + "type": 1, + "name": "megamind", + "name_localizations": null, + "description": "Añade a una imagen de megamind \"No ...?\"", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "texto", + "name_localizations": null, + "description": "El texto SIN \"No\" ni \"?\".", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + }, + { + "id": "1286740577286885438", + "application_id": "1045366661336793098", + "version": "1286740577710243880", + "default_member_permissions": null, + "type": 1, + "name": "makesweet", + "name_localizations": null, + "description": "no one will read this (i hope)", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 1, + "name": "heartlocket", + "name_localizations": null, + "description": "El corazón con una imagen que todos conocemos", + "description_localizations": null, + "options": [ + { + "type": 11, + "name": "imagen", + "name_localizations": null, + "description": "Imagen (jpg o png)", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "texto", + "name_localizations": null, + "description": "El texto que poner", + "description_localizations": null + } + ] + } + ], + "nsfw": false + }, + { + "id": "1286740577286885439", + "application_id": "1045366661336793098", + "version": "1286740577710243881", + "default_member_permissions": null, + "type": 1, + "name": "chiste", + "name_localizations": null, + "description": "Enseña un chiste en inglés.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577286885440", + "application_id": "1045366661336793098", + "version": "1286740577710243882", + "default_member_permissions": null, + "type": 1, + "name": "gogoanime", + "name_localizations": null, + "description": "busca cosas en gogoanime", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 1, + "name": "buscar", + "name_localizations": null, + "description": "Busca un anime", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "palabra-clave", + "name_localizations": null, + "description": "La palabra clave", + "description_localizations": null, + "required": true + } + ] + }, + { + "type": 1, + "name": "capitulo", + "name_localizations": null, + "description": "Mira los links de directo de cualquier capítulo (con su ID)", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "id-serie", + "name_localizations": null, + "description": "El ID de la serie (búscalo primero)", + "description_localizations": null, + "required": true + }, + { + "type": 3, + "name": "id-capitulo", + "name_localizations": null, + "description": "El ID del capítulo (usa el autocompletado)", + "description_localizations": null, + "required": true, + "autocomplete": true + } + ] + }, + { + "type": 1, + "name": "info", + "name_localizations": null, + "description": "INGLÉS: Consigue información sobre alguna serie con su ID.", + "description_localizations": null, + "options": [ + { + "type": 3, + "name": "id", + "name_localizations": null, + "description": "El nombre de la serie", + "description_localizations": null, + "required": true + } + ] + } + ], + "nsfw": false + }, + { + "id": "1286740577286885441", + "application_id": "1045366661336793098", + "version": "1286740577710243883", + "default_member_permissions": null, + "type": 3, + "name": "cursivify", + "name_localizations": null, + "description": "", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "nsfw": false + }, + { + "id": "1286740577286885442", + "application_id": "1045366661336793098", + "version": "1286740577710243884", + "default_member_permissions": null, + "type": 1, + "name": "animal", + "name_localizations": null, + "description": "Enseña un animal", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 1, + "name": "gato", + "name_localizations": null, + "description": "Enseña un gato", + "description_localizations": null + }, + { + "type": 1, + "name": "capybara", + "name_localizations": null, + "description": "Enseña un capybara", + "description_localizations": null + }, + { + "type": 1, + "name": "zorro", + "name_localizations": null, + "description": "Enseña un zorro", + "description_localizations": null + }, + { + "type": 1, + "name": "perro", + "name_localizations": null, + "description": "what the dog doin", + "description_localizations": null + }, + { + "type": 1, + "name": "mapache", + "name_localizations": null, + "description": "Enseña un mapache", + "description_localizations": null + } + ], + "nsfw": false + }, + { + "id": "1286740577286885443", + "application_id": "1045366661336793098", + "version": "1286740577710243885", + "default_member_permissions": null, + "type": 1, + "name": "a", + "name_localizations": null, + "description": "A", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "usuario", + "name_localizations": null, + "description": "Usuario que debería aparecer", + "description_localizations": null, + "autocomplete": true + } + ], + "nsfw": false + }, + { + "id": "1286740577286885444", + "application_id": "1045366661336793098", + "version": "1286740577710243886", + "default_member_permissions": null, + "type": 1, + "name": "8ball", + "name_localizations": null, + "description": "Preguntale a la 8-ball cosas.", + "description_localizations": null, + "dm_permission": true, + "contexts": null, + "integration_types": [ + 0 + ], + "options": [ + { + "type": 3, + "name": "pregunta", + "name_localizations": null, + "description": "Escribe lo que le quieres preguntar.", + "description_localizations": null, + "required": true + } + ], + "nsfw": false + } + ] +} \ No newline at end of file diff --git a/.sern/tsconfig.json b/.sern/tsconfig.json new file mode 100644 index 0000000..c4d2847 --- /dev/null +++ b/.sern/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "esnext", + "moduleResolution": "node16", + "strict": true, + "skipLibCheck": true, + "target": "esnext", + "rootDirs": [ + "./generated", + "../src" + ] + }, + "include": [ + "./ambient.d.ts", + "../src" + ] +} \ No newline at end of file diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index aebbed5..191028d 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/Dockerfile b/Dockerfile index b8e2967..d19023a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,9 +21,8 @@ FROM node:lts-alpine AS final WORKDIR /app COPY --from=build /app/dist ./dist -COPY --from=build /app/schemas ./schemas -COPY --from=build /app/util ./util -COPY --from=build /app/images ./images +COPY --from=build /app/src ./src +COPY --from=build /app/assets ./assets COPY --from=build /app/node_modules ./node_modules COPY --from=build /app/package.json ./package.json RUN apk add --no-cache ffmpeg msttcorefonts-installer fontconfig && \ diff --git a/util/infinitecraft/recipes.json b/assets/icRecipes.json similarity index 100% rename from util/infinitecraft/recipes.json rename to assets/icRecipes.json diff --git a/util/tags/minecraft.json b/assets/mcTags.json similarity index 100% rename from util/tags/minecraft.json rename to assets/mcTags.json diff --git a/commands/handlers/mcping-players.ts b/commands/handlers/mcping-players.ts deleted file mode 100644 index 8f495af..0000000 --- a/commands/handlers/mcping-players.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { commandModule, CommandType } from '@sern/handler'; -import axios from 'axios'; - -export default commandModule({ - type: CommandType.Button, - plugins: [], - execute: async (ctx) => { - await ctx.deferReply({ ephemeral: true }) - const request = await axios.get('https://api.minetools.eu/query/minecraft.maraturing.com/25565').then(res => res.data) - - await ctx.editReply({ - content: `` - }) - }, -}); \ No newline at end of file diff --git a/commands/misc/askjavi.ts b/commands/misc/askjavi.ts deleted file mode 100644 index 4036688..0000000 --- a/commands/misc/askjavi.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; -import { ApplicationCommandOptionType } from "discord.js"; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ - -export default commandModule({ - name: 'askjavi', - type: CommandType.Slash, - plugins: [publish()], - description: 'DESACTIVADO: Pregunta a Javi LO QUE SEA!', - //alias : [], - execute: async (ctx, options) => { - await ctx.reply({content: `Este comando ha sido desactivado ya que era para un evento que ya ha ocurrido.\nGracias por haber participado!`, ephemeral: true}) - }, -}); \ No newline at end of file diff --git a/commands/moderation/ban.ts b/commands/moderation/ban.ts deleted file mode 100644 index 748b610..0000000 --- a/commands/moderation/ban.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins";; -import { ApplicationCommandOptionType, EmbedBuilder, GuildMember, TextChannel } from 'discord.js' - -export default commandModule({ - name: 'ban', - type: CommandType.Slash, - plugins: [publish(), ownerOnly()], - description: 'ADMIN: Banea usuarios.', - options: [{ - name: 'usuario', - description: 'Escribe un usuario.', - type: ApplicationCommandOptionType.User, - required: true - }, - { - name: 'razon', - description: 'Escribe la razón.', - type: ApplicationCommandOptionType.String, - required: true - }], - //alias : [], - execute: async (ctx, options) => { - try { - const userToBan = options[1].getMember('usuario') as GuildMember - const reason = options[1].getString('razon') as string - userToBan.ban({reason: reason}) - const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel - await sendToMods.send({content: `Se ha baneado a ${userToBan}.\nBan efectuado por ${ctx.user} con razón "${reason}."`}) - await ctx.reply({content: 'Baneado correctamente!', ephemeral: true}) - } catch { - await ctx.reply({content: `ERROR: No puedo hacer este comando porque a lo mejor soy inferior que el rol de esa persona o estoy usándolo contra admins.`}) - } - }, -}); \ No newline at end of file diff --git a/commands/moderation/deleteMessage.ts b/commands/moderation/deleteMessage.ts deleted file mode 100644 index 77243ec..0000000 --- a/commands/moderation/deleteMessage.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { commandModule, CommandType } from '@sern/handler' -import { publish } from "../../plugins/index.js"; -import { ownerOnly } from "#plugins"; -import { ApplicationCommandOptionType, TextChannel } from "discord.js"; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ - -export default commandModule({ - name: 'eliminarmensaje', - type: CommandType.Slash, - plugins: [publish(), ownerOnly()], - description: 'ADMIN: Elimina comandos por su ID.', - //alias : [], - options: [ - { - name: 'canal', - type: ApplicationCommandOptionType.Channel, - description: 'El canal de texto.', - required: true - }, - { - name: 'id', - type: ApplicationCommandOptionType.String, - description: 'El ID del mensaje.', - required: true - } - ], - execute: async (ctx, options) => { - try { - const idMensaje = options[1].getString('id', true); - const guildId = ctx.guild!.id - const guild = await ctx.client.guilds.fetch(guildId); - const channel = await guild.channels.fetch(ctx.channel!.id); - (await (channel as TextChannel).messages.fetch(idMensaje)).delete(); - await ctx.reply({content: 'Mensaje eliminado correctamente.', ephemeral: true}); - } catch { - await ctx.reply({content: `ERROR: No se ha podido eliminar el mensaje, asegúrate que estás usando el ID y el canal correcto.`}) - } - }, -}); \ No newline at end of file diff --git a/commands/moderation/kick.ts b/commands/moderation/kick.ts deleted file mode 100644 index 5089d90..0000000 --- a/commands/moderation/kick.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins";; -import { ApplicationCommandOptionType, EmbedBuilder, GuildMember, TextChannel } from 'discord.js' - -export default commandModule({ - name: 'kick', - type: CommandType.Slash, - plugins: [publish(), ownerOnly()], - description: 'ADMIN: Expulsa usuarios.', - options: [ - { - name: 'usuario', - description: 'Escribe un usuario.', - type: ApplicationCommandOptionType.User, - required: true - }, - { - name: 'razon', - description: 'Escribe la razón.', - type: ApplicationCommandOptionType.String, - required: true - } -], - //alias : [], - execute: async (ctx, options) => { - try { - const userToKick = options[1].getMember('usuario'); - const reason = options[1].getString('razon') as string; - (userToKick as GuildMember).kick(reason) - const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel - await sendToMods!.send({content: `Se ha expulsado a ${userToKick}.\nKick efectuado por ${ctx.user} con razón "${reason}."`}) - await ctx.reply({content: 'Expulsado correctamente!'}) - } catch { - await ctx.reply({content: `ERROR: No puedo hacer este comando porque a lo mejor soy inferior que el rol de esa persona o estoy usándolo contra admins.`}) - } - }, -}); \ No newline at end of file diff --git a/commands/moderation/timeoutUser.ts b/commands/moderation/timeoutUser.ts deleted file mode 100644 index 530ccd9..0000000 --- a/commands/moderation/timeoutUser.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; -import { ApplicationCommandOptionType, GuildMember, TextChannel } from "discord.js"; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ - -export default commandModule({ - name: 'timeout', - type: CommandType.Slash, - plugins: [publish(), ownerOnly()], - description: 'ADMIN: Silencia a usuarios.', - options: [ - { - name: "usuario", - description: "Escribe el usuario que silenciar.", - type: ApplicationCommandOptionType.User, - required: true - }, - { - name: "razon", - description: "Escribe el razon que vas a silenciar.", - type: ApplicationCommandOptionType.String, - required: true - }, - { - name: "minutos", - description: "Escribe los minutos que estará silenciado.", - type: ApplicationCommandOptionType.Number, - min_value: 0, - required: true - } - ], - //alias : [], - execute: async (ctx, options) => { - try { - const usuario = options[1].getMember('usuario') as GuildMember - const minutos = options[1].getNumber('minutos') as number - const razon = options[1].getString('razon', true); - const minutosToMilisegundos = minutos * 60 * 1000 - usuario.timeout(minutosToMilisegundos, razon).then(() => {ctx.reply({content: `Se ha silenciado a ${usuario} correctamente.`, ephemeral: true})}) - const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel - await sendToMods.send({content: `Se ha silenciado a ${usuario}.\nSlencio efectuado por ${ctx.user} con ${minutos} minutos de duración.\nRazón: ${razon}`}) - } catch { - await ctx.reply({content: `ERROR: No puedo hacer este comando porque a lo mejor soy inferior que el rol de esa persona o estoy usándolo contra admins.`}) - } - }, -}); \ No newline at end of file diff --git a/commands/moderation/warn.ts b/commands/moderation/warn.ts deleted file mode 100644 index 9e68718..0000000 --- a/commands/moderation/warn.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins";; -import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonInteraction, ButtonStyle, ComponentType, EmbedBuilder, GuildMember } from "discord.js"; -import db from '../../schemas/warn.js'; - -export default commandModule({ - name: 'warn', - type: CommandType.Slash, - plugins: [publish(), ownerOnly()], - description: 'ADMIN: Avisa a usuarios.', - //alias : [], - options: [ - { - name: 'leve', - description: 'Aviso leve.', - type: ApplicationCommandOptionType.Subcommand, - options: [ - { - name: 'usuario', - description: 'el usuario al que avisar.', - type: ApplicationCommandOptionType.User, - required: true - }, - { - name: 'razon', - description: 'la razón aviso.', - type: ApplicationCommandOptionType.String, - required: true - } - ] - }, - { - name: 'grave', - description: 'Aviso grave.', - type: ApplicationCommandOptionType.Subcommand, - options: [ - { - name: 'usuario', - description: 'el usuario al que avisar.', - type: ApplicationCommandOptionType.User, - required: true - }, - { - name: 'razon', - description: 'la razón del aviso.', - type: ApplicationCommandOptionType.String, - required: true - } - ] - }, - { - name: 'clear', - description: 'Elimina los avisos de una persona.', - type: ApplicationCommandOptionType.Subcommand, - options: [ - { - name: 'usuario', - description: 'el usuario al que quitar el aviso.', - type: ApplicationCommandOptionType.User, - required: true - } - ] - } - ], - execute: async (ctx, options) => { - const subcommand = options[1].getSubcommand() - const user = (options[1].getMember('usuario') as GuildMember).id - const usermember = options[1].getMember('usuario') as GuildMember - const reason = options[1].getString('razon', true) as string - const times = await db.findOne({id: `${user}`}) as any - const buttons = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId('1hour') - .setLabel('1 hora') - .setStyle(ButtonStyle.Danger), - new ButtonBuilder() - .setCustomId('30mins') - .setLabel('30 minutos') - .setStyle(ButtonStyle.Danger), - new ButtonBuilder() - .setCustomId('15mins') - .setLabel('15 minutos') - .setStyle(ButtonStyle.Danger), - new ButtonBuilder() - .setCustomId('pardon') - .setLabel('Perdonar') - .setStyle(ButtonStyle.Primary) - ); - const dmEmbed = new EmbedBuilder() - .setAuthor({name: `${ctx.user.username}`, iconURL: `${ctx.user.displayAvatarURL()}`}) - .setColor('Red') - .setTitle('Tienes un aviso.') - .setDescription(`Has sido avisado en el servidor de Discord.\nRazón: ${reason}.`) - const dmEmbedTimeout = new EmbedBuilder() - .setAuthor({name: `${ctx.user.username}`, iconURL: `${ctx.user.displayAvatarURL()}`}) - .setColor('Red') - .setTitle('Acabas de ser muteado del servidor.') - .setDescription(`Ve al servidor de Discord para ver el tiempo que estarás bloqueado.\nRazón: ${reason}.\n**Puede durar hasta una hora.**`) - - switch (subcommand) { - case "leve": { - return db.exists({id: `${user}`}, async function (err, doc) { - if (err) { - console.log(err) - } else { - if (doc === null) { - const warn = new db({id: `${user}`, times: 1}) - warn.save() - ctx.reply({content: `Se ha avisado a ${usermember} correctamente y añadido a la base de datos.`, ephemeral: true}) - ctx.client.users.fetch(user).then((user) => { - user.send({embeds: [dmEmbed]}) - }).catch(() => console.log(`couldn't send a DM to user ID ${user}.`)); - } else { - if (times.times > 2) { - const msg = await ctx.reply({content: `El usuario ha excedido 3 avisos, ¿qué hacer?`, ephemeral: true, components: [buttons]}) - const collector = msg.createMessageComponentCollector({ time: 15000, max: 1, componentType: ComponentType.Button }); - collector.on('collect', async (i) => { - await i.deferReply({ephemeral: true}) - if (i.customId === '1hour') { - await i.editReply({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`}) - usermember.timeout(60 * 60 * 1000, reason) - times.times = 0 - times.save() - } else if (i.customId === '30mins') { - await i.editReply({content: `Se ha silenciado a ${usermember} durante 30 minutos correctamente. ;-;`}) - usermember.timeout(30 * 60 * 1000, reason) - times.times = 0 - times.save() - } else if (i.customId === '15mins') { - await i.editReply({content: `Se ha silenciado a ${usermember} durante 15 minutos correctamente. ;-;`}) - usermember.timeout(15 * 60 * 1000, reason) - times.times = 0 - times.save() - } else if (i.customId === 'pardon') { - await i.editReply({content: `Se ha perdonado a ${usermember} correctamente.\nSeguro que la persona te lo agradecerá! :'D`}) - times.times = 0 - times.save() - } - ctx.client.users.fetch(user).then((user) => { - user.send({embeds: [dmEmbedTimeout]}) - }).catch(() => console.log(`couldn't send a DM to user ID ${user}.`)); - }); - } else { - ctx.reply({content: `se ha añadido un aviso con el motivo ${reason}.\navisos que tiene ahora: ${times.times + 1}`, ephemeral: true}) - times.times = times.times + 1 - times.save() - ctx.client.users.fetch(user).then((user) => { - user.send({embeds: [dmEmbed]}); - }).catch(() => console.log(`couldn't send a DM to user ID ${user}.`)) - } - } - } - }); - } - case "grave": { - return db.exists({id: `${user}`}, async function (err, doc) { - if (err) { - console.log(err) - } else { - if (doc === null) { - const warn = new db({id: `${user}`, times: 2}) - warn.save() - ctx.reply({content: `Se ha avisado a ${usermember} correctamente y añadido a la base de datos.`, ephemeral: true}) - ctx.client.users.fetch(user).then((user) => { - user.send({embeds: [dmEmbed]}); - }).catch(() => console.log(`couldn't send a DM to user ID ${user}.`)) - } else { - if (times.times >= 4) { - const msg = await ctx.reply({content: `El usuario ha excedido 3 avisos, ¿qué hacer?`, ephemeral: true, components: [buttons]}) - const collector = msg.createMessageComponentCollector({ time: 1000, max: 1, componentType: ComponentType.Button }); - collector.on('collect', async (i: any) => { - if (i.customId === '1hour') { - await i.channel!.send({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`}) - usermember.timeout(60 * 60 * 1000, reason) - times.times = 0 - times.save() - } else if (i.customId === '30mins') { - await i.channel!.send({content: `Se ha silenciado a ${usermember} durante 30 minutos correctamente. ;-;`}) - usermember.timeout(30 * 60 * 1000, reason) - times.times = 0 - times.save() - } else if (i.customId === '15mins') { - await i.channel!.send({content: `Se ha silenciado a ${usermember} durante 15 minutos correctamente. ;-;`}) - usermember.timeout(15 * 60 * 1000, reason) - times.times = 0 - times.save() - } else if (i.customId === 'pardon') { - await i.channel!.send({content: `Se ha perdonado a ${usermember} correctamente.\nSeguro que la persona te lo agradecerá! :'D`}) - times.times = 0 - times.save() - } - ctx.client.users.fetch(user).then((user) => { - user.send({embeds: [dmEmbedTimeout]}) - }).catch(() => console.log(`couldn't send a DM to user ID ${user}.`)); - }); - } else { - ctx.reply({content: `se ha añadido un aviso con el motivo ${reason}.\navisos que tiene ahora: ${times.times + 2}`, ephemeral: true}) - times.times = times.times + 2 - times.save() - ctx.client.users.fetch(user).then((user) => { - user.send({embeds: [dmEmbed]}); - }).catch(() => console.log(`couldn't send a DM to user ID ${user}.`)) - } - } - } - }); - } - } - } -}) \ No newline at end of file diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index 555f2b5..0000000 --- a/deploy.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -git pull - -docker build . -t srizan10/vinci - -docker stop vinci - -docker rm vinci - -docker run -d -t --name vinci -p 7272:7272 --restart unless-stopped srizan10/vinci \ No newline at end of file diff --git a/package.json b/package.json index 4c01365..5e2f1c4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "dev": "tsc-watch -p \"./tsconfig.json\" --onSuccess \"node ./dist/index.js --dev\"", + "dev": "sern build && node ./dist/index.js --dev", "prod": "tsc-watch -p \"./tsconfig.json\" --onSuccess \"node ./dist/index.js\"", "compile": "tsc --build", "build": "tsc --build", @@ -34,23 +34,24 @@ "homepage": "https://github.com/SrIzan10/vinci#readme", "dependencies": { "@ai-zen/node-fetch-event-source": "^2.1.4", - "@consumet/extensions": "1.3.5", + "@consumet/extensions": "^1.7.0", "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.15.0", "@microsoft/fetch-event-source": "^2.0.1", "@napi-rs/canvas": "^0.1.52", - "@sern/handler": "^3.3.4", + "@sern/handler": "^4.0.2", + "@sern/publisher": "^1.1.2", "axios": "^1.6.8", "dayjs": "^1.11.6", "discord-tictactoe": "^4.0.0", - "discord.js": "^14.14.1", + "discord.js": "^14.16.2", "dotenv": "^16.0.1", "execa": "^6.1.0", "express": "^4.18.1", "extended-eventsource": "^1.4.6", "form-data": "^4.0.0", "genius-lyrics": "^4.4.3", - "googlethis": "^1.7.1", + "googlethis": "^1.8.0", "got": "^12.5.3", "libsodium-wrappers": "^0.7.10", "mongoose": "^6.11.3", @@ -68,7 +69,7 @@ "@types/node": "^20.12.7", "ts-node": "10.9.1", "tsc-watch": "^5.0.3", - "typescript": "^5.4.5" + "typescript": "^5.6.2" }, "packageManager": "yarn@4.1.1" } diff --git a/schemas/counting.js b/schemas/counting.js deleted file mode 100644 index caf2865..0000000 --- a/schemas/counting.js +++ /dev/null @@ -1,9 +0,0 @@ -const mongoose = require('mongoose'); - -const schema = new mongoose.Schema({ - number: {type: Number, required: true} -}) - -const db = new mongoose.Model('counting', schema) - -module.exports = db; \ No newline at end of file diff --git a/sern.config.json b/sern.config.json index 13e4bab..267655b 100644 --- a/sern.config.json +++ b/sern.config.json @@ -1,7 +1,7 @@ { "language": "typescript", "paths": { - "base": ".", + "base": "src", "commands": "commands" } } \ No newline at end of file diff --git a/commands/fun/8ball.ts b/src/commands/fun/8ball.ts similarity index 77% rename from commands/fun/8ball.ts rename to src/commands/fun/8ball.ts index ca558df..afd7f2e 100644 --- a/commands/fun/8ball.ts +++ b/src/commands/fun/8ball.ts @@ -1,16 +1,10 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; import { ApplicationCommandOptionType } from "discord.js"; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ export default commandModule({ name: '8ball', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Preguntale a la 8-ball cosas.', //alias : [], options: [{ @@ -19,8 +13,8 @@ export default commandModule({ type: ApplicationCommandOptionType.String, required: true }], - execute: async (ctx, options) => { - // yes, the question argument is never used. There is no reason to use it in the code. + execute: async (ctx) => { + // yes, the question argument is never used. There is no reason to use it. var eightballwords = [ 'Probablemente', 'Sí', diff --git a/commands/fun/a.ts b/src/commands/fun/a.ts similarity index 86% rename from commands/fun/a.ts rename to src/commands/fun/a.ts index ac5ae75..ddac564 100644 --- a/commands/fun/a.ts +++ b/src/commands/fun/a.ts @@ -2,10 +2,8 @@ import { commandModule, CommandType } from '@sern/handler'; import { ApplicationCommandOptionType, AttachmentBuilder, - AutocompleteInteraction, EmbedBuilder, } from 'discord.js'; -import { publish } from '#plugins'; const choices = [ 'XaviXE', 'Paula', @@ -28,9 +26,8 @@ const choices = [ export default commandModule({ name: 'a', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'A', - //alias : [], options: [ { name: 'usuario', @@ -39,7 +36,7 @@ export default commandModule({ autocomplete: true, command: { onEvent: [], - async execute(ctx: AutocompleteInteraction) { + async execute(ctx) { const focusedValue = ctx.options.getFocused(); const filtered = choices.filter((choice) => choice.startsWith(focusedValue) @@ -48,10 +45,10 @@ export default commandModule({ filtered.map((choice) => ({ name: choice, value: choice })) ); }, - }, + } }, ], - execute: async (ctx, options) => { + execute: async (ctx) => { const option = ctx.interaction.options.getString('usuario'); if (!option) { const imagesArray = [ @@ -77,9 +74,9 @@ export default commandModule({ await ctx.reply({ content: 'A', files: [images] }); } else { - if (choices.indexOf(options[1].getString('usuario', true)) > -1) { + if (choices.indexOf(option) > -1) { const attachmentbuilder = new AttachmentBuilder( - `./images/a/${options[1].getString('usuario', true)}.png` + `./images/a/${option}.png` ); await ctx.reply({ content: 'A', files: [attachmentbuilder] }); } else { diff --git a/commands/fun/animal.ts b/src/commands/fun/animal.ts similarity index 96% rename from commands/fun/animal.ts rename to src/commands/fun/animal.ts index 74c1aa2..fdc3c93 100644 --- a/commands/fun/animal.ts +++ b/src/commands/fun/animal.ts @@ -1,16 +1,11 @@ import { commandModule, CommandType } from '@sern/handler' import axios from "axios"; import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonStyle, ComponentType, EmbedBuilder } from "discord.js"; -import { publish } from "#plugins"; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ export default commandModule({ name: 'animal', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Enseña un animal', //alias : [], options: [ @@ -40,8 +35,8 @@ export default commandModule({ type: ApplicationCommandOptionType.Subcommand } ], - execute: async (ctx, options) => { - switch (options[1].getSubcommand()) { + execute: async (ctx) => { + switch (ctx.options.getSubcommand()) { case 'gato': { const request = await axios.get(`https://api.thecatapi.com/v1/images/search?api_key=${process.env.CATAPI}`).then(res => res.data) const embed = new EmbedBuilder() diff --git a/commands/fun/cursivify.ts b/src/commands/fun/cursivify.ts similarity index 75% rename from commands/fun/cursivify.ts rename to src/commands/fun/cursivify.ts index a062687..bafb7ee 100644 --- a/commands/fun/cursivify.ts +++ b/src/commands/fun/cursivify.ts @@ -1,14 +1,9 @@ import { commandModule, CommandType } from '@sern/handler'; -import { publish } from '#plugins'; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ export default commandModule({ name: 'cursivify', type: CommandType.CtxMsg, - plugins: [publish()], + plugins: [], execute: async (ctx) => { await ctx.deferReply() const trimmedstring = ctx.targetMessage.content.replaceAll('*', ''); diff --git a/commands/fun/gogoanime.ts b/src/commands/fun/gogoanime.ts similarity index 95% rename from commands/fun/gogoanime.ts rename to src/commands/fun/gogoanime.ts index 0a6a4be..9eaca55 100644 --- a/commands/fun/gogoanime.ts +++ b/src/commands/fun/gogoanime.ts @@ -10,13 +10,13 @@ import { EmbedBuilder, } from 'discord.js'; /* -import { publish } from "#plugins"; + import { ownerOnly } from "#plugins" */ export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'busca cosas en gogoanime', //alias : [], options: [ @@ -91,10 +91,10 @@ export default commandModule({ execute: async (ctx, options) => { const gogoanime = new ANIME.Gogoanime(); const doubleslashregex = new RegExp('(? `[${server.name}](<${server.url!.replace(doubleslashregex, '/')}>)`)) @@ -143,7 +143,7 @@ export default commandModule({ } break; case 'info': { try { - const option = options[1].getString('id', true) + const option = ctx.options.getString('id', true) const info = await gogoanime.fetchAnimeInfo(option) const embed = new EmbedBuilder() .setColor('Random') diff --git a/commands/fun/joke.ts b/src/commands/fun/joke.ts similarity index 84% rename from commands/fun/joke.ts rename to src/commands/fun/joke.ts index 43713b2..1bba874 100644 --- a/commands/fun/joke.ts +++ b/src/commands/fun/joke.ts @@ -1,13 +1,13 @@ import { commandModule, CommandType } from '@sern/handler' import axios from "axios"; -import { publish } from "#plugins"; + export default commandModule({ name: 'chiste', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Enseña un chiste en inglés.', - execute: async (ctx, args) => { + execute: async (ctx) => { const jokeJSON = await axios( 'https://v2.jokeapi.dev/joke/Programming,Miscellaneous,Spooky,Christmas?blacklistFlags=nsfw,religious,racist,sexist,explicit' ).then((res) => res.data); diff --git a/commands/fun/makesweet.ts b/src/commands/fun/makesweet.ts similarity index 93% rename from commands/fun/makesweet.ts rename to src/commands/fun/makesweet.ts index bc7bfb9..678f240 100644 --- a/commands/fun/makesweet.ts +++ b/src/commands/fun/makesweet.ts @@ -11,13 +11,13 @@ import { import axios from 'axios'; import https from 'node:https' /* -import { publish } from "#plugins"; + import { ownerOnly } from "#plugins" */ export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], //alias : [], description: 'no one will read this (i hope)', options: [ @@ -40,15 +40,15 @@ export default commandModule({ ], }, ], - execute: async (ctx, options) => { + execute: async (ctx) => { await ctx.interaction.deferReply(); - switch (options[1].getSubcommand()) { + switch (ctx.options.getSubcommand()) { case 'heartlocket': { try { // get all options - const text = options[1].getString('texto'); - const image = options[1].getAttachment('imagen', true); + const text = ctx.options.getString('texto', true); + const image = ctx.options.getAttachment('imagen', true); // check file extension of attachment if ( @@ -110,6 +110,7 @@ export default commandModule({ Authorization: process.env.MAKESWEET!, }, responseType: 'arraybuffer', + httpsAgent: new https.Agent({ rejectUnauthorized: false }) } ) .then((res) => res.data); @@ -120,6 +121,7 @@ export default commandModule({ Authorization: process.env.MAKESWEET!, }, responseType: 'arraybuffer', + httpsAgent: new https.Agent({ rejectUnauthorized: false }) }) .then((res) => res.data); } diff --git a/commands/fun/megamind.ts b/src/commands/fun/megamind.ts similarity index 89% rename from commands/fun/megamind.ts rename to src/commands/fun/megamind.ts index 0948efb..6783cbe 100644 --- a/commands/fun/megamind.ts +++ b/src/commands/fun/megamind.ts @@ -1,16 +1,16 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; + import { ownerOnly } from "#plugins"; import Canvas from '@napi-rs/canvas'; import { ApplicationCommandOptionType, AttachmentBuilder } from 'discord.js'; /* -import { publish } from "#plugins"; + import { ownerOnly } from "#plugins" */ export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], // , '928018226330337280' description: 'Añade a una imagen de megamind "No ...?"', //alias : [], @@ -22,8 +22,8 @@ export default commandModule({ required: true } ], - execute: async (ctx, options) => { - const option = options[1].getString('texto', true) + execute: async (ctx) => { + const option = ctx.options.getString('texto', true) await ctx.reply({content: 'Cargando...'}) diff --git a/commands/fun/rps.ts b/src/commands/fun/rps.ts similarity index 96% rename from commands/fun/rps.ts rename to src/commands/fun/rps.ts index bd8810d..9ece06d 100644 --- a/commands/fun/rps.ts +++ b/src/commands/fun/rps.ts @@ -1,12 +1,12 @@ import { commandModule, CommandType } from '@sern/handler' import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonStyle, ComponentType, EmbedBuilder, GuildMember } from "discord.js"; -import { publish } from "#plugins"; + import rockpaperscissors from "rockpaperscissors-checker"; export default commandModule({ name: 'rps', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Juega piedra papel tijeras con los panas', //alias : [], options: [ @@ -17,10 +17,10 @@ export default commandModule({ required: true } ], - execute: async (ctx, options) => { + execute: async (ctx) => { // also the code is mine, I didn't steal from anyone - let player1, player2, winner, bothResponded - const option = options[1].getMember('usuario') as GuildMember + let player1: number, player2: number, winner, bothResponded: boolean + const option = ctx.options.getMember('usuario') as unknown as GuildMember if (ctx.user.id === option.id) { return await ctx.reply({content: `no puedes jugar contigo mismo 💀`, ephemeral: true}) } else if (option.user.bot) { diff --git a/commands/fun/tictactoe.ts b/src/commands/fun/tictactoe.ts similarity index 73% rename from commands/fun/tictactoe.ts rename to src/commands/fun/tictactoe.ts index 02cdf36..a225cbd 100644 --- a/commands/fun/tictactoe.ts +++ b/src/commands/fun/tictactoe.ts @@ -1,14 +1,13 @@ import TicTacToe from 'discord-tictactoe'; import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; -import { ApplicationCommandOptionType, ChatInputCommandInteraction, CommandInteraction, Interaction } from "discord.js"; + +import { ApplicationCommandOptionType } from "discord.js"; const game = new TicTacToe({language: 'en'}) export default commandModule({ name: 'tictactoe', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'tres en raya', //alias : [], options: [ diff --git a/commands/handlers/bonzify.ts b/src/commands/handlers/bonzify.ts similarity index 78% rename from commands/handlers/bonzify.ts rename to src/commands/handlers/bonzify.ts index bdb8f3c..e5887ba 100644 --- a/commands/handlers/bonzify.ts +++ b/src/commands/handlers/bonzify.ts @@ -8,7 +8,7 @@ import { execa } from 'execa'; export default commandModule({ type: CommandType.CtxMsg, - plugins: [publish()], + plugins: [], execute: async (ctx) => { await ctx.deferReply({ fetchReply: true }) @@ -22,11 +22,11 @@ export default commandModule({ const randomnumber = random(5) const randomnumber_wav = `bonzi-wav-${randomnumber}.wav` const randomnumber_mp3 = `bonzi-mp3-${randomnumber}.mp3` - fs.writeFileSync(`./util/bonzi_temp/${randomnumber_wav}`, new Uint8Array(request)) + fs.writeFileSync(`./src/util/bonzi_temp/${randomnumber_wav}`, new Uint8Array(request)) const command = execa('ffmpeg', [ - '-i', `./util/bonzi_temp/${randomnumber_wav}`, + '-i', `./src/util/bonzi_temp/${randomnumber_wav}`, '-vn', - `./util/bonzi_temp/${randomnumber_mp3}` + `./src/util/bonzi_temp/${randomnumber_mp3}` ], { shell: true }) await new Promise((resolve) => { command.on('close', resolve) @@ -34,12 +34,12 @@ export default commandModule({ const stream = new Readable(); stream._read = () => {}; - stream.push(Buffer.from(new Uint8Array(fs.readFileSync(`./util/bonzi_temp/${randomnumber_mp3}`)))); + stream.push(Buffer.from(new Uint8Array(fs.readFileSync(`./src/util/bonzi_temp/${randomnumber_mp3}`)))); stream.push(null) const attachment = new AttachmentBuilder(stream, { name: 'bonzied.mp3' }) - fs.unlinkSync(`./util/bonzi_temp/${randomnumber_mp3}`) - fs.unlinkSync(`./util/bonzi_temp/${randomnumber_wav}`) + fs.unlinkSync(`./src/util/bonzi_temp/${randomnumber_mp3}`) + fs.unlinkSync(`./src/util/bonzi_temp/${randomnumber_wav}`) await ctx.editReply({ files: [attachment] }) }, diff --git a/commands/handlers/mcform-dm.ts b/src/commands/handlers/mcform-dm.ts similarity index 100% rename from commands/handlers/mcform-dm.ts rename to src/commands/handlers/mcform-dm.ts diff --git a/commands/handlers/mcform.ts b/src/commands/handlers/mcform.ts similarity index 87% rename from commands/handlers/mcform.ts rename to src/commands/handlers/mcform.ts index c10164b..dc0111f 100644 --- a/commands/handlers/mcform.ts +++ b/src/commands/handlers/mcform.ts @@ -5,7 +5,6 @@ import { ButtonBuilder, ButtonStyle, EmbedBuilder, - TextChannel, } from 'discord.js'; export default commandModule({ @@ -53,11 +52,14 @@ export default commandModule({ .setLabel('Añadido a la whitelist!') .setStyle(ButtonStyle.Success) ); - ( - (await ( - await modal.client.guilds.fetch(process.env.GUILDID!) - ).channels.fetch(process.env.MCFORM_CHANNEL!)) as TextChannel - ).send({ embeds: [embed], components: [button] }); + const guild = await modal.client.guilds.fetch(process.env.GUILDID!); + const channel = await guild.channels.fetch(process.env.MCFORM_CHANNEL!); + if (channel && channel.isTextBased()) { + await channel.send({ + embeds: [embed], + components: [button], + }); + } } catch { await modal.reply({ content: diff --git a/commands/handlers/role-menu.ts b/src/commands/handlers/role-menu.ts similarity index 94% rename from commands/handlers/role-menu.ts rename to src/commands/handlers/role-menu.ts index cc5b7e2..1a17e2c 100644 --- a/commands/handlers/role-menu.ts +++ b/src/commands/handlers/role-menu.ts @@ -15,7 +15,7 @@ export default commandModule({ // @ts-ignore ).options.map((o: { label: string; value: string }) => o.value); - const member = interaction.member as GuildMember; + const member = interaction.member! as unknown as GuildMember; if (!member) return; let content = `Los roles han sido actualizados. Te he dado estos:\n${roles diff --git a/commands/handlers/sugerencias.ts b/src/commands/handlers/sugerencias.ts similarity index 81% rename from commands/handlers/sugerencias.ts rename to src/commands/handlers/sugerencias.ts index ef08ecf..0f012b1 100644 --- a/commands/handlers/sugerencias.ts +++ b/src/commands/handlers/sugerencias.ts @@ -1,7 +1,6 @@ import { commandModule, CommandType } from '@sern/handler'; import { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from 'discord.js'; import { - TextChannel, ThreadAutoArchiveDuration, } from 'discord.js'; @@ -52,10 +51,17 @@ export default commandModule({ .setStyle(ButtonStyle.Secondary), ) - const message1 = await (await modal.client.guilds.fetch(process.env.GUILDID!)) - .channels.fetch(process.env.SUGGESTIONS_CHANNEL!) as TextChannel; - const message2 = await message1.send({ embeds: [embed], components: [row, row2] }); - message2.startThread({ + const guild = await modal.client.guilds.fetch(process.env.GUILDID!); + const channel = await guild.channels.fetch(process.env.SUGGESTIONS_CHANNEL!); + if (!channel || !channel.isTextBased()) { + return await modal.reply({ + content: 'ERROR: Canal de sugerencias no encontrado.', + ephemeral: true, + }); + } + + const msg = await channel.send({ embeds: [embed], components: [row, row2] }); + msg.startThread({ name: `Sugerencia de ${modal.user.username}`, autoArchiveDuration: ThreadAutoArchiveDuration.ThreeDays, reason: 'AUTOMATIZADO: Hilo para discutir sobre la sugerencia.', diff --git a/commands/handlers/suggestions-no-who.ts b/src/commands/handlers/suggestions-no-who.ts similarity index 100% rename from commands/handlers/suggestions-no-who.ts rename to src/commands/handlers/suggestions-no-who.ts diff --git a/commands/handlers/suggestions-no.ts b/src/commands/handlers/suggestions-no.ts similarity index 92% rename from commands/handlers/suggestions-no.ts rename to src/commands/handlers/suggestions-no.ts index 675c1e7..2edfe5b 100644 --- a/commands/handlers/suggestions-no.ts +++ b/src/commands/handlers/suggestions-no.ts @@ -1,11 +1,11 @@ import { commandModule, CommandType } from "@sern/handler"; -import { ActionRowBuilder, ButtonBuilder, ButtonComponentData, ButtonInteraction, ButtonStyle, ComponentType } from "discord.js"; +import { ActionRowBuilder, ButtonBuilder, ButtonComponent, ButtonComponentData, ButtonStyle } from "discord.js"; import db from "../../schemas/suggestions.js"; export default commandModule({ type: CommandType.Button, async execute(interaction) { - const convertToNumber = Number(interaction.component.label!) + const convertToNumber = Number((interaction.component as ButtonComponent).label!) const row2 = new ActionRowBuilder().setComponents( new ButtonBuilder(interaction.message!.components[1].components[0].data as ButtonComponentData), new ButtonBuilder(interaction.message!.components[1].components[1].data as ButtonComponentData) diff --git a/commands/handlers/suggestions-yes-who.ts b/src/commands/handlers/suggestions-yes-who.ts similarity index 89% rename from commands/handlers/suggestions-yes-who.ts rename to src/commands/handlers/suggestions-yes-who.ts index 1b0e94d..60eeed0 100644 --- a/commands/handlers/suggestions-yes-who.ts +++ b/src/commands/handlers/suggestions-yes-who.ts @@ -1,5 +1,4 @@ import { commandModule, CommandType } from "@sern/handler"; -import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, ComponentType } from "discord.js"; import db from "../../schemas/suggestions.js"; export default commandModule({ diff --git a/commands/handlers/suggestions-yes.ts b/src/commands/handlers/suggestions-yes.ts similarity index 92% rename from commands/handlers/suggestions-yes.ts rename to src/commands/handlers/suggestions-yes.ts index 0679f15..e37cdbb 100644 --- a/commands/handlers/suggestions-yes.ts +++ b/src/commands/handlers/suggestions-yes.ts @@ -1,11 +1,11 @@ import { commandModule, CommandType } from "@sern/handler"; -import { ActionRowBuilder, ButtonBuilder, ButtonComponentData, ButtonInteraction, ButtonStyle, ComponentType } from "discord.js"; +import { ActionRowBuilder, ButtonBuilder, ButtonComponent, ButtonComponentData, ButtonStyle } from "discord.js"; import db from "../../schemas/suggestions.js"; export default commandModule({ type: CommandType.Button, async execute(interaction) { - const convertToNumber = Number(interaction.component.label!) + const convertToNumber = Number((interaction.component as ButtonComponent).label!) const row2 = new ActionRowBuilder().setComponents( new ButtonBuilder(interaction.message!.components[1].components[0].data as ButtonComponentData), new ButtonBuilder(interaction.message!.components[1].components[1].data as ButtonComponentData) diff --git a/commands/minecraft/ip.ts b/src/commands/minecraft/ip.ts similarity index 78% rename from commands/minecraft/ip.ts rename to src/commands/minecraft/ip.ts index 4c00f84..ca31e75 100644 --- a/commands/minecraft/ip.ts +++ b/src/commands/minecraft/ip.ts @@ -1,16 +1,10 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; import { ApplicationCommandOptionType } from "discord.js"; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ export default commandModule({ name: 'ip', type: CommandType.Slash, - plugins: [publish()], + plugins: [], // description: 'La IP del servidor de Minecraft', options: [ @@ -22,7 +16,7 @@ export default commandModule({ ], //alias : [], execute: async (ctx, options) => { - const usuario = options[1].getMember('usuario'); + const usuario = ctx.options.getMember('usuario'); if (!usuario) { await ctx.reply({content: "La IP del servidor de Minecraft es `minecraft.maraturing.com`,\nPide acceso con el comando .", ephemeral: true}) diff --git a/commands/minecraft/mcform.ts b/src/commands/minecraft/mcform.ts similarity index 89% rename from commands/minecraft/mcform.ts rename to src/commands/minecraft/mcform.ts index 54ab155..6946e51 100644 --- a/commands/minecraft/mcform.ts +++ b/src/commands/minecraft/mcform.ts @@ -6,13 +6,11 @@ import { TextInputStyle, ModalActionRowComponentBuilder, } from 'discord.js'; -import { publish } from '#plugins'; -import { ownerOnly } from '#plugins'; export default commandModule({ name: 'mcform', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Envia el formulario para entrar al servidor.', //alias : [], execute: async (ctx) => { diff --git a/commands/misc/afk.ts b/src/commands/misc/afk.ts similarity index 86% rename from commands/misc/afk.ts rename to src/commands/misc/afk.ts index c134229..a43f312 100644 --- a/commands/misc/afk.ts +++ b/src/commands/misc/afk.ts @@ -1,16 +1,10 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" import db from '../../schemas/afk.js'; import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'afk command', //alias : [], options: [ @@ -38,11 +32,11 @@ export default commandModule({ type: ApplicationCommandOptionType.Subcommand } ], - execute: async (ctx, options) => { - switch (options[1].getSubcommand()) { + execute: async (ctx) => { + switch (ctx.options.getSubcommand()) { case 'añadir': { if (await db.exists({ id: ctx.user.id })) return ctx.reply({ content: 'Ya existes en la base de datos!', ephemeral: true }) - const reason = options[1].getString('motivo', true); + const reason = ctx.options.getString('motivo'); await (new db({ id: ctx.user.id, reason: reason })).save() const embed = new EmbedBuilder() diff --git a/commands/misc/askjavi_disabled.ts b/src/commands/misc/askjavi_disabled.ts similarity index 95% rename from commands/misc/askjavi_disabled.ts rename to src/commands/misc/askjavi_disabled.ts index fecc79e..c2188b0 100644 --- a/commands/misc/askjavi_disabled.ts +++ b/src/commands/misc/askjavi_disabled.ts @@ -11,16 +11,15 @@ import { ModalSubmitInteraction, ApplicationCommandOptionType, } from 'discord.js'; -import { publish } from '#plugins'; -import { ownerOnly } from '#plugins'; import padyama from '../../schemas/padyama.js'; import { random } from '../../util/randomstring.js'; +import { disable } from '#plugins'; export default commandModule({ name: 'askjavi', type: CommandType.Slash, plugins: [ - // publish(), + disable() ], description: 'TEMP: Pregunta a Javi LO QUE SEA!', //alias : [], @@ -63,7 +62,7 @@ export default commandModule({ ], }, ], - execute: async (ctx, options) => { + execute: async (ctx) => { switch (ctx.interaction.options.getSubcommand()) { case 'new': { const modal = new ModalBuilder() @@ -110,7 +109,7 @@ export default commandModule({ time: 180000, filter: (i) => i.user.id === ctx.user.id, }) - .catch((error) => {})) as ModalSubmitInteraction; + .catch((error) => {})) as unknown as ModalSubmitInteraction; const db = new padyama({ id: i.user.id, user: i.user.username, @@ -132,7 +131,7 @@ export default commandModule({ }); } case 'get': { - const option = options[1].getString('id'); + const option = ctx.options.getString('id'); const db = await padyama.findOne({ suggestionid: option }); if (db?.suggestion !== undefined) return await ctx.reply({ @@ -160,7 +159,7 @@ export default commandModule({ content: `No puedes usar este comando.`, ephemeral: true, }); - const option = options[1].getString('id'); + const option = ctx.options.getString('id'); const db = await padyama.findOne({ suggestionid: option }); if (db?.user !== undefined) { try { diff --git a/commands/misc/credits.ts b/src/commands/misc/credits.ts similarity index 93% rename from commands/misc/credits.ts rename to src/commands/misc/credits.ts index cc25167..60ef959 100644 --- a/commands/misc/credits.ts +++ b/src/commands/misc/credits.ts @@ -1,16 +1,14 @@ import { commandModule, CommandType } from '@sern/handler' -import { Context, SlashOptions } from "@sern/handler"; import { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js"; -import { publish } from "#plugins"; export default commandModule({ name: 'creditos', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Créditos del bot (en inglés)', //alias : [], options: [], - execute: async (ctx, options) => { + execute: async (ctx) => { const baseEmbed = new EmbedBuilder() .setColor('Blurple') .setTitle(`Without these people, the bot wouldn't exist!`) diff --git a/commands/misc/cumple.ts b/src/commands/misc/cumple.ts similarity index 90% rename from commands/misc/cumple.ts rename to src/commands/misc/cumple.ts index 42e4c8f..0e330b2 100644 --- a/commands/misc/cumple.ts +++ b/src/commands/misc/cumple.ts @@ -1,18 +1,13 @@ import { commandModule, CommandType } from "@sern/handler"; -import { publish } from "#plugins"; import { ApplicationCommandOptionType } from "discord.js"; import { readFileSync } from "node:fs"; import birthdays from "../../schemas/birthdays.js"; import { acceptingBirthday } from "#plugins"; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ export default commandModule({ name: "cumple", type: CommandType.Slash, - plugins: [publish(), acceptingBirthday()], + plugins: [acceptingBirthday()], description: "Pon tu cumpleaños en la base de datos para ser felicitado!", //alias : [], options: [ @@ -43,7 +38,7 @@ export default commandModule({ }, }, ], - execute: async (ctx, options) => { + execute: async (ctx) => { const option = ctx.interaction.options.getString("fecha") const array = JSON.parse( String(readFileSync("./util/daysinyear.txt")) diff --git a/commands/misc/faq.ts b/src/commands/misc/faq.ts similarity index 82% rename from commands/misc/faq.ts rename to src/commands/misc/faq.ts index 46af507..53d3920 100644 --- a/commands/misc/faq.ts +++ b/src/commands/misc/faq.ts @@ -1,12 +1,10 @@ import { commandModule, CommandType } from '@sern/handler' import { ApplicationCommandOptionType, ColorResolvable, EmbedBuilder } from 'discord.js'; -import { publish } from "#plugins"; -import fs from 'node:fs'; -import mctags from '../../util/tags/minecraft.json' assert { type: 'json' } +import mctags from '../../../assets/mcTags.json' with { type: "json" }; export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Preguntas normalmente preguntadas :pepega:', //alias : [], options: [ @@ -40,11 +38,11 @@ export default commandModule({ ] } ], - execute: async (ctx, options) => { - switch (options[1].getSubcommand()) { + execute: async (ctx) => { + switch (ctx.options.getSubcommand()) { case 'minecraft': { - const option = options[1].getString('pregunta', true) - const forusr = options[1].getMember('para') + const option = ctx.options.getString('pregunta', true) + const forusr = ctx.options.getMember('para') const filter = mctags.filter(obj => obj.title.includes(option))[0] const embed = new EmbedBuilder() diff --git a/commands/misc/google.ts b/src/commands/misc/google.ts similarity index 76% rename from commands/misc/google.ts rename to src/commands/misc/google.ts index 3a4a836..79072e7 100644 --- a/commands/misc/google.ts +++ b/src/commands/misc/google.ts @@ -1,15 +1,10 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; import google from 'googlethis' import { ApplicationCommandOptionType } from 'discord.js'; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Busca cosas en Google.', //alias : [], options: [ @@ -20,9 +15,9 @@ export default commandModule({ required: true, } ], - execute: async (ctx, options) => { + execute: async (ctx) => { await ctx.interaction.deferReply() - const prompt = options[1].getString('busqueda', true) + const prompt = ctx.options.getString('busqueda', true) const search = await Promise.all((await google.search(prompt)).results.map(res => { return `[${res.title}](<${res.url}>)` diff --git a/commands/misc/imageClassification.ts b/src/commands/misc/imageClassification.ts similarity index 85% rename from commands/misc/imageClassification.ts rename to src/commands/misc/imageClassification.ts index 7814263..fb329eb 100644 --- a/commands/misc/imageClassification.ts +++ b/src/commands/misc/imageClassification.ts @@ -7,13 +7,13 @@ import sharp from 'sharp'; export default commandModule({ name: 'Clasifica una imagen', type: CommandType.CtxMsg, - plugins: [publish()], + plugins: [], execute: async (ctx) => { await ctx.deferReply() if (ctx.targetMessage.attachments.size === 0) return ctx.editReply('No hay ninguna imagen para clasificar!'); - const image = ctx.targetMessage.attachments.first(); - if (!image.contentType.startsWith('image/') && image.contentType !== 'image/gif') return ctx.editReply('El archivo no es una imagen!'); + const image = ctx.targetMessage.attachments.first()!; + if (!image.contentType!.startsWith('image/') && image.contentType !== 'image/gif') return ctx.editReply('El archivo no es una imagen!'); const imageBuffer = await fetch(image.url).then(async res => await res.arrayBuffer()); const compressed = sharp(imageBuffer) @@ -34,10 +34,10 @@ export default commandModule({ if (request.errors.length > 0) return ctx.editReply(`Hubo un error! ${codeBlock(JSON.stringify(request.errors))}`); // all canvas stuff, this was fun to make - const canvas = createCanvas(metadata.width, metadata.height); + const canvas = createCanvas(metadata.width!, metadata.height!); const ctxCanvas = canvas.getContext('2d'); const img = await loadImage(image.url); - ctxCanvas.drawImage(img, 0, 0, metadata.width, metadata.height); + ctxCanvas.drawImage(img, 0, 0, metadata.width!, metadata.height!); ctxCanvas.font = '40px sans-serif'; ctxCanvas.fillStyle = 'red'; ctxCanvas.strokeStyle = 'red'; diff --git a/commands/misc/infinitecraft.ts b/src/commands/misc/infinitecraft.ts similarity index 89% rename from commands/misc/infinitecraft.ts rename to src/commands/misc/infinitecraft.ts index 8127f30..ba2f98a 100644 --- a/commands/misc/infinitecraft.ts +++ b/src/commands/misc/infinitecraft.ts @@ -1,15 +1,14 @@ import { commandModule, CommandType } from '@sern/handler'; import { ApplicationCommandOptionType, bold, codeBlock, EmbedBuilder, inlineCode } from 'discord.js'; -import { publish } from '../../plugins/publish.js'; import fs from 'node:fs/promises' import { ICFile } from '../../util/infinitecraft/decompress.js'; import Finder from '../../util/infinitecraft/finder.js'; -const recipeFile = JSON.parse(await fs.readFile('./util/infinitecraft/recipes.json', 'utf-8')) as ICFile; +const recipeFile = JSON.parse(await fs.readFile('./assets/icRecipes.json', 'utf-8')) as ICFile; export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Descifra con un algoritmo cómo llegar a la receta de un objeto en InfiniteCraft', options: [ { @@ -36,14 +35,14 @@ export default commandModule({ } } ], - execute: async (ctx, [, options]) => { + execute: async (ctx) => { await ctx.interaction.deferReply() - const object = options.getString('objeto', true) + const object = ctx.options.getString('objeto', true) if (object === 'SSError') return ctx.reply({ content: 'Has escogido el mensaje de error 💀', ephemeral: true }); - if (!recipeFile.items.includes(options.getString('objeto', true))) return ctx.reply({ + if (!recipeFile.items.includes(ctx.options.getString('objeto', true))) return ctx.reply({ content: 'No se encontró el objeto. Asegúrate de escogerlo del autocompletado.', ephemeral: true }); @@ -78,8 +77,9 @@ export default commandModule({ }); const recipe = path.map(({ first, second, result }) => `${first} + ${second} = ${result}`).join('\n') + let paste: string | undefined; if (recipe.length >= 1500) { - var paste = await fetch('https://fb.srizan.dev/paste', { + paste = await fetch('https://fb.srizan.dev/paste', { method: 'POST', body: recipe }).then(async res => await res.text()) diff --git a/commands/misc/letra.ts b/src/commands/misc/letra.ts similarity index 91% rename from commands/misc/letra.ts rename to src/commands/misc/letra.ts index 31d55be..214ae1c 100644 --- a/commands/misc/letra.ts +++ b/src/commands/misc/letra.ts @@ -1,5 +1,4 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; import Genius from 'genius-lyrics' import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonStyle, EmbedBuilder } from 'discord.js'; @@ -7,7 +6,7 @@ const genius = new Genius.Client(process.env.GENIUS) export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Busca la letra de una canción (Genius)', //alias : [], options: [ @@ -34,9 +33,9 @@ export default commandModule({ } } ], - execute: async (ctx, options) => { + execute: async (ctx) => { await ctx.interaction.deferReply({ ephemeral: true }) - const prompt = options[1].getString('busqueda', true) + const prompt = ctx.options.getString('busqueda', true) const result = await genius.songs.get(Number(prompt)) diff --git a/commands/misc/radio.ts b/src/commands/misc/radio.ts similarity index 77% rename from commands/misc/radio.ts rename to src/commands/misc/radio.ts index 6c8654d..352afde 100644 --- a/commands/misc/radio.ts +++ b/src/commands/misc/radio.ts @@ -1,17 +1,13 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; import { createAudioPlayer, createAudioResource, DiscordGatewayAdapterCreator, joinVoiceChannel } from "@discordjs/voice"; import got from "got"; import { ApplicationCommandOptionType, EmbedBuilder } from "discord.js"; -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ +const choices = ['Rock FM', 'Cadena 100', 'Cadena Dial', 'Gensokyo Radio', 'BBC 1', 'RNE 1', 'RNE 5', 'Los 40']; export default commandModule({ name: 'radio', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Reproduce la radio', options: [ { @@ -24,7 +20,6 @@ export default commandModule({ onEvent: [], async execute(ctx){ const focusedValue = ctx.options.getFocused(); - const choices = ['Rock FM', 'Cadena 100', 'Cadena Dial', 'Gensokyo Radio', 'BBC 1', 'RNE 1', 'RNE 5', 'Los 40', 'Flaixbac', 'FlaixFM']; const filtered = choices.filter(choice => choice.startsWith(focusedValue)); await ctx.respond( filtered.map(choice => ({ name: choice, value: choice })), @@ -33,8 +28,9 @@ export default commandModule({ } } ], - execute: async (ctx, options) => { - const radioname = options[1].getString("reproducir", true) + execute: async (ctx) => { + const radioname = ctx.options.getString("reproducir", true) + if (!choices.includes(radioname)) return await ctx.reply('Asegúrate de escoger una radio de la lista.') const embed = new EmbedBuilder() .setColor("Green") .setTitle(`Reproduciendo ${radioname} en Vinci Radio.`) @@ -44,18 +40,14 @@ export default commandModule({ .setTitle(`Radio ${radioname} no encontrada.`) .setDescription(`La radio no ha sido encontrada, asegúrate que la radio está escogida de la lista.`); - async function playRadio(radioname: string, isFlaix?: boolean) { + async function playRadio(radioname: string) { const stream = got.stream(radioname) const connection = joinVoiceChannel({adapterCreator: ctx.interaction.guild!.voiceAdapterCreator as DiscordGatewayAdapterCreator, channelId: '1008730592835281009',guildId: '928018226330337280',selfDeaf: true}); const resource = createAudioResource(stream, { inlineVolume: true }); const player = createAudioPlayer(); connection.subscribe(player) player.play(resource) - if (isFlaix === true) { - resource.volume!.setVolume(0.3) - } else { - resource.volume!.setVolume(0.7) - } + resource.volume!.setVolume(0.7) await ctx.reply({embeds: [embed], ephemeral: true}) } @@ -84,12 +76,6 @@ export default commandModule({ case 'Gensokyo Radio': { playRadio('https://stream.gensokyoradio.net/3') } break; - case 'Flaixbac': { - playRadio('https://nodo07-cloud01.streaming-pro.com:8005/flaixbac.mp3', true) - } break; - case 'FlaixFM': { - playRadio('https://nodo07-cloud01.streaming-pro.com:8001/flaixfm.mp3', true) - } break; default: { await ctx.reply({embeds: [notFoundEmbed], ephemeral: true}) } break; diff --git a/commands/misc/roleMenu.ts b/src/commands/misc/roleMenu.ts similarity index 73% rename from commands/misc/roleMenu.ts rename to src/commands/misc/roleMenu.ts index a745aac..13d9e58 100644 --- a/commands/misc/roleMenu.ts +++ b/src/commands/misc/roleMenu.ts @@ -1,13 +1,13 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; + import { ownerOnly } from "#plugins"; -import { ActionRowBuilder, ApplicationCommandOptionType, ChannelType, Collection, EmbedBuilder, Role, SelectMenuBuilder, TextChannel } from "discord.js"; +import { ActionRowBuilder, ApplicationCommandOptionType, ChannelType, ChatInputCommandInteraction, Collection, EmbedBuilder, Role, StringSelectMenuBuilder, TextChannel } from "discord.js"; import { Resolver } from "../../util/resolver.js"; export default commandModule({ name: 'rolemenu', type: CommandType.Slash, - plugins: [publish(), ownerOnly()], + plugins: [ownerOnly()], description: 'ADMIN: Spawnea un menú de roles', //alias : [], options: [ @@ -31,11 +31,13 @@ export default commandModule({ required: true, }, ], - execute: async (ctx, options) => { - const channel = options[1].getChannel("channel", true) as TextChannel; - const role = new Resolver(options[1].getString("role", true), ctx.interaction) + execute: async (ctx) => { + const channel = ctx.options.getChannel("channel", true) as unknown as TextChannel; + if (!channel.isSendable()) return ctx.reply("Channel is not sendable"); + // @ts-ignore it should still be a correct interaction + const role = new Resolver(ctx.options.getString("role", true), ctx.interaction) .roles; - const message = options[1].getString("message", true); + const message = ctx.options.getString("message", true); if (role.size > 25) return ctx.reply("Too many roles"); @@ -50,6 +52,7 @@ export default commandModule({ ); } await ctx.interaction.deferReply(); + // @ts-ignore it should still be a textchannel const row = createMenu(channel, role); const embed = new EmbedBuilder() .setTitle(message) @@ -67,7 +70,7 @@ export default commandModule({ function createMenu(channel: TextChannel, role: Collection) { if (!channel || !role) throw new Error("Missing channel or role"); - const menu = new SelectMenuBuilder() + const menu = new StringSelectMenuBuilder() .setCustomId("role-menu") .setMaxValues(role.size) .setMinValues(0) @@ -80,6 +83,6 @@ function createMenu(channel: TextChannel, role: Collection) { }; }) ); - const row = new ActionRowBuilder().setComponents(menu); + const row = new ActionRowBuilder().setComponents(menu); return row; }; \ No newline at end of file diff --git a/commands/misc/shorten.ts b/src/commands/misc/shorten.ts similarity index 84% rename from commands/misc/shorten.ts rename to src/commands/misc/shorten.ts index 5137a97..105346f 100644 --- a/commands/misc/shorten.ts +++ b/src/commands/misc/shorten.ts @@ -1,13 +1,13 @@ import { commandModule, CommandType } from "@sern/handler"; -import axios, { AxiosError, AxiosResponse } from "axios"; +import axios, { AxiosResponse } from "axios"; import { ApplicationCommandOptionType } from "discord.js"; -import { publish } from "#plugins"; +import { disable } from "#plugins"; export default commandModule({ name: "acortar", type: CommandType.Slash, plugins: [ - publish(), + disable() ], description: "Acorta una URL a vinci.tk", options: [ @@ -20,7 +20,7 @@ export default commandModule({ ], //alias : [], execute: async (ctx, options) => { - const url = options[1].getString("url", true); + const url = ctx.options.getString("url", true); const request = await axios( `https://vinci.tk/yourls-api.php?signature=${process.env.YOURLS_KEY}&action=shorturl&format=json&url=${url}`, { diff --git a/commands/misc/stats.ts b/src/commands/misc/stats.ts similarity index 95% rename from commands/misc/stats.ts rename to src/commands/misc/stats.ts index 5bdb7ad..16888cb 100644 --- a/commands/misc/stats.ts +++ b/src/commands/misc/stats.ts @@ -1,14 +1,14 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; +import { disable } from "#plugins"; import { EmbedBuilder } from "discord.js"; import axios from "axios"; +// @ts-ignore import prettySeconds from 'pretty-seconds-spanish' export default commandModule({ name: 'stats', type: CommandType.Slash, - plugins: [publish()], + plugins: [disable()], description: 'Enseña estadísticas del bot.', //alias : [], options: [], diff --git a/commands/misc/sugerencias.ts b/src/commands/misc/sugerencias.ts similarity index 91% rename from commands/misc/sugerencias.ts rename to src/commands/misc/sugerencias.ts index e241fb9..929ed54 100644 --- a/commands/misc/sugerencias.ts +++ b/src/commands/misc/sugerencias.ts @@ -1,13 +1,11 @@ import { commandModule, CommandType } from '@sern/handler' import { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ModalActionRowComponentBuilder } from 'discord.js' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; export default commandModule({ name: 'sugerencias', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Envia una sugerencia.', //alias : [], execute: async (ctx) => { diff --git a/commands/misc/traducir.ts b/src/commands/misc/traducir.ts similarity index 87% rename from commands/misc/traducir.ts rename to src/commands/misc/traducir.ts index a197e0e..7456949 100644 --- a/commands/misc/traducir.ts +++ b/src/commands/misc/traducir.ts @@ -1,18 +1,12 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; + import axios from 'axios'; -import { readFileSync } from 'node:fs' import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonStyle, ComponentType, EmbedBuilder } from 'discord.js'; const choices = ['es', 'en', 'fr', 'de', 'hi', 'it', 'ja', 'ko', 'pl'] -/* -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins" -*/ export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], // , '928018226330337280' description: 'Traduce lo que quieras!', //alias : [], @@ -44,9 +38,9 @@ export default commandModule({ } } ], - execute: async (ctx, options) => { - const langToTranslate = options[1].getString('idioma', true) - const stringToTranslate = options[1].getString('frase', true) + execute: async (ctx) => { + const langToTranslate = ctx.options.getString('idioma', true) + const stringToTranslate = ctx.options.getString('frase', true) if (choices.indexOf(langToTranslate) === -1) return ctx.reply({content: 'Elige un idioma del autocompletado.'}) diff --git a/commands/misc/uptime.ts b/src/commands/misc/uptime.ts similarity index 82% rename from commands/misc/uptime.ts rename to src/commands/misc/uptime.ts index 74de11f..101d916 100644 --- a/commands/misc/uptime.ts +++ b/src/commands/misc/uptime.ts @@ -1,15 +1,15 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; +// @ts-ignore import prettySeconds from 'pretty-seconds-spanish' export default commandModule({ name: 'uptime', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Enseña el tiempo que ha estado encendido el bot.', //alias : [], options: [], - execute: async (ctx, options) => { + execute: async (ctx) => { // const uptime = prettyMilliseconds(ctx.client.uptime!) const uptime = prettySeconds(process.uptime()) await ctx.reply(`El bot lleva encendido ${uptime}`); diff --git a/commands/misc/wikipedia.ts b/src/commands/misc/wikipedia.ts similarity index 67% rename from commands/misc/wikipedia.ts rename to src/commands/misc/wikipedia.ts index 386c1a0..fa4aaca 100644 --- a/commands/misc/wikipedia.ts +++ b/src/commands/misc/wikipedia.ts @@ -1,11 +1,10 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; -import { ApplicationCommandOptionType } from 'discord.js'; -import { getWikipedia, searchWikipedia, SearchWikipediaObject } from '../../util/wikipedia.js'; +import { ApplicationCommandOptionType, AutocompleteInteraction, CacheType, CommandInteractionOptionResolver } from 'discord.js'; +import { getWikipedia, searchWikipedia } from '../../util/wikipedia.js'; export default commandModule({ type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'Busca cosas por wikipedia', //alias : [], options: [ @@ -23,7 +22,7 @@ export default commandModule({ command: { onEvent: [], execute: async (ctx) => { - const search = await searchWikipedia('es', ctx) + const search = await searchWikipedia('es', ctx as unknown as AutocompleteInteraction) await ctx.respond( search.map(res => ({ name: res.title.toString(), value: res.pageid.toString() })) ) @@ -46,7 +45,7 @@ export default commandModule({ command: { onEvent: [], execute: async (ctx) => { - const search = await searchWikipedia('en', ctx) + const search = await searchWikipedia('en', ctx as unknown as AutocompleteInteraction) await ctx.respond( search.map(res => ({ name: res.title.toString(), value: res.pageid.toString() })) ) @@ -56,13 +55,14 @@ export default commandModule({ ] } ], - execute: async (ctx, [, options]) => { - switch (options.getSubcommand()) { + execute: async (ctx) => { + const options = ctx.options as unknown as CommandInteractionOptionResolver + switch (ctx.options.getSubcommand()) { case 'español': { - getWikipedia('es', ctx, options) + getWikipedia('es', ctx, options); } break; case 'ingles': { - getWikipedia('en', ctx, options) + getWikipedia('en', ctx, options); } break; } }, diff --git a/commands/moderation/prune.ts b/src/commands/moderation/prune.ts similarity index 76% rename from commands/moderation/prune.ts rename to src/commands/moderation/prune.ts index 47f55c1..7bcc123 100644 --- a/commands/moderation/prune.ts +++ b/src/commands/moderation/prune.ts @@ -1,12 +1,12 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; + import { ownerOnly } from "#plugins";; import { ApplicationCommandOptionType, TextChannel } from 'discord.js' export default commandModule({ name: 'prune', type: CommandType.Slash, - plugins: [publish(), ownerOnly()], + plugins: [ownerOnly()], description: 'ADMIN: Elimina hasta 100 mensajes', options: [{ name: 'numero', @@ -17,14 +17,14 @@ export default commandModule({ max_value: 100 }], //alias : [], - execute: async (ctx, options) => { + execute: async (ctx) => { try { - const amount = options[1].getNumber('numero', true) as number - (ctx.channel as TextChannel).bulkDelete(amount).catch(err => { + const amount = ctx.options.getNumber('numero', true) as number + (ctx.channel as unknown as TextChannel).bulkDelete(amount).catch(err => { console.error(err); ctx.reply({content: 'Ha habido un error eliminando mensajes! (mira la consola, Sr Izan)', ephemeral: true});}); await ctx.reply({content: `Se han eliminado ${amount} mensajes.`}) - const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel + const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as unknown as TextChannel await sendToMods.send({content: `Se han eliminado ${amount} mensajes en ${ctx.channel}\nEfectuado por ${ctx.user}.`}) } catch { ctx.reply({content: 'Ha habido un error eliminando mensajes! Error reportado automáticamente.', ephemeral: true})}; diff --git a/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts similarity index 74% rename from commands/moderation/slowmode.ts rename to src/commands/moderation/slowmode.ts index 571e189..2753ee2 100644 --- a/commands/moderation/slowmode.ts +++ b/src/commands/moderation/slowmode.ts @@ -1,12 +1,12 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; + import { ownerOnly } from "#plugins"; import { ApplicationCommandOptionType, TextChannel } from "discord.js"; export default commandModule({ name: 'slowmode', type: CommandType.Slash, - plugins: [publish(), ownerOnly()], + plugins: [ownerOnly()], description: 'ADMIN: Pon modo lento a canales de texto', options: [ { @@ -23,15 +23,15 @@ export default commandModule({ } ], //alias : [], - execute: async (ctx, options) => { + execute: async (ctx) => { try { - const seconds = options[1].getNumber("segundos", true); - const reason = options[1].getString("razon", true); + const seconds = ctx.options.getNumber("segundos", true); + const reason = ctx.options.getString("razon", true); - (ctx.channel as TextChannel).setRateLimitPerUser(seconds, reason) + (ctx.channel as unknown as TextChannel).setRateLimitPerUser(seconds, reason) ctx.reply({content: `Se han añadido ${seconds} segundos de modo lento al canal de voz actual`}) - const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel + const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as unknown as TextChannel await sendToMods.send({content: `Se ha aplicado modo lento al canal ${ctx.channel}.\nEfectuado por ${ctx.user} con ${seconds} segundos de retardo.\nRazón: ${reason}`}) } catch { ctx.reply({content: `No se ha podido aplicar modo lento al canal.`}) diff --git a/commands/ping.ts b/src/commands/ping.ts similarity index 84% rename from commands/ping.ts rename to src/commands/ping.ts index 3c37800..2baf70b 100644 --- a/commands/ping.ts +++ b/src/commands/ping.ts @@ -1,11 +1,11 @@ import { commandModule, CommandType } from '@sern/handler' -import { publish } from "#plugins"; + import { ownerOnly } from "#plugins" export default commandModule({ name: 'ping', type: CommandType.Slash, - plugins: [publish()], + plugins: [], description: 'A ping command', //alias : [], options: [], diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 0000000..5576967 --- /dev/null +++ b/src/config.ts @@ -0,0 +1,12 @@ +//CONFIG FILE: export only data here and do not cause side effects. Feel free to add your own configuration to this file. + +//commands directory. REQUIRED +export const commands = './dist/commands' +// events directory. +export const events = './dist/events' + +// schedule tasks and declare them here +//export const tasks = './dist/tasks' + +// defaultPrefix: if omitted, sern will disable all text/prefix commands +//export const defaultPrefix = '?' \ No newline at end of file diff --git a/src/dependencies.d.ts b/src/dependencies.d.ts new file mode 100644 index 0000000..1594db6 --- /dev/null +++ b/src/dependencies.d.ts @@ -0,0 +1,24 @@ +/* + * This file serves as intellisense for sern projects. + * Types are declared here for dependencies to function properly + * Service(s) api rely on this file to provide a better developer experience. +*/ + +import type { CoreDependencies } from '@sern/handler'; +import type { Client } from 'discord.js'; +import type { Publisher } from '@sern/publisher'; +import type Spotify from 'spotify-api.js'; +/** + * Note: You usually would not need to modify this unless there is an urgent need to break the contracts provided. + * You would need to modify this to add your custom Services, however. + */ +declare global { + interface Dependencies extends CoreDependencies { + '@sern/client': Client; + 'publisher': Publisher; + 'spotify-api-client': Spotify.Client; + } +} + + +export {} diff --git a/events/afknotify.ts b/src/events/afknotify.ts similarity index 86% rename from events/afknotify.ts rename to src/events/afknotify.ts index 83fb51e..0e7fed4 100644 --- a/events/afknotify.ts +++ b/src/events/afknotify.ts @@ -1,11 +1,10 @@ -import { EventType, eventModule } from '@sern/handler'; +import { EventType, discordEvent, eventModule } from '@sern/handler'; import { EmbedBuilder, Message } from 'discord.js'; import db from '../schemas/afk.js'; -export default eventModule({ - type: EventType.Discord, +export default discordEvent({ name: 'messageCreate', - execute: async (message: Message) => { + execute: async (message) => { const dbEntries = await db.find() dbEntries.forEach(async (doc) => { diff --git a/events/anti-nsfw.old b/src/events/anti-nsfw.old similarity index 100% rename from events/anti-nsfw.old rename to src/events/anti-nsfw.old diff --git a/events/chatgptMessage.ts b/src/events/chatgptMessage.ts similarity index 97% rename from events/chatgptMessage.ts rename to src/events/chatgptMessage.ts index 5f8551b..c511a42 100644 --- a/events/chatgptMessage.ts +++ b/src/events/chatgptMessage.ts @@ -1,8 +1,6 @@ import { discordEvent } from '@sern/handler'; -import { TextChannel } from 'discord.js'; import db from '../schemas/chatgpt.js'; import { fetchEventSource } from '@ai-zen/node-fetch-event-source'; -import { devMode } from '../index.js'; export default discordEvent({ name: 'messageCreate', diff --git a/events/chatgptThread.ts b/src/events/chatgptThread.ts similarity index 94% rename from events/chatgptThread.ts rename to src/events/chatgptThread.ts index 3229da6..70e6f7d 100644 --- a/events/chatgptThread.ts +++ b/src/events/chatgptThread.ts @@ -1,12 +1,13 @@ import { discordEvent } from '@sern/handler'; -import { ThreadChannel } from 'discord.js'; +import { PublicThreadChannel } from 'discord.js'; import database from '../schemas/chatgpt.js'; import { fetchEventSource } from '@ai-zen/node-fetch-event-source'; export default discordEvent({ name: 'messageCreate', async execute(message) { - const thread = message.channel as ThreadChannel + // @ts-ignore idk man + const thread = message.channel as PublicThreadChannel; if (thread.parentId !== process.env.CHATGPT_CHANNEL) return; if (message.author.bot) return; if (message.content.includes('v!ig')) return; diff --git a/events/clean-spotify-link.ts b/src/events/clean-spotify-link.ts similarity index 85% rename from events/clean-spotify-link.ts rename to src/events/clean-spotify-link.ts index 0790ff1..d1da39c 100644 --- a/events/clean-spotify-link.ts +++ b/src/events/clean-spotify-link.ts @@ -9,7 +9,7 @@ export default discordEvent({ if (!message.content.includes('https://open.spotify.com/intl-es/track')) return; const index = message.content.indexOf("https://open.spotify.com/intl-es/track"); - let link: string + let link: string = '' if (index !== -1) { let endIndex = message.content.indexOf(" ", index); if (endIndex === -1) { @@ -19,11 +19,11 @@ export default discordEvent({ } const croppedUrl = removeURLParameter(link.replace('intl-es/', '').replaceAll(/([^:]\/)\/+/g, "$1"), 'si'); - const song = await spotify.tracks.get(croppedUrl.split('/').pop()); + const song = await spotify.tracks.get(croppedUrl.split('/').pop()!); await message.delete(); message.channel.send({ - content: `Oye <@${message.author.id}>, tu canción \`${song.name}\` de \`${song.artists.map(a => a.name).join(', ')}\` es muy buena, pero si quitas \`intl-es\` es mejor.\n${croppedUrl}`, + content: `Oye <@${message.author.id}>, tu canción \`${song!.name}\` de \`${song!.artists.map(a => a.name).join(', ')}\` es muy buena, pero si quitas \`intl-es\` es mejor.\n${croppedUrl}`, }) } }) \ No newline at end of file diff --git a/events/error.ts b/src/events/error.ts similarity index 97% rename from events/error.ts rename to src/events/error.ts index 971cc83..9883841 100644 --- a/events/error.ts +++ b/src/events/error.ts @@ -6,4 +6,4 @@ export default eventModule({ execute(err) { console.log(err); } - }) \ No newline at end of file +}) \ No newline at end of file diff --git a/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts similarity index 72% rename from events/guildMemberAdd.ts rename to src/events/guildMemberAdd.ts index 0283ad8..2578116 100644 --- a/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -1,20 +1,19 @@ import { EmbedBuilder, GuildMember, TextChannel } from "discord.js"; -import { EventType, eventModule } from "@sern/handler"; +import { EventType, discordEvent, eventModule } from "@sern/handler"; -export default eventModule({ - type: EventType.Discord, +export default discordEvent({ name: 'guildMemberAdd', - execute(member: GuildMember) { + execute(member) { if (member.guild.id !== process.env.GUILDID) return; - const newMemberEmbed = new EmbedBuilder() + const newMemberEmbed = new EmbedBuilder() .setColor("Random") .setTitle("Nuevo miembro!") .setDescription(`${member.user} acaba de entrar al servidor!`) .setThumbnail(member.user.displayAvatarURL()) .setTimestamp(); - const channel = member.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.JOINSANDLEAVES_CHANNEL!) as TextChannel + const channel = member.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.JOINSANDLEAVES_CHANNEL!) as unknown as TextChannel channel.send({embeds: [newMemberEmbed]}) } }); \ No newline at end of file diff --git a/events/guildMemberRemove.ts b/src/events/guildMemberRemove.ts similarity index 73% rename from events/guildMemberRemove.ts rename to src/events/guildMemberRemove.ts index 589107e..6d8e3ed 100644 --- a/events/guildMemberRemove.ts +++ b/src/events/guildMemberRemove.ts @@ -1,20 +1,19 @@ import { EmbedBuilder, GuildMember, TextChannel } from "discord.js"; -import { EventType, eventModule } from "@sern/handler"; +import { EventType, discordEvent, eventModule } from "@sern/handler"; -export default eventModule({ - type: EventType.Discord, +export default discordEvent({ name: 'guildMemberRemove', - execute(member: GuildMember) { + execute(member) { if (member.guild.id !== process.env.GUILDID) return; - const leaveEmbed = new EmbedBuilder() + const leaveEmbed = new EmbedBuilder() .setColor("Random") .setTitle("Un miembro se ha ido :(") .setDescription(`${member.user} acaba de salir del servidor!`) .setThumbnail(member.user.displayAvatarURL()) .setTimestamp(); - const channel = member.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.JOINSANDLEAVES_CHANNEL!) as TextChannel + const channel = member.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.JOINSANDLEAVES_CHANNEL!) as unknown as TextChannel channel.send({embeds: [leaveEmbed]}) } }); \ No newline at end of file diff --git a/events/scam-links.old b/src/events/scam-links.old similarity index 100% rename from events/scam-links.old rename to src/events/scam-links.old diff --git a/events/t.ts b/src/events/t.ts similarity index 100% rename from events/t.ts rename to src/events/t.ts diff --git a/index.ts b/src/index.ts similarity index 78% rename from index.ts rename to src/index.ts index e64f24a..416a600 100644 --- a/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import { DefaultLogging, makeDependencies, single, Singleton } from '@sern/handler'; +import { makeDependencies } from '@sern/handler'; import { ActivityOptions, ActivityType } from 'discord.js'; import { Client, GatewayIntentBits } from 'discord.js'; import { Sern } from '@sern/handler'; @@ -9,7 +9,8 @@ import { setIntervalAsync } from 'set-interval-async'; import birthdays from './util/birthdays.js'; import minecraftstatus from './util/minecraftstatus.js'; import Spotify from 'spotify-api.js'; -// import giveawaychecker from './util/giveawaychecker.js'; +import { Publisher } from '@sern/publisher'; +import * as sernconfig from './config.js' export let devMode: boolean if (process.argv[2] === '--dev') { @@ -40,22 +41,17 @@ const spotifyClient = await Spotify.Client.create({ token: { clientID: process.env.SPOTIFY_CLIENT!, clientSecret: process.env.SPOTIFY_SECRET! }, }) -interface MyDependencies extends Dependencies { - '@sern/client' : Singleton; - '@sern/logger' : Singleton -} - -await makeDependencies({ - build: (root) => root - .add({ '@sern/client': single(() => client) }) - .add({ 'spotify-api-client': single(() => spotifyClient) }) +await makeDependencies(({ add }) => { + add('@sern/client', client); + add('publisher', deps => new Publisher( + deps['@sern/modules'], + deps['@sern/emitter'], + deps['@sern/logger']! + )); + add('spotify-api-client', spotifyClient); }); -Sern.init({ - commands: 'dist/commands', - events: 'dist/events', - defaultPrefix: process.env.PREFIX, -}); +Sern.init(sernconfig); client.on('ready', async () => { console.log('Logged on!'); @@ -71,7 +67,7 @@ client.on('ready', async () => { { name: 'ahora v1.0!', type: ActivityType.Playing }, ] as ActivityOptions[]; const randomStatus = statuses[Math.floor(Math.random() * statuses.length)]; - client.user.setActivity(randomStatus); + client.user!.setActivity(randomStatus); }, 10000); if (!devMode) { @@ -93,4 +89,4 @@ client.on('ready', async () => { // export const scamLinks = await axios.get('https://api.hyperphish.com/gimme-domains').then(res => res.data as Array) -client.login(process.env.TOKEN); +client.login(); diff --git a/plugins/acceptingBirthday.ts b/src/plugins/acceptingBirthday.ts similarity index 100% rename from plugins/acceptingBirthday.ts rename to src/plugins/acceptingBirthday.ts diff --git a/src/plugins/disable.ts b/src/plugins/disable.ts new file mode 100644 index 0000000..4267426 --- /dev/null +++ b/src/plugins/disable.ts @@ -0,0 +1,80 @@ +//@ts-nocheck +/** + * @plugin + * Disables a command entirely, for whatever reasons you may need. + * + * @author @jacoobes [<@182326315813306368>] + * @author @Peter-MJ-Parker [<@371759410009341952>] + * @version 2.1.0 + * @example + * ```ts + * import { disable } from "../plugins/disable"; + * import { commandModule } from "@sern/handler"; + * export default commandModule({ + * plugins: [ disable() ], + * execute: (ctx) => { + * //your code here + * } + * }) + * ``` + * @end + */ +import { CommandType, CommandControlPlugin, controller } from "@sern/handler"; +import { InteractionReplyOptions, MessageReplyOptions } from "discord.js"; + +export function disable( + onFail?: + | string + | Omit + | MessageReplyOptions +) { + return CommandControlPlugin(async (ctx, [args]) => { + if (onFail !== undefined) { + switch (args) { + case "text": + try { + //reply to text command + const msg = await ctx.reply(onFail); + setTimeout(() => { + //deletes the bots reply to the user + msg.delete(); + //deletes the original authors message (text command). + ctx.message.delete(); + //waits 5 seconds before deleting messages + }, 5000); + } catch (error) { + console.log( + "Could not delete disabled response due to: " + + error + ); + } + + break; + + case "slash": + //response to say the command is disabled with users response. + let reply = await ctx.reply(onFail); + try { + setTimeout(async () => { + await reply.delete(); + }, 5000); + } catch (error) { + console.log( + "Could not delete disabled response due to it being ephemeral." + ); + } + break; + + default: + break; + } + } + //this function tells the bot to reply to an interaction so it doesn't seem like it fails (in case there is no onFail message). + if (onFail === undefined && args === "slash") { + onFail = "This command is disabled."; + await ctx.reply({ content: onFail, ephemeral: true }); + } + //stop the command from running + return controller.stop(); + }); +} diff --git a/plugins/index.ts b/src/plugins/index.ts similarity index 81% rename from plugins/index.ts rename to src/plugins/index.ts index 7ecf887..6fe58df 100644 --- a/plugins/index.ts +++ b/src/plugins/index.ts @@ -2,3 +2,4 @@ export * from './publish.js' export * from './ownerOnly.js' export * from './srIzanOnly.js' export * from './acceptingBirthday.js' +export * from './disable.js' diff --git a/plugins/ownerOnly.ts b/src/plugins/ownerOnly.ts similarity index 100% rename from plugins/ownerOnly.ts rename to src/plugins/ownerOnly.ts diff --git a/plugins/publish.ts b/src/plugins/publish.ts similarity index 100% rename from plugins/publish.ts rename to src/plugins/publish.ts diff --git a/plugins/srIzanOnly.ts b/src/plugins/srIzanOnly.ts similarity index 100% rename from plugins/srIzanOnly.ts rename to src/plugins/srIzanOnly.ts diff --git a/schemas/afk.js b/src/schemas/afk.ts similarity index 100% rename from schemas/afk.js rename to src/schemas/afk.ts diff --git a/schemas/birthdays.js b/src/schemas/birthdays.ts similarity index 100% rename from schemas/birthdays.js rename to src/schemas/birthdays.ts diff --git a/schemas/chatgpt.js b/src/schemas/chatgpt.ts similarity index 100% rename from schemas/chatgpt.js rename to src/schemas/chatgpt.ts diff --git a/schemas/padyama.js b/src/schemas/padyama.ts similarity index 100% rename from schemas/padyama.js rename to src/schemas/padyama.ts diff --git a/schemas/suggestions.js b/src/schemas/suggestions.ts similarity index 100% rename from schemas/suggestions.js rename to src/schemas/suggestions.ts diff --git a/schemas/twitter.js b/src/schemas/twitter.ts similarity index 100% rename from schemas/twitter.js rename to src/schemas/twitter.ts diff --git a/schemas/warn.js b/src/schemas/warn.ts similarity index 100% rename from schemas/warn.js rename to src/schemas/warn.ts diff --git a/schemas/youtube.js b/src/schemas/youtube.ts similarity index 100% rename from schemas/youtube.js rename to src/schemas/youtube.ts diff --git a/util/birthdays.ts b/src/util/birthdays.ts similarity index 100% rename from util/birthdays.ts rename to src/util/birthdays.ts diff --git a/util/bonzi_temp/.gitkeep b/src/util/bonzi_temp/.gitkeep similarity index 100% rename from util/bonzi_temp/.gitkeep rename to src/util/bonzi_temp/.gitkeep diff --git a/util/daysinyear.txt b/src/util/daysinyear.txt similarity index 100% rename from util/daysinyear.txt rename to src/util/daysinyear.txt diff --git a/util/infinitecraft/decompress.ts b/src/util/infinitecraft/decompress.ts similarity index 100% rename from util/infinitecraft/decompress.ts rename to src/util/infinitecraft/decompress.ts diff --git a/util/infinitecraft/finder.ts b/src/util/infinitecraft/finder.ts similarity index 98% rename from util/infinitecraft/finder.ts rename to src/util/infinitecraft/finder.ts index 90c6d6f..0d829b1 100644 --- a/util/infinitecraft/finder.ts +++ b/src/util/infinitecraft/finder.ts @@ -31,7 +31,7 @@ export default class Finder { ) {} private async loadRecipes() { - const file = JSON.parse(await fs.readFile("./util/infinitecraft/recipes.json", "utf-8")) as ICFile + const file = JSON.parse(await fs.readFile("./assets/icRecipes.json", "utf-8")) as ICFile this.recipes = await decompressRecipes(file); this.items = new Set(file.items); for (const recipe of this.recipes) { diff --git a/util/minecraftstatus.ts b/src/util/minecraftstatus.ts similarity index 100% rename from util/minecraftstatus.ts rename to src/util/minecraftstatus.ts diff --git a/util/nowplayingradio.disabled b/src/util/nowplayingradio.disabled similarity index 100% rename from util/nowplayingradio.disabled rename to src/util/nowplayingradio.disabled diff --git a/util/randomstring.ts b/src/util/randomstring.ts similarity index 100% rename from util/randomstring.ts rename to src/util/randomstring.ts diff --git a/util/removeUrlParameter.ts b/src/util/removeUrlParameter.ts similarity index 100% rename from util/removeUrlParameter.ts rename to src/util/removeUrlParameter.ts diff --git a/util/resolver.ts b/src/util/resolver.ts similarity index 94% rename from util/resolver.ts rename to src/util/resolver.ts index 404a638..0383f84 100644 --- a/util/resolver.ts +++ b/src/util/resolver.ts @@ -1,12 +1,11 @@ import { Collection, - CommandInteraction, GuildBasedChannel, GuildMember, Role, User, } from 'discord.js'; -import type { Snowflake } from 'discord.js'; +import type { ChatInputCommandInteraction, Snowflake } from 'discord.js'; /** * It resolves mentions from the content of a command @@ -19,7 +18,7 @@ import type { Snowflake } from 'discord.js'; export class Resolver { public constructor( private readonly content: string, - private readonly interaction: CommandInteraction + private readonly interaction: ChatInputCommandInteraction ) {} readonly #regex = { diff --git a/util/web/stats.js b/src/util/web/stats.old similarity index 100% rename from util/web/stats.js rename to src/util/web/stats.old diff --git a/util/web/webserver.old b/src/util/web/webserver.old similarity index 100% rename from util/web/webserver.old rename to src/util/web/webserver.old diff --git a/util/wikipedia.ts b/src/util/wikipedia.ts similarity index 91% rename from util/wikipedia.ts rename to src/util/wikipedia.ts index 9e37848..63fde00 100644 --- a/util/wikipedia.ts +++ b/src/util/wikipedia.ts @@ -1,6 +1,6 @@ -import { ActionRow, ActionRowBuilder, AutocompleteInteraction, ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js"; +import { ActionRow, ActionRowBuilder, AutocompleteInteraction, ButtonBuilder, ButtonStyle, CacheType, CommandInteractionOptionResolver, CommandInteractionResolvedData, EmbedBuilder } from "discord.js"; import axios from "axios"; -import { Context, SlashOptions } from "@sern/handler"; +import { Context } from "@sern/handler"; /** Search Wikipedia for a given input string in the specified language using the Wikipedia API. @@ -10,8 +10,7 @@ import { Context, SlashOptions } from "@sern/handler"; @param {AutocompleteInteraction} autocomplete - The autocomplete interaction object containing the input to search for. @returns {Promise} - A promise that resolves with an array of search results. **/ - -export async function searchWikipedia(lang: string, autocomplete: AutocompleteInteraction) { +export async function searchWikipedia(lang: string, autocomplete: AutocompleteInteraction) { const input = autocomplete.options.getFocused() if (!input) { return [{ ns: 0, title: 'Empieza a escribir para buscar!', pageid: 0, size: 0, wordcount: 0, snippet: 0, timestamp: 0 }] as unknown as SearchWikipediaObject[] @@ -20,7 +19,7 @@ export async function searchWikipedia(lang: string, autocomplete: AutocompleteIn return request.data.query.search as SearchWikipediaObject[] } -export async function getWikipedia(lang: string, ctx: Context, options: SlashOptions) { +export async function getWikipedia(lang: string, ctx: Context, options: CommandInteractionOptionResolver) { const pageid = options.getString((lang === 'es') ? 'busqueda' : 'search', true) if (Number.isNaN(Number(pageid))) return ctx.reply({ content: 'Elige en el autocompletado el artículo.', ephemeral: true }) const request = await axios.get(`https://${lang}.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&pageids=${pageid}&format=json`) diff --git a/util/youtubenotifications.ts b/src/util/youtubenotifications.ts similarity index 100% rename from util/youtubenotifications.ts rename to src/util/youtubenotifications.ts diff --git a/tsconfig.json b/tsconfig.json index 2f3e709..dd8b7ef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,106 +1,11 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": ["ES2022"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "ESNext", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "dist", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": false, /* Enable all strict type-checking options. */ - "noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - "useUnknownInCatchVariables": false, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true, /* Skip type checking all .d.ts files. */ + "module": "NodeNext", + "moduleResolution": "NodeNext", + "resolveJsonModule": true, "paths": { - "#plugins": ["./plugins/index.js"], + "#plugins": ["./src/plugins/index.js"], } - } + }, + "extends": "./.sern/tsconfig.json" } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 411c733..e8849b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -567,16 +567,16 @@ __metadata: languageName: node linkType: hard -"@consumet/extensions@npm:1.3.5": - version: 1.3.5 - resolution: "@consumet/extensions@npm:1.3.5" +"@consumet/extensions@npm:^1.7.0": + version: 1.7.0 + resolution: "@consumet/extensions@npm:1.7.0" dependencies: ascii-url-encoder: "npm:^1.2.0" axios: "npm:^0.27.2" - cheerio: "npm:^1.0.0-rc.11" + cheerio: "npm:^1.0.0-rc.12" crypto-js: "npm:^4.1.1" form-data: "npm:^4.0.0" - checksum: 10c0/c9b0a6a6ce74c64102a6f6c893aa740ec805102ebc831f27dd3dd342588c070ed61ba9d3b9a66e1058e4456f9b90b5e329f79ea1dca36e02d1700813d6721c2d + checksum: 10c0/ccd1ab6e4e4afa37ce6f36fd1322930282fcbb47df0ff53572edd4b4939b596ba1de8a660802c43d6049caafee4aac51bc295418329ac008f0e2b2c4f310f20b languageName: node linkType: hard @@ -604,6 +604,21 @@ __metadata: languageName: node linkType: hard +"@discordjs/builders@npm:^1.9.0": + version: 1.9.0 + resolution: "@discordjs/builders@npm:1.9.0" + dependencies: + "@discordjs/formatters": "npm:^0.5.0" + "@discordjs/util": "npm:^1.1.1" + "@sapphire/shapeshift": "npm:^4.0.0" + discord-api-types: "npm:0.37.97" + fast-deep-equal: "npm:^3.1.3" + ts-mixer: "npm:^6.0.4" + tslib: "npm:^2.6.3" + checksum: 10c0/3287b87624c11112faeac0acc0063427dd85f4174ca7b2c3bbd0f77feab99e97193e5d6e6fb5989000eb50aff67d2831af3fc6cdf2907a05ac23a475f5b65ab6 + languageName: node + linkType: hard + "@discordjs/collection@npm:1.5.3": version: 1.5.3 resolution: "@discordjs/collection@npm:1.5.3" @@ -618,6 +633,13 @@ __metadata: languageName: node linkType: hard +"@discordjs/collection@npm:^2.1.0, @discordjs/collection@npm:^2.1.1": + version: 2.1.1 + resolution: "@discordjs/collection@npm:2.1.1" + checksum: 10c0/7bbb007271a046c981957b4a0543f6ca7e4c294a2d40987437ff06db5e92dbf35b8dc61719db2a7bc99557a58275742aa34be9f50487870a6e80acfc4fe45fa1 + languageName: node + linkType: hard + "@discordjs/formatters@npm:^0.3.3": version: 0.3.3 resolution: "@discordjs/formatters@npm:0.3.3" @@ -627,6 +649,15 @@ __metadata: languageName: node linkType: hard +"@discordjs/formatters@npm:^0.5.0": + version: 0.5.0 + resolution: "@discordjs/formatters@npm:0.5.0" + dependencies: + discord-api-types: "npm:0.37.97" + checksum: 10c0/784e7a7cb82874eb3d5741c8058088accdc6151151d5dbafa634efdb184e0f5666a95e57ac8f6e514b2819b07f764dbb1d4258c0dbba37fc5645f800182ae1d9 + languageName: node + linkType: hard + "@discordjs/node-pre-gyp@npm:^0.4.5": version: 0.4.5 resolution: "@discordjs/node-pre-gyp@npm:0.4.5" @@ -673,6 +704,23 @@ __metadata: languageName: node linkType: hard +"@discordjs/rest@npm:^2.3.0, @discordjs/rest@npm:^2.4.0": + version: 2.4.0 + resolution: "@discordjs/rest@npm:2.4.0" + dependencies: + "@discordjs/collection": "npm:^2.1.1" + "@discordjs/util": "npm:^1.1.1" + "@sapphire/async-queue": "npm:^1.5.3" + "@sapphire/snowflake": "npm:^3.5.3" + "@vladfrangu/async_event_emitter": "npm:^2.4.6" + discord-api-types: "npm:0.37.97" + magic-bytes.js: "npm:^1.10.0" + tslib: "npm:^2.6.3" + undici: "npm:6.19.8" + checksum: 10c0/2de35ff6c0ad734685e329fc29df52823faf6e9eb68045b780f5b657555c699da7e9e0ffdf2ab1ee7ef902d7a8901993b6ea6e0f3c85938570a2b74e15207c0a + languageName: node + linkType: hard + "@discordjs/util@npm:^1.0.2": version: 1.0.2 resolution: "@discordjs/util@npm:1.0.2" @@ -680,6 +728,13 @@ __metadata: languageName: node linkType: hard +"@discordjs/util@npm:^1.1.0, @discordjs/util@npm:^1.1.1": + version: 1.1.1 + resolution: "@discordjs/util@npm:1.1.1" + checksum: 10c0/a374648aae0dd98345996f41891add0523388297a6f6b99c7a37c83de4d832d91a464195502126967fac0f071e5ecb80f776ee42a887fffa9c5c0f4612381b98 + languageName: node + linkType: hard + "@discordjs/voice@npm:^0.15.0": version: 0.15.0 resolution: "@discordjs/voice@npm:0.15.0" @@ -693,6 +748,23 @@ __metadata: languageName: node linkType: hard +"@discordjs/ws@npm:1.1.1": + version: 1.1.1 + resolution: "@discordjs/ws@npm:1.1.1" + dependencies: + "@discordjs/collection": "npm:^2.1.0" + "@discordjs/rest": "npm:^2.3.0" + "@discordjs/util": "npm:^1.1.0" + "@sapphire/async-queue": "npm:^1.5.2" + "@types/ws": "npm:^8.5.10" + "@vladfrangu/async_event_emitter": "npm:^2.2.4" + discord-api-types: "npm:0.37.83" + tslib: "npm:^2.6.2" + ws: "npm:^8.16.0" + checksum: 10c0/57e46534e3ea8ba53c1fbd282d4f0aa03563e10244847f6e6393957a56d05ae0af52c43114d6a6e1d7a3f3127498b09efd69dd3da11abe5e4a5170ac2e269178 + languageName: node + linkType: hard + "@discordjs/ws@npm:^1.0.2": version: 1.0.2 resolution: "@discordjs/ws@npm:1.0.2" @@ -1090,6 +1162,13 @@ __metadata: languageName: node linkType: hard +"@sapphire/async-queue@npm:^1.5.2, @sapphire/async-queue@npm:^1.5.3": + version: 1.5.3 + resolution: "@sapphire/async-queue@npm:1.5.3" + checksum: 10c0/fcf860cdde9bfbc1625dab5e11924caa871c9e741a8fb836193a519267179a4a1979604f88f8a40855c6b931bc82d489dcd11d034fea38bb8a4d9816ab821ed1 + languageName: node + linkType: hard + "@sapphire/shapeshift@npm:^3.9.3": version: 3.9.7 resolution: "@sapphire/shapeshift@npm:3.9.7" @@ -1100,6 +1179,16 @@ __metadata: languageName: node linkType: hard +"@sapphire/shapeshift@npm:^4.0.0": + version: 4.0.0 + resolution: "@sapphire/shapeshift@npm:4.0.0" + dependencies: + fast-deep-equal: "npm:^3.1.3" + lodash: "npm:^4.17.21" + checksum: 10c0/2abbfd20977e800455108688e45fff7b7c6e197256c8f8a54db90025a900914908b5fa4ffcbd1eacb4c692792cbed980613aa878e09f1fd87ab5052b6a6d6bce + languageName: node + linkType: hard + "@sapphire/snowflake@npm:3.5.1": version: 3.5.1 resolution: "@sapphire/snowflake@npm:3.5.1" @@ -1107,22 +1196,37 @@ __metadata: languageName: node linkType: hard -"@sapphire/snowflake@npm:^3.5.1": +"@sapphire/snowflake@npm:3.5.3, @sapphire/snowflake@npm:^3.5.1, @sapphire/snowflake@npm:^3.5.3": version: 3.5.3 resolution: "@sapphire/snowflake@npm:3.5.3" checksum: 10c0/361b6a3e16eea4eb48b2608005ce397d4163065ccd84077059a0f609b97fb9cc52a173d7a64bbfce6f5d1e77be0f9704fd72ef64683a3dc7e455e9b4a1c90db1 languageName: node linkType: hard -"@sern/handler@npm:^3.3.4": - version: 3.3.4 - resolution: "@sern/handler@npm:3.3.4" +"@sern/handler@npm:^4.0.2": + version: 4.0.2 + resolution: "@sern/handler@npm:4.0.2" dependencies: + "@sern/ioc": "npm:^1.1.0" callsites: "npm:^3.1.0" - iti: "npm:^0.6.0" + cron: "npm:^3.1.7" + deepmerge: "npm:^4.3.1" rxjs: "npm:^7.8.0" - ts-results-es: "npm:^4.0.0" - checksum: 10c0/46b944616dcaf7feccf7899e2ae62d94730efab71dfffd6ab3bb157da5b12ee6a30e837670d131b5b4ca55268415a390e362836976ff033039e9c64d8ae4165d + checksum: 10c0/f4b7a1d70064fb25f89688b4a1122cb0f608e87bca68aeb6b9d5a0de9629b83a6e7fc20ecca5885d3328b1dcd788ac942a8d6c78223775c692409aee3e777f1c + languageName: node + linkType: hard + +"@sern/ioc@npm:^1.1.0": + version: 1.1.0 + resolution: "@sern/ioc@npm:1.1.0" + checksum: 10c0/2a8eac991c97c3942baac8b855d380573ed97a0eb49bcddebcc8b36f587be977762b7acc72bebadb1f5dbc39c400a2011ea72f75962d7b91392be1051528ddd7 + languageName: node + linkType: hard + +"@sern/publisher@npm:^1.1.2": + version: 1.1.2 + resolution: "@sern/publisher@npm:1.1.2" + checksum: 10c0/7b22ebf9a2ddf7100f287eeda16771ff2122640429a02820d5654e3aa361eceaf92b429d330e035b303d4cb085f3acf5a3689b6795c298f04cf8762fa6e0187b languageName: node linkType: hard @@ -1672,6 +1776,13 @@ __metadata: languageName: node linkType: hard +"@types/luxon@npm:~3.4.0": + version: 3.4.2 + resolution: "@types/luxon@npm:3.4.2" + checksum: 10c0/d835467de3daf7e17ba78b50bb5a14efd94272439ca067990d71332a54b311544459c69623eddd243b511b28d70194c9591a9ee8cf9c038962c965f991affd7e + languageName: node + linkType: hard + "@types/mime@npm:^1": version: 1.3.5 resolution: "@types/mime@npm:1.3.5" @@ -1749,6 +1860,15 @@ __metadata: languageName: node linkType: hard +"@types/ws@npm:^8.5.10": + version: 8.5.12 + resolution: "@types/ws@npm:8.5.12" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/3fd77c9e4e05c24ce42bfc7647f7506b08c40a40fe2aea236ef6d4e96fc7cb4006a81ed1b28ec9c457e177a74a72924f4768b7b4652680b42dfd52bc380e15f9 + languageName: node + linkType: hard + "@types/ws@npm:^8.5.4, @types/ws@npm:^8.5.9": version: 8.5.10 resolution: "@types/ws@npm:8.5.10" @@ -1765,6 +1885,13 @@ __metadata: languageName: node linkType: hard +"@vladfrangu/async_event_emitter@npm:^2.2.4, @vladfrangu/async_event_emitter@npm:^2.4.6": + version: 2.4.6 + resolution: "@vladfrangu/async_event_emitter@npm:2.4.6" + checksum: 10c0/1fe634878902da584493ecb8e81c855436c002b215dd7c25c21780930fc5621ebe8eb79d5b899a56af0d1ea9ea9171e35175221e4438e2f56c67ce64d4b8a373 + languageName: node + linkType: hard + "abbrev@npm:1": version: 1.1.1 resolution: "abbrev@npm:1.1.1" @@ -2135,18 +2262,22 @@ __metadata: languageName: node linkType: hard -"cheerio@npm:^1.0.0-rc.11": - version: 1.0.0-rc.12 - resolution: "cheerio@npm:1.0.0-rc.12" +"cheerio@npm:^1.0.0-rc.12": + version: 1.0.0 + resolution: "cheerio@npm:1.0.0" dependencies: cheerio-select: "npm:^2.1.0" dom-serializer: "npm:^2.0.0" domhandler: "npm:^5.0.3" - domutils: "npm:^3.0.1" - htmlparser2: "npm:^8.0.1" - parse5: "npm:^7.0.0" + domutils: "npm:^3.1.0" + encoding-sniffer: "npm:^0.2.0" + htmlparser2: "npm:^9.1.0" + parse5: "npm:^7.1.2" parse5-htmlparser2-tree-adapter: "npm:^7.0.0" - checksum: 10c0/c85d2f2461e3f024345b78e0bb16ad8e41492356210470dd1e7d5a91391da9fcf6c0a7cb48a9ba8820330153f0cedb4d0a60c7af15d96ecdb3092299b9d9c0cc + parse5-parser-stream: "npm:^7.1.2" + undici: "npm:^6.19.5" + whatwg-mimetype: "npm:^4.0.0" + checksum: 10c0/d0e16925d9c36c879edfaef1c0244c866375a4c7b8d6ccd7ae0ad42da7d26263ea1a3c17b9a1aa5965918deeff2d40ac2e7223824f8e6eca972df3b81316a09f languageName: node linkType: hard @@ -2269,6 +2400,16 @@ __metadata: languageName: node linkType: hard +"cron@npm:^3.1.7": + version: 3.1.7 + resolution: "cron@npm:3.1.7" + dependencies: + "@types/luxon": "npm:~3.4.0" + luxon: "npm:~3.4.0" + checksum: 10c0/c009c79714ae2916233c8cd2700cdda17c9e20d0e8e32eeb6c0d63b8e89bb7c38dbf9f0423f0f6da52d3f054f735aabb988cbe5b25bb55d9c6ca48ed4cfaaaec + languageName: node + linkType: hard + "cross-fetch@npm:^4.0.0": version: 4.0.0 resolution: "cross-fetch@npm:4.0.0" @@ -2373,6 +2514,13 @@ __metadata: languageName: node linkType: hard +"deepmerge@npm:^4.3.1": + version: 4.3.1 + resolution: "deepmerge@npm:4.3.1" + checksum: 10c0/e53481aaf1aa2c4082b5342be6b6d8ad9dfe387bc92ce197a66dea08bd4265904a087e75e464f14d1347cf2ac8afe1e4c16b266e0561cc5df29382d3c5f80044 + languageName: node + linkType: hard + "defer-to-connect@npm:^2.0.1": version: 2.0.1 resolution: "defer-to-connect@npm:2.0.1" @@ -2440,6 +2588,20 @@ __metadata: languageName: node linkType: hard +"discord-api-types@npm:0.37.83": + version: 0.37.83 + resolution: "discord-api-types@npm:0.37.83" + checksum: 10c0/cc1fd6c27a4076a47b1dae71212da52dd2265785edc3b099e3f0b05dae1df469e1a90e8159beff8fbdb37d65324cae4196625568541df6b9afdc80c300936ed6 + languageName: node + linkType: hard + +"discord-api-types@npm:0.37.97": + version: 0.37.97 + resolution: "discord-api-types@npm:0.37.97" + checksum: 10c0/1a08a0f44d3a7439fd1ac4128e4a853c498fa5477e40bc68f2c62d5b2abe8aad1d1d402d8a59a6ac55adf348354dc6c97865a11548b1a25bf2f0878cff3a54b0 + languageName: node + linkType: hard + "discord-api-types@npm:^0.37.35": version: 0.37.81 resolution: "discord-api-types@npm:0.37.81" @@ -2458,7 +2620,7 @@ __metadata: languageName: node linkType: hard -"discord.js@npm:^14.12.1, discord.js@npm:^14.14.1": +"discord.js@npm:^14.12.1": version: 14.14.1 resolution: "discord.js@npm:14.14.1" dependencies: @@ -2480,6 +2642,26 @@ __metadata: languageName: node linkType: hard +"discord.js@npm:^14.16.2": + version: 14.16.2 + resolution: "discord.js@npm:14.16.2" + dependencies: + "@discordjs/builders": "npm:^1.9.0" + "@discordjs/collection": "npm:1.5.3" + "@discordjs/formatters": "npm:^0.5.0" + "@discordjs/rest": "npm:^2.4.0" + "@discordjs/util": "npm:^1.1.1" + "@discordjs/ws": "npm:1.1.1" + "@sapphire/snowflake": "npm:3.5.3" + discord-api-types: "npm:0.37.97" + fast-deep-equal: "npm:3.1.3" + lodash.snakecase: "npm:4.1.1" + tslib: "npm:^2.6.3" + undici: "npm:6.19.8" + checksum: 10c0/2b4289d6a3b3f5c2978dbfa840225d2f789eaf161ae85bf12e0125b5096eb64562c170dfc7f0d1ee389beb565cabe45733a27853178b2d0dc78548b5d1a83338 + languageName: node + linkType: hard + "dom-serializer@npm:^1.0.1, dom-serializer@npm:^1.3.2": version: 1.4.1 resolution: "dom-serializer@npm:1.4.1" @@ -2538,7 +2720,7 @@ __metadata: languageName: node linkType: hard -"domutils@npm:^3.0.1": +"domutils@npm:^3.0.1, domutils@npm:^3.1.0": version: 3.1.0 resolution: "domutils@npm:3.1.0" dependencies: @@ -2598,6 +2780,16 @@ __metadata: languageName: node linkType: hard +"encoding-sniffer@npm:^0.2.0": + version: 0.2.0 + resolution: "encoding-sniffer@npm:0.2.0" + dependencies: + iconv-lite: "npm:^0.6.3" + whatwg-encoding: "npm:^3.1.1" + checksum: 10c0/b312e0d67f339bec44e021e5210ee8ee90d7b8f9975eb2c79a36fd467eb07709e88dcf62ee20f62ee0d74a13874307d99557852a2de9b448f1e3fb991fc68257 + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -2614,7 +2806,7 @@ __metadata: languageName: node linkType: hard -"entities@npm:^4.2.0, entities@npm:^4.4.0": +"entities@npm:^4.2.0, entities@npm:^4.4.0, entities@npm:^4.5.0": version: 4.5.0 resolution: "entities@npm:4.5.0" checksum: 10c0/5b039739f7621f5d1ad996715e53d964035f75ad3b9a4d38c6b3804bb226e282ffeae2443624d8fdd9c47d8e926ae9ac009c54671243f0c3294c26af7cc85250 @@ -2969,7 +3161,7 @@ __metadata: languageName: node linkType: hard -"googlethis@npm:^1.7.1": +"googlethis@npm:^1.8.0": version: 1.8.0 resolution: "googlethis@npm:1.8.0" dependencies: @@ -3076,15 +3268,15 @@ __metadata: languageName: node linkType: hard -"htmlparser2@npm:^8.0.1": - version: 8.0.2 - resolution: "htmlparser2@npm:8.0.2" +"htmlparser2@npm:^9.1.0": + version: 9.1.0 + resolution: "htmlparser2@npm:9.1.0" dependencies: domelementtype: "npm:^2.3.0" domhandler: "npm:^5.0.3" - domutils: "npm:^3.0.1" - entities: "npm:^4.4.0" - checksum: 10c0/609cca85886d0bf2c9a5db8c6926a89f3764596877492e2caa7a25a789af4065bc6ee2cdc81807fe6b1d03a87bf8a373b5a754528a4cc05146b713c20575aab4 + domutils: "npm:^3.1.0" + entities: "npm:^4.5.0" + checksum: 10c0/394f6323efc265bbc791d8c0d96bfe95984e0407565248521ab92e2dc7668e5ceeca7bc6ed18d408b9ee3b25032c5743368a4280d280332d782821d5d467ad8f languageName: node linkType: hard @@ -3164,7 +3356,7 @@ __metadata: languageName: node linkType: hard -"iconv-lite@npm:^0.6.2": +"iconv-lite@npm:0.6.3, iconv-lite@npm:^0.6.2, iconv-lite@npm:^0.6.3": version: 0.6.3 resolution: "iconv-lite@npm:0.6.3" dependencies: @@ -3270,15 +3462,6 @@ __metadata: languageName: node linkType: hard -"iti@npm:^0.6.0": - version: 0.6.0 - resolution: "iti@npm:0.6.0" - dependencies: - utility-types: "npm:^3.10.0" - checksum: 10c0/675d60710922c3cd738cb297563cf904b1e14aa30c7b1ff7455d3649af7b80ebcae5cf46dcd178a668377a662e4c61771ef8fba16daf576f0a2e47148b074629 - languageName: node - linkType: hard - "jackspeak@npm:^2.3.6": version: 2.3.6 resolution: "jackspeak@npm:2.3.6" @@ -3375,7 +3558,14 @@ __metadata: languageName: node linkType: hard -"magic-bytes.js@npm:^1.5.0": +"luxon@npm:~3.4.0": + version: 3.4.4 + resolution: "luxon@npm:3.4.4" + checksum: 10c0/02e26a0b039c11fd5b75e1d734c8f0332c95510f6a514a9a0991023e43fb233884da02d7f966823ffb230632a733fc86d4a4b1e63c3fbe00058b8ee0f8c728af + languageName: node + linkType: hard + +"magic-bytes.js@npm:^1.10.0, magic-bytes.js@npm:^1.5.0": version: 1.10.0 resolution: "magic-bytes.js@npm:1.10.0" checksum: 10c0/aa751a9be6baa80da19b395a4c538e1dcf652a3760a2e507b9e04c4cb3832635b718f8a947e5b0a434a1b323792632002f98815b3389f0beb3af1c4d51eb339e @@ -3916,6 +4106,15 @@ __metadata: languageName: node linkType: hard +"parse5-parser-stream@npm:^7.1.2": + version: 7.1.2 + resolution: "parse5-parser-stream@npm:7.1.2" + dependencies: + parse5: "npm:^7.0.0" + checksum: 10c0/e236c61000d38ecad369e725a48506b051cebad8abb00e6d4e8bff7aa85c183820fcb45db1559cc90955bdbbdbd665ea94c41259594e74566fff411478dc7fcb + languageName: node + linkType: hard + "parse5@npm:^6.0.1": version: 6.0.1 resolution: "parse5@npm:6.0.1" @@ -3923,7 +4122,7 @@ __metadata: languageName: node linkType: hard -"parse5@npm:^7.0.0": +"parse5@npm:^7.0.0, parse5@npm:^7.1.2": version: 7.1.2 resolution: "parse5@npm:7.1.2" dependencies: @@ -4617,7 +4816,7 @@ __metadata: languageName: node linkType: hard -"ts-mixer@npm:^6.0.3": +"ts-mixer@npm:^6.0.3, ts-mixer@npm:^6.0.4": version: 6.0.4 resolution: "ts-mixer@npm:6.0.4" checksum: 10c0/4c442fc99cdffd4a3f0ce55c624fb703f4ded5cab6912f97705489565c4a74d3e4213f10c33499ec5150900a628d38537a9a6a9e35b5045b65129a84b4db21ae @@ -4662,13 +4861,6 @@ __metadata: languageName: node linkType: hard -"ts-results-es@npm:^4.0.0": - version: 4.1.0 - resolution: "ts-results-es@npm:4.1.0" - checksum: 10c0/8cd576edacc885695f95f0577e665ccbe1806c6cacc88fe2ccc0b8fcd37e440b507940c574a6cfb167b575f1bf245583d66164a091e9a6122cbf33c8943df9d5 - languageName: node - linkType: hard - "tsc-watch@npm:^5.0.3": version: 5.0.3 resolution: "tsc-watch@npm:5.0.3" @@ -4700,6 +4892,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^2.6.3": + version: 2.7.0 + resolution: "tslib@npm:2.7.0" + checksum: 10c0/469e1d5bf1af585742128827000711efa61010b699cb040ab1800bcd3ccdd37f63ec30642c9e07c4439c1db6e46345582614275daca3e0f4abae29b0083f04a6 + languageName: node + linkType: hard + "type-is@npm:~1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18" @@ -4710,23 +4909,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.4.5": - version: 5.4.5 - resolution: "typescript@npm:5.4.5" +"typescript@npm:^5.6.2": + version: 5.6.2 + resolution: "typescript@npm:5.6.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/2954022ada340fd3d6a9e2b8e534f65d57c92d5f3989a263754a78aba549f7e6529acc1921913560a4b816c46dce7df4a4d29f9f11a3dc0d4213bb76d043251e + checksum: 10c0/3ed8297a8c7c56b7fec282532503d1ac795239d06e7c4966b42d4330c6cf433a170b53bcf93a130a7f14ccc5235de5560df4f1045eb7f3550b46ebed16d3c5e5 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.4.5#optional!builtin": - version: 5.4.5 - resolution: "typescript@patch:typescript@npm%3A5.4.5#optional!builtin::version=5.4.5&hash=5adc0c" +"typescript@patch:typescript@npm%3A^5.6.2#optional!builtin": + version: 5.6.2 + resolution: "typescript@patch:typescript@npm%3A5.6.2#optional!builtin::version=5.6.2&hash=5adc0c" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/db2ad2a16ca829f50427eeb1da155e7a45e598eec7b086d8b4e8ba44e5a235f758e606d681c66992230d3fc3b8995865e5fd0b22a2c95486d0b3200f83072ec9 + checksum: 10c0/e6c1662e4852e22fe4bbdca471dca3e3edc74f6f1df043135c44a18a7902037023ccb0abdfb754595ca9028df8920f2f8492c00fc3cbb4309079aae8b7de71cd languageName: node linkType: hard @@ -4746,6 +4945,13 @@ __metadata: languageName: node linkType: hard +"undici@npm:6.19.8, undici@npm:^6.19.5": + version: 6.19.8 + resolution: "undici@npm:6.19.8" + checksum: 10c0/07fd8520bce7e34ea29c07ef0de27b734183042cdb4e2f1262cd1fb9b755a6b04ff2471040395dfb1770fb7786069a97c5178bcf706b80a34075994f46feb37c + languageName: node + linkType: hard + "undici@npm:^6.11.1": version: 6.14.1 resolution: "undici@npm:6.14.1" @@ -4792,13 +4998,6 @@ __metadata: languageName: node linkType: hard -"utility-types@npm:^3.10.0": - version: 3.11.0 - resolution: "utility-types@npm:3.11.0" - checksum: 10c0/2f1580137b0c3e6cf5405f37aaa8f5249961a76d26f1ca8efc0ff49a2fc0e0b2db56de8e521a174d075758e0c7eb3e590edec0832eb44478b958f09914920f19 - languageName: node - linkType: hard - "utils-merge@npm:1.0.1": version: 1.0.1 resolution: "utils-merge@npm:1.0.1" @@ -4834,25 +5033,26 @@ __metadata: resolution: "vinci@workspace:." dependencies: "@ai-zen/node-fetch-event-source": "npm:^2.1.4" - "@consumet/extensions": "npm:1.3.5" + "@consumet/extensions": "npm:^1.7.0" "@discordjs/opus": "npm:^0.9.0" "@discordjs/voice": "npm:^0.15.0" "@microsoft/fetch-event-source": "npm:^2.0.1" "@napi-rs/canvas": "npm:^0.1.52" - "@sern/handler": "npm:^3.3.4" + "@sern/handler": "npm:^4.0.2" + "@sern/publisher": "npm:^1.1.2" "@types/express": "npm:^4.17.14" "@types/node": "npm:^20.12.7" axios: "npm:^1.6.8" dayjs: "npm:^1.11.6" discord-tictactoe: "npm:^4.0.0" - discord.js: "npm:^14.14.1" + discord.js: "npm:^14.16.2" dotenv: "npm:^16.0.1" execa: "npm:^6.1.0" express: "npm:^4.18.1" extended-eventsource: "npm:^1.4.6" form-data: "npm:^4.0.0" genius-lyrics: "npm:^4.4.3" - googlethis: "npm:^1.7.1" + googlethis: "npm:^1.8.0" got: "npm:^12.5.3" libsodium-wrappers: "npm:^0.7.10" mongoose: "npm:^6.11.3" @@ -4866,7 +5066,7 @@ __metadata: systeminformation: "npm:^5.21.7" ts-node: "npm:10.9.1" tsc-watch: "npm:^5.0.3" - typescript: "npm:^5.4.5" + typescript: "npm:^5.6.2" languageName: unknown linkType: soft @@ -4891,6 +5091,22 @@ __metadata: languageName: node linkType: hard +"whatwg-encoding@npm:^3.1.1": + version: 3.1.1 + resolution: "whatwg-encoding@npm:3.1.1" + dependencies: + iconv-lite: "npm:0.6.3" + checksum: 10c0/273b5f441c2f7fda3368a496c3009edbaa5e43b71b09728f90425e7f487e5cef9eb2b846a31bd760dd8077739c26faf6b5ca43a5f24033172b003b72cf61a93e + languageName: node + linkType: hard + +"whatwg-mimetype@npm:^4.0.0": + version: 4.0.0 + resolution: "whatwg-mimetype@npm:4.0.0" + checksum: 10c0/a773cdc8126b514d790bdae7052e8bf242970cebd84af62fb2f35a33411e78e981f6c0ab9ed1fe6ec5071b09d5340ac9178e05b52d35a9c4bcf558ba1b1551df + languageName: node + linkType: hard + "whatwg-url@npm:^11.0.0": version: 11.0.0 resolution: "whatwg-url@npm:11.0.0" @@ -5001,6 +5217,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:^8.16.0": + version: 8.18.0 + resolution: "ws@npm:8.18.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 10c0/25eb33aff17edcb90721ed6b0eb250976328533ad3cd1a28a274bd263682e7296a6591ff1436d6cbc50fa67463158b062f9d1122013b361cec99a05f84680e06 + languageName: node + linkType: hard + "yallist@npm:^4.0.0": version: 4.0.0 resolution: "yallist@npm:4.0.0"