diff --git a/commands/fun/a.ts b/commands/fun/a.ts index 506e977..181bfee 100644 --- a/commands/fun/a.ts +++ b/commands/fun/a.ts @@ -33,19 +33,19 @@ export default commandModule({ try {option = options[1].getString('usuario', true)} catch(error) {option = undefined} if (!option) { const imagesArray = [ - './images/XaviXE.png', - './images/Paula.png', - './images/William.png', - './images/Espejito2500.png', - './images/Wheelook.png', - './images/MarioCabrera.png', - './images/Paticama.png', - './images/Vinci.png', - './images/SrIzan.png', - './images/ItsAdrian.png', - './images/ByHGT.png', - './images/Irene.png', - './images/Boniato64.png', + './images/a/XaviXE.png', + './images/a/Paula.png', + './images/a/William.png', + './images/a/Espejito2500.png', + './images/a/Wheelook.png', + './images/a/MarioCabrera.png', + './images/a/Paticama.png', + './images/a/Vinci.png', + './images/a/SrIzan.png', + './images/a/ItsAdrian.png', + './images/a/ByHGT.png', + './images/a/Irene.png', + './images/a/Boniato64.png', ] const images = imagesArray[Math.floor(Math.random() * imagesArray.length)]; diff --git a/commands/fun/megamind.ts b/commands/fun/megamind.ts new file mode 100644 index 0000000..a5de0d7 --- /dev/null +++ b/commands/fun/megamind.ts @@ -0,0 +1,56 @@ +import { commandModule, CommandType } from '@sern/handler' +import { publish } from "../../src/plugins/publish.js"; +import { ownerOnly } from "../../src/plugins/ownerOnly.js" +import Canvas from '@napi-rs/canvas'; +import { ApplicationCommandOptionType, AttachmentBuilder } from 'discord.js'; +/* +import { publish } from "../../src/plugins/publish.js"; +import { ownerOnly } from "../../src/plugins/ownerOnly.js" +*/ + +export default commandModule({ + type: CommandType.Slash, + plugins: [publish()], + // , '928018226330337280' + description: 'Añade a una imagen de megamind "No ...?"', + //alias : [], + options: [ + { + name: 'texto', + description: 'El texto SIN "No" ni "?".', + type: ApplicationCommandOptionType.String, + required: true + } + ], + execute: async (ctx, options) => { + const option = options[1].getString('texto', true) + if (option.length > 26) return await ctx.reply({content: `El texto es muy largo, intenta que sea menor que 26 caracteres.`, ephemeral: true}) + + await ctx.reply({content: 'Cargando...'}) + + const before = performance.now() + + const canvas = Canvas.createCanvas(535, 540) + const context = canvas.getContext('2d') + + const background = await Canvas.loadImage('./images/megamind/megamind.png') + context.drawImage(background, 0, 0, canvas.width, canvas.height) + + const text = `No ${option}?` + context.font = '40px Arial' + context.fillStyle = 'red' + context.textAlign = 'center' + context.textBaseline = 'middle' + context.fillText(text, canvas.width / 2, canvas.height - 510) + + const encode = await canvas.encode('png') + + const after = performance.now() + + const attachment = new AttachmentBuilder(encode, { name: 'profile-image.png' }); + await ctx.interaction.editReply({ + content: `Aquí está tu megamind:\nLa generación de imagen ha tardado \`${(after - before).toFixed(2)}ms\`.`, + files: [attachment] + }) + }, +}); \ No newline at end of file diff --git a/commands/ping.ts b/commands/ping.ts index d60aa4d..924ce18 100644 --- a/commands/ping.ts +++ b/commands/ping.ts @@ -9,7 +9,7 @@ import { ownerOnly } from "../../src/plugins/ownerOnly.js" export default commandModule({ name: 'ping', type: CommandType.Slash, - plugins: [publish({ guildIds: ['1000400148289036298'] })], + plugins: [publish()], // , '928018226330337280' description: 'A ping command', //alias : [], diff --git a/images/Boniato64.png b/images/a/Boniato64.png similarity index 100% rename from images/Boniato64.png rename to images/a/Boniato64.png diff --git a/images/ByHGT.png b/images/a/ByHGT.png similarity index 100% rename from images/ByHGT.png rename to images/a/ByHGT.png diff --git a/images/Espejito2500.png b/images/a/Espejito2500.png similarity index 100% rename from images/Espejito2500.png rename to images/a/Espejito2500.png diff --git a/images/Irene.png b/images/a/Irene.png similarity index 100% rename from images/Irene.png rename to images/a/Irene.png diff --git a/images/ItsAdrian.png b/images/a/ItsAdrian.png similarity index 100% rename from images/ItsAdrian.png rename to images/a/ItsAdrian.png diff --git a/images/MarioCabrera.png b/images/a/MarioCabrera.png similarity index 100% rename from images/MarioCabrera.png rename to images/a/MarioCabrera.png diff --git a/images/Paticama.png b/images/a/Paticama.png similarity index 100% rename from images/Paticama.png rename to images/a/Paticama.png diff --git a/images/Paula.png b/images/a/Paula.png similarity index 100% rename from images/Paula.png rename to images/a/Paula.png diff --git a/images/SrIzan.png b/images/a/SrIzan.png similarity index 100% rename from images/SrIzan.png rename to images/a/SrIzan.png diff --git a/images/Vinci.png b/images/a/Vinci.png similarity index 100% rename from images/Vinci.png rename to images/a/Vinci.png diff --git a/images/Wheelook.png b/images/a/Wheelook.png similarity index 100% rename from images/Wheelook.png rename to images/a/Wheelook.png diff --git a/images/William.png b/images/a/William.png similarity index 100% rename from images/William.png rename to images/a/William.png diff --git a/images/XaviXE.png b/images/a/XaviXE.png similarity index 100% rename from images/XaviXE.png rename to images/a/XaviXE.png diff --git a/images/megamind/megamind.png b/images/megamind/megamind.png new file mode 100644 index 0000000..ac51305 Binary files /dev/null and b/images/megamind/megamind.png differ diff --git a/index.ts b/index.ts index 3bee751..788a4f2 100644 --- a/index.ts +++ b/index.ts @@ -3,20 +3,20 @@ import { ActivityType } from 'discord.js'; import { Client, GatewayIntentBits } from 'discord.js'; import { Sern } from '@sern/handler'; import { config as dotenv } from 'dotenv'; -let devMode -if (process.argv[2] === '--dev') { - devMode = true - dotenv({path: './.env.dev'}) -} else { - dotenv() -} import mongoose from 'mongoose'; -import express from 'express'; import youtubenotifications from './util/youtubenotifications.js'; import { setIntervalAsync } from 'set-interval-async'; import birthdays from './util/birthdays.js'; import twitternotifications from './util/twitternotifications.js'; -const app = express(); +import webserver from './util/web/webserver.js' + +let devMode +if (process.argv[2] === '--dev') { + devMode = true + dotenv({path: '.env.dev'}) +} else { + dotenv() +} const client = new Client({ intents: [ @@ -30,7 +30,7 @@ const client = new Client({ ], }); -export const db = mongoose.connect(process.env.MONGODB!).then(() => { +mongoose.connect(process.env.MONGODB!).then(() => { console.log('Connected to MongoDB'); }); @@ -48,6 +48,7 @@ client.on('ready', async () => { const statuses = [ { name: 'Minecraft', type: ActivityType.Playing }, { name: 'cómo escribe Javi', type: ActivityType.Watching }, + { name: 'quinto libro when', type: ActivityType.Watching }, { name: 'a Hermes', type: ActivityType.Watching }, { name: 'tus comandos', type: ActivityType.Listening }, { name: 'tu voz', type: ActivityType.Listening }, @@ -70,8 +71,9 @@ client.on('ready', async () => { setIntervalAsync(async () => { await birthdays(client); }, 3_600_000); + webserver() } else { - console.log('DevMode got activated, there are no checkers in this version.') + console.log('DevMode got activated, there are no checkers or webserver in this version.') } }); @@ -79,16 +81,4 @@ client.on('rateLimit', async () => { console.log(`I just got ratelimited!`); }); -app.use(express.static('public')); - -app.get('/', function (req, res) { - res.send( - '
This is the monitoring server for the Vinci discord bot!
If you see this, the bot is up and running.
' - ); -}); - -app.listen(process.env.PORT || 7272, () => - console.log('The webserver is listening') -); - client.login(process.env.TOKEN); diff --git a/package-lock.json b/package-lock.json index f0f55b2..7f8f29c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@consumet/extensions": "^1.2.8", "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.13.0", + "@napi-rs/canvas": "^0.1.30", "@sern/handler": "^1.2.1", "axios": "^1.0.0", "dayjs": "^1.11.6", @@ -21,12 +22,12 @@ "dotenv": "^16.0.1", "express": "^4.18.1", "got": "^11.8.5", + "libsodium-wrappers": "^0.7.10", "mongoose": "^6.5.1", "pretty-seconds-spanish": "^2.1.0", "rockpaperscissors-checker": "^1.1.5", "set-interval-async": "^3.0.2", - "systeminformation": "^5.12.6", - "tweetnacl": "^1.0.3" + "systeminformation": "^5.12.6" }, "devDependencies": { "@types/express": "^4.17.14", @@ -291,6 +292,164 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@napi-rs/canvas": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.30.tgz", + "integrity": "sha512-XRR6PumJW9GdODD+HFW7ZKmpq7FE6PIKWn7QTcsJUdGNb54fTS1Z47oPFZ3pbvs07Xs8ZnkR03Q/9T3LfkGRgg==", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@napi-rs/canvas-android-arm64": "0.1.30", + "@napi-rs/canvas-darwin-arm64": "0.1.30", + "@napi-rs/canvas-darwin-x64": "0.1.30", + "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.30", + "@napi-rs/canvas-linux-arm64-gnu": "0.1.30", + "@napi-rs/canvas-linux-arm64-musl": "0.1.30", + "@napi-rs/canvas-linux-x64-gnu": "0.1.30", + "@napi-rs/canvas-linux-x64-musl": "0.1.30", + "@napi-rs/canvas-win32-x64-msvc": "0.1.30" + } + }, + "node_modules/@napi-rs/canvas-android-arm64": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.30.tgz", + "integrity": "sha512-RaJvfg5x8QV+3WVqxwi1dt05mqiDuQF/w4wj8b6SHbxbVLfzZ5T0M9PFBTvjNU88GxiiVYUihxJeCCDs1sXP0g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-darwin-arm64": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.30.tgz", + "integrity": "sha512-ZWW7+YYGFREzeV1uoGv0uUx+0OhGd5jQ6zFdaGYFESUjmLlfZ/LS0CG/IlbWDiWbnRPu2HQl0/TOQHurleJjLw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-darwin-x64": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.30.tgz", + "integrity": "sha512-DThro7Y3QFV/9bl/EORWXzBMXeIZU1jo80oI8Ha2Xsoy3Eq+wHhnlMyvNYcLjalxIFU/JJrzu6/qxjPaVzcw5A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.30.tgz", + "integrity": "sha512-bMz85lH3y2JL7Xf8szu/EayyEffN2FSAUtxOm6U3/MLc7jW2Pt8TRhAQQxnv0zNh8ub7qBDky+LspMBPLTDRzA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm64-gnu": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.30.tgz", + "integrity": "sha512-KHUVFOaG7wE4/GGTLk434GH7DIhPa7hhfMyzLqU1QFRXzjo0KIyO9gecHEF9snXaqvD4c/8YubEtFbWZVMSKUw==", + "cpu": [ + "arm64" + ], + "hasInstallScript": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm64-musl": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.30.tgz", + "integrity": "sha512-9ckRCQbt/ZVNbHvApKhvaRM+mahMl4xryV0vUEKgFHo8Fm4j56dPZRWeKojmk1vSGC9ahY73K1MEb0OaIxOv0Q==", + "cpu": [ + "arm64" + ], + "hasInstallScript": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-x64-gnu": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.30.tgz", + "integrity": "sha512-NSyhCClsTBs06ViivDU0lSGVTDBBtm3pSTQKZseAnBEEF0vuO4De5SJl4JYng9eSDQ6KqA4TkOZFUMxokP6ZVg==", + "cpu": [ + "x64" + ], + "hasInstallScript": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-x64-musl": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.30.tgz", + "integrity": "sha512-hT3sPij6nHKiH10avrd8MNwLYEBzwiVyzA0nxPosGJ+ErWk1tgE4UeM3w1+BWYK3S/wgY/4WlhxDgsd9crUGRA==", + "cpu": [ + "x64" + ], + "hasInstallScript": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-win32-x64-msvc": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.30.tgz", + "integrity": "sha512-6MwkIMd53jNqO+KAvv2A7TtMY1MYE51VCdF7sZ61sypgjB/dOYmYqDgAU/RTHS5agyc0CZUeXoaZT43Lkgk67A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@sapphire/async-queue": { "version": "1.5.0", "license": "MIT", @@ -1747,6 +1906,19 @@ "json-buffer": "3.0.1" } }, + "node_modules/libsodium": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", + "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" + }, + "node_modules/libsodium-wrappers": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", + "integrity": "sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==", + "dependencies": { + "libsodium": "^0.7.0" + } + }, "node_modules/lodash": { "version": "4.17.21", "license": "MIT" @@ -3019,11 +3191,6 @@ "node": "*" } }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" - }, "node_modules/type-is": { "version": "1.6.18", "license": "MIT", @@ -3378,6 +3545,76 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@napi-rs/canvas": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.30.tgz", + "integrity": "sha512-XRR6PumJW9GdODD+HFW7ZKmpq7FE6PIKWn7QTcsJUdGNb54fTS1Z47oPFZ3pbvs07Xs8ZnkR03Q/9T3LfkGRgg==", + "requires": { + "@napi-rs/canvas-android-arm64": "0.1.30", + "@napi-rs/canvas-darwin-arm64": "0.1.30", + "@napi-rs/canvas-darwin-x64": "0.1.30", + "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.30", + "@napi-rs/canvas-linux-arm64-gnu": "0.1.30", + "@napi-rs/canvas-linux-arm64-musl": "0.1.30", + "@napi-rs/canvas-linux-x64-gnu": "0.1.30", + "@napi-rs/canvas-linux-x64-musl": "0.1.30", + "@napi-rs/canvas-win32-x64-msvc": "0.1.30" + } + }, + "@napi-rs/canvas-android-arm64": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.30.tgz", + "integrity": "sha512-RaJvfg5x8QV+3WVqxwi1dt05mqiDuQF/w4wj8b6SHbxbVLfzZ5T0M9PFBTvjNU88GxiiVYUihxJeCCDs1sXP0g==", + "optional": true + }, + "@napi-rs/canvas-darwin-arm64": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.30.tgz", + "integrity": "sha512-ZWW7+YYGFREzeV1uoGv0uUx+0OhGd5jQ6zFdaGYFESUjmLlfZ/LS0CG/IlbWDiWbnRPu2HQl0/TOQHurleJjLw==", + "optional": true + }, + "@napi-rs/canvas-darwin-x64": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.30.tgz", + "integrity": "sha512-DThro7Y3QFV/9bl/EORWXzBMXeIZU1jo80oI8Ha2Xsoy3Eq+wHhnlMyvNYcLjalxIFU/JJrzu6/qxjPaVzcw5A==", + "optional": true + }, + "@napi-rs/canvas-linux-arm-gnueabihf": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.30.tgz", + "integrity": "sha512-bMz85lH3y2JL7Xf8szu/EayyEffN2FSAUtxOm6U3/MLc7jW2Pt8TRhAQQxnv0zNh8ub7qBDky+LspMBPLTDRzA==", + "optional": true + }, + "@napi-rs/canvas-linux-arm64-gnu": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.30.tgz", + "integrity": "sha512-KHUVFOaG7wE4/GGTLk434GH7DIhPa7hhfMyzLqU1QFRXzjo0KIyO9gecHEF9snXaqvD4c/8YubEtFbWZVMSKUw==", + "optional": true + }, + "@napi-rs/canvas-linux-arm64-musl": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.30.tgz", + "integrity": "sha512-9ckRCQbt/ZVNbHvApKhvaRM+mahMl4xryV0vUEKgFHo8Fm4j56dPZRWeKojmk1vSGC9ahY73K1MEb0OaIxOv0Q==", + "optional": true + }, + "@napi-rs/canvas-linux-x64-gnu": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.30.tgz", + "integrity": "sha512-NSyhCClsTBs06ViivDU0lSGVTDBBtm3pSTQKZseAnBEEF0vuO4De5SJl4JYng9eSDQ6KqA4TkOZFUMxokP6ZVg==", + "optional": true + }, + "@napi-rs/canvas-linux-x64-musl": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.30.tgz", + "integrity": "sha512-hT3sPij6nHKiH10avrd8MNwLYEBzwiVyzA0nxPosGJ+ErWk1tgE4UeM3w1+BWYK3S/wgY/4WlhxDgsd9crUGRA==", + "optional": true + }, + "@napi-rs/canvas-win32-x64-msvc": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.30.tgz", + "integrity": "sha512-6MwkIMd53jNqO+KAvv2A7TtMY1MYE51VCdF7sZ61sypgjB/dOYmYqDgAU/RTHS5agyc0CZUeXoaZT43Lkgk67A==", + "optional": true + }, "@sapphire/async-queue": { "version": "1.5.0" }, @@ -4403,6 +4640,19 @@ "json-buffer": "3.0.1" } }, + "libsodium": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", + "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" + }, + "libsodium-wrappers": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", + "integrity": "sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==", + "requires": { + "libsodium": "^0.7.0" + } + }, "lodash": { "version": "4.17.21" }, @@ -5225,11 +5475,6 @@ "safe-buffer": "^5.0.1" } }, - "tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" - }, "type-is": { "version": "1.6.18", "requires": { diff --git a/package.json b/package.json index 85140a3..4efd726 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "@consumet/extensions": "^1.2.8", "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.13.0", + "@napi-rs/canvas": "^0.1.30", "@sern/handler": "^1.2.1", "axios": "^1.0.0", "dayjs": "^1.11.6", @@ -39,12 +40,12 @@ "dotenv": "^16.0.1", "express": "^4.18.1", "got": "^11.8.5", + "libsodium-wrappers": "^0.7.10", "mongoose": "^6.5.1", "pretty-seconds-spanish": "^2.1.0", "rockpaperscissors-checker": "^1.1.5", "set-interval-async": "^3.0.2", - "systeminformation": "^5.12.6", - "tweetnacl": "^1.0.3" + "systeminformation": "^5.12.6" }, "devDependencies": { "@types/express": "^4.17.14", diff --git a/util/web/webserver.ts b/util/web/webserver.ts new file mode 100644 index 0000000..e8f5c2e --- /dev/null +++ b/util/web/webserver.ts @@ -0,0 +1,14 @@ +import express from 'express' + +export default function webserver() { + const app = express() + app.get('/', function (req, res) { + res.send( + 'This is the monitoring server for the Vinci discord bot!
If you see this, the bot is up and running.
' + ); + }); + + app.listen(process.env.PORT || 7272, () => + console.log('The webserver is listening') + ); +} \ No newline at end of file