diff --git a/commands/crypto.ts b/commands/crypto.ts index 0328839..f840b81 100644 --- a/commands/crypto.ts +++ b/commands/crypto.ts @@ -1,10 +1,7 @@ import { Message } from "discord.js"; import { Command, CommandDefinition, Action } from "."; -import dotenv from "dotenv"; import fetch from "node-fetch"; -dotenv.config(); - export const description: CommandDefinition = { name: "Crypto Watcher", description: @@ -14,7 +11,7 @@ export const description: CommandDefinition = { }; export const action: Action = async (message: Message): Promise => { - const symbol = message.content.replace("!crypto ", "").toUpperCase(); + const symbol = message.content.replace("!crypto ", "").toLowerCase(); if (symbol === "") { message.channel.send( "I don't see a symbol... For example, you can do `!crypto BASE-TARGET`, i.e. `!crypto btc-usd`" diff --git a/commands/music.ts b/commands/music.ts index a67f251..29458f1 100644 --- a/commands/music.ts +++ b/commands/music.ts @@ -40,7 +40,7 @@ const playSong = async ( console.log(`Streaming ${url} to ${message.author.tag}`); const dispatch = x .play( - await ytdl(url, { filter: "audioonly", highWaterMark: 1 << 50 }), + await ytdl(url, { filter: "audioonly", highWaterMark: 1 << 100 }), { type: "opus", highWaterMark: 1 } ) .on("finish", () => { @@ -91,7 +91,7 @@ export const action: Action = async ( ); return; } - const input: string = message.content.split(" ").splice(1).join(" ").trim(); + const input: string = message.content.split(" ").splice(1).join("+").trim(); if (validateURL(input)) { return playSong(input, voiceChannel, message); @@ -104,6 +104,8 @@ export const action: Action = async ( // Scrape for the title // https://iq.opengenus.org/scrapping-youtube-javascript/ const query: string = input.replace(" ", "+"); + + console.log(`INPUT QUERY: ${query}`); // puppeteer on heroku: https://stackoverflow.com/a/52228855 return puppeteer .launch({ args: ["--no-sandbox", "--disable-setuid-sandbox"] }) diff --git a/package-lock.json b/package-lock.json index 7983c5b..4649275 100644 --- a/package-lock.json +++ b/package-lock.json @@ -312,9 +312,9 @@ "dev": true }, "@types/node": { - "version": "14.14.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", - "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==" + "version": "14.14.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.35.tgz", + "integrity": "sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==" }, "@types/node-fetch": { "version": "2.5.8", @@ -817,14 +817,6 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, - "chrome-aws-lambda": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/chrome-aws-lambda/-/chrome-aws-lambda-7.0.0.tgz", - "integrity": "sha512-GbYXRPYtaA0DLfmxQpuZw1SKTP7rOA4UXiATwiFRJ4Ea6PBYSzqK0YjS7B2WimUBe//ybPfNpPIs8A3WpF0xvA==", - "requires": { - "lambdafs": "^2.0.2" - } - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", @@ -1197,9 +1189,9 @@ "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" }, "env-paths": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", - "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" }, "error-ex": { "version": "1.3.2", @@ -1420,9 +1412,9 @@ } }, "ffmpeg-static": { - "version": "4.2.7", - "resolved": "https://registry.npmjs.org/ffmpeg-static/-/ffmpeg-static-4.2.7.tgz", - "integrity": "sha512-SGnOr2d+k0/9toRIv9t5/hN/DMYbm5XMtG0wVwGM1tEyXJAD6dbcWOEvfHq4LOySm9uykKL6LMC4eVPeteUnbQ==", + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/ffmpeg-static/-/ffmpeg-static-4.2.8.tgz", + "integrity": "sha512-7zdrHt+STR/vzKfF7aO79zyyBknxxEO0SjJnZvOoA2i0RUiAzNo/jv5QLa05poIFAdnuvQSb3ExV4rzkXzhhFQ==", "requires": { "@derhuerst/http-basic": "^8.2.0", "env-paths": "^2.2.0", @@ -1749,9 +1741,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.54.tgz", - "integrity": "sha512-c8Lm7+hXdSPmWH4B9z/P/xIXhFK3mCQin4yCYMd2p1qpMG5AfgyJuYZ+3q2dT7qLiMMMGMd5dnkFpdqJARlvtQ==" + "version": "10.17.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.55.tgz", + "integrity": "sha512-koZJ89uLZufDvToeWO5BrC4CR4OUfHnUz2qoPs/daQH6qq3IN62QFxCTZ+bKaCE0xaoCAJYE4AXre8AbghCrhg==" } } }, @@ -2268,128 +2260,6 @@ "json-buffer": "3.0.0" } }, - "lambdafs": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lambdafs/-/lambdafs-2.0.2.tgz", - "integrity": "sha512-gr4FQ1eqNZ4k+VmdK1ZzyrcQFv6Hf2MlIgrBq0hXtgMpxU9hG/uKWsNX/FhfugB2aSucJkT4U9NrIVmnVG8NUg==", - "requires": { - "tar-fs": "^2.1.1" - }, - "dependencies": { - "base64-js": { - "version": "1.5.1", - "bundled": true - }, - "bl": { - "version": "4.0.3", - "bundled": true, - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "buffer": { - "version": "5.7.1", - "bundled": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "chownr": { - "version": "1.1.4", - "bundled": true - }, - "end-of-stream": { - "version": "1.4.4", - "bundled": true, - "requires": { - "once": "^1.4.0" - } - }, - "fs-constants": { - "version": "1.0.0", - "bundled": true - }, - "ieee754": { - "version": "1.2.1", - "bundled": true - }, - "inherits": { - "version": "2.0.4", - "bundled": true - }, - "mkdirp-classic": { - "version": "0.5.3", - "bundled": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "pump": { - "version": "3.0.0", - "bundled": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "readable-stream": { - "version": "3.6.0", - "bundled": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "bundled": true - }, - "string_decoder": { - "version": "1.3.0", - "bundled": true, - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "tar-fs": { - "version": "2.1.1", - "bundled": true, - "requires": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "tar-stream": { - "version": "2.1.4", - "bundled": true, - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - } - } - }, "latest-version": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", diff --git a/package.json b/package.json index b992a5d..99e1bce 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "license": "ISC", "devDependencies": { "@types/express": "^4.17.11", - "@types/node": "^14.14.20", + "@types/node": "^14.14.35", "@types/node-fetch": "^2.5.8", "nodemon": "^2.0.7", "npm-run-all": "^4.1.5", @@ -37,7 +37,7 @@ "dotenv": "^8.2.0", "express": "^4.17.1", "ffmpeg": "0.0.4", - "ffmpeg-static": "^4.2.7", + "ffmpeg-static": "^4.2.8", "fluent-ffmpeg": "^2.1.2", "ibm-watson": "^6.0.2", "node-fetch": "^2.6.1",