Bump packages

This commit is contained in:
Max Isom 2020-10-24 12:32:43 -04:00
parent 4f0ab9b549
commit 599dbce6e6
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
15 changed files with 20134 additions and 6734 deletions

1
.gitignore vendored
View file

@ -2,6 +2,7 @@ data
.DS_Store .DS_Store
dist dist
dts dts
.yarn
# Logs # Logs
logs logs

15605
.pnp.js generated Executable file

File diff suppressed because one or more lines are too long

1
.yarnrc.yml Normal file
View file

@ -0,0 +1 @@
yarnPath: ".yarn/releases/yarn-berry.js"

3611
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -16,10 +16,10 @@
"lint": "eslint 'src/**/*.ts'", "lint": "eslint 'src/**/*.ts'",
"lint-fix": "eslint 'src/**/*.ts' --fix", "lint-fix": "eslint 'src/**/*.ts' --fix",
"clean": "rm -rf dist dts", "clean": "rm -rf dist dts",
"test": "npm run lint", "test": "yarn lint",
"build": "tsc", "build": "tsc",
"watch": "tsc --watch", "watch": "tsc --watch",
"prepack": "npm run clean && npm run build", "prepack": "yarn clean && yarn build",
"start": "node dist/index.js", "start": "node dist/index.js",
"dev": "nodemon", "dev": "nodemon",
"docker-publish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t codetheweb/muse:latest --push ." "docker-publish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t codetheweb/muse:latest --push ."
@ -27,23 +27,23 @@
"devDependencies": { "devDependencies": {
"@types/bluebird": "^3.5.32", "@types/bluebird": "^3.5.32",
"@types/debug": "^4.1.5", "@types/debug": "^4.1.5",
"@types/fluent-ffmpeg": "^2.1.14", "@types/fluent-ffmpeg": "^2.1.16",
"@types/fs-capacitor": "^2.0.0", "@types/fs-capacitor": "^2.0.0",
"@types/node": "^14.6.0", "@types/node": "^14.14.2",
"@types/node-emoji": "^1.8.1", "@types/node-emoji": "^1.8.1",
"@types/spotify-web-api-node": "^4.0.1", "@types/spotify-web-api-node": "^4.0.1",
"@types/validator": "^13.1.0", "@types/validator": "^13.1.0",
"@types/ws": "^7.2.6", "@types/ws": "^7.2.7",
"@typescript-eslint/eslint-plugin": "^3.10.0", "@typescript-eslint/eslint-plugin": "^4.5.0",
"@typescript-eslint/parser": "^3.10.0", "@typescript-eslint/parser": "^4.5.0",
"eslint": "^7.7.0", "eslint": "^7.12.0",
"eslint-config-xo": "^0.32.1", "eslint-config-xo": "^0.33.1",
"eslint-config-xo-typescript": "^0.32.0", "eslint-config-xo-typescript": "^0.35.0",
"husky": "^4.2.5", "husky": "^4.3.0",
"nodemon": "^2.0.4", "nodemon": "^2.0.6",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"ts-node": "^9.0.0", "ts-node": "^9.0.0",
"typescript": "^4.0.2" "typescript": "^4.0.3"
}, },
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [
@ -63,21 +63,21 @@
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "npm test && npm run build" "pre-commit": "npm test && yarn build"
} }
}, },
"dependencies": { "dependencies": {
"@discordjs/opus": "^0.3.2", "@discordjs/opus": "^0.3.2",
"array-shuffle": "^1.0.1", "array-shuffle": "^1.0.1",
"debug": "^4.1.1", "debug": "^4.2.0",
"delay": "^4.4.0", "delay": "^4.4.0",
"discord.js": "^12.3.1", "discord.js": "^12.4.1",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"fluent-ffmpeg": "^2.1.2", "fluent-ffmpeg": "^2.1.2",
"fs-capacitor": "^6.2.0", "fs-capacitor": "^6.2.0",
"get-youtube-id": "^1.0.1", "get-youtube-id": "^1.0.1",
"got": "^11.5.2", "got": "^11.8.0",
"hasha": "^5.2.0", "hasha": "^5.2.2",
"inversify": "^5.0.1", "inversify": "^5.0.1",
"iso8601-duration": "^1.2.0", "iso8601-duration": "^1.2.0",
"make-dir": "^3.1.0", "make-dir": "^3.1.0",
@ -86,11 +86,11 @@
"sequelize": "^5.21.11", "sequelize": "^5.21.11",
"sequelize-typescript": "^1.1.0", "sequelize-typescript": "^1.1.0",
"spotify-uri": "^2.1.0", "spotify-uri": "^2.1.0",
"spotify-web-api-node": "^4.0.0", "spotify-web-api-node": "^5.0.0",
"sqlite3": "^5.0.0", "sqlite3": "^5.0.0",
"unique-random-array": "^2.0.0", "unique-random-array": "^2.0.0",
"youtube.ts": "^0.1.8", "youtube.ts": "^0.1.8",
"ytdl-core": "^3.2.2", "ytdl-core": "^3.4.2",
"ytsr": "^1.0.1" "ytsr": "^1.0.4"
} }
} }

View file

@ -89,7 +89,7 @@ export default class {
} }
await handler.execute(msg, args); await handler.execute(msg, args);
} catch (error) { } catch (error: unknown) {
debug(error); debug(error);
await msg.channel.send(errorMsg((error as Error).message.toLowerCase())); await msg.channel.send(errorMsg((error as Error).message.toLowerCase()));
} }

View file

@ -52,8 +52,8 @@ export default class implements Command {
await player.forwardSeek(seekTime); await player.forwardSeek(seekTime);
await loading.stop(); await loading.stop();
} catch (error) { } catch (error: unknown) {
await loading.stop(errorMsg(error)); await loading.stop(errorMsg(error as Error));
} }
} }
} }

View file

@ -2,8 +2,7 @@ import {TextChannel, Message} from 'discord.js';
import {URL} from 'url'; import {URL} from 'url';
import {TYPES} from '../types'; import {TYPES} from '../types';
import {inject, injectable} from 'inversify'; import {inject, injectable} from 'inversify';
import {QueuedSong} from '../services/player'; import {QueuedSong, STATUS} from '../services/player';
import {STATUS} from '../services/player';
import PlayerManager from '../managers/player'; import PlayerManager from '../managers/player';
import {getMostPopularVoiceChannel} from '../utils/channels'; import {getMostPopularVoiceChannel} from '../utils/channels';
import LoadingMessage from '../utils/loading-message'; import LoadingMessage from '../utils/loading-message';
@ -111,7 +110,7 @@ export default class implements Command {
newSongs.push(...convertedSongs); newSongs.push(...convertedSongs);
} }
} catch (_) { } catch (_: unknown) {
// Not a URL, must search YouTube // Not a URL, must search YouTube
const query = args.join(' '); const query = args.join(' ');

View file

@ -63,8 +63,8 @@ export default class implements Command {
await player.seek(seekTime); await player.seek(seekTime);
await loading.stop(); await loading.stop();
} catch (error) { } catch (error: unknown) {
await loading.stop(errorMsg(error)); await loading.stop(errorMsg(error as Error));
} }
} }
} }

View file

@ -32,7 +32,7 @@ export default class implements Command {
await player.forward(); await player.forward();
await loader.stop('keep \'er movin\''); await loader.stop('keep \'er movin\'');
} catch (_) { } catch (_: unknown) {
await loader.stop(errorMsg('no song to skip to')); await loader.stop(errorMsg('no song to skip to'));
} }
} }

View file

@ -28,7 +28,7 @@ export default class implements Command {
await player.back(); await player.back();
await msg.channel.send('back \'er up\''); await msg.channel.send('back \'er up\'');
} catch (_) { } catch (_: unknown) {
await msg.channel.send(errorMsg('no song to go back to')); await msg.channel.send(errorMsg('no song to go back to'));
} }
} }

View file

@ -29,7 +29,7 @@ export default class {
const {items: [video]} = await this.youtube.videos.search({q: query, maxResults: 1, type: 'video'}); const {items: [video]} = await this.youtube.videos.search({q: query, maxResults: 1, type: 'video'});
return await this.youtubeVideo(video.id.videoId); return await this.youtubeVideo(video.id.videoId);
} catch (_) { } catch (_: unknown) {
return null; return null;
} }
} }
@ -46,7 +46,7 @@ export default class {
playlist: null, playlist: null,
isLive: videoDetails.snippet.liveBroadcastContent === 'live' isLive: videoDetails.snippet.liveBroadcastContent === 'live'
}; };
} catch (_) { } catch (_: unknown) {
return null; return null;
} }
} }
@ -200,7 +200,7 @@ export default class {
playlist, playlist,
isLive: video.live isLive: video.live
}; };
} catch (_) { } catch (_: unknown) {
return null; return null;
} }
} }

View file

@ -84,7 +84,7 @@ export default class {
resolve(); resolve();
}, duration * 1000); }, duration * 1000);
} catch (error) { } catch (error: unknown) {
reject(error); reject(error);
} }
}); });

View file

@ -141,7 +141,7 @@ export default class {
this.startTrackingPosition(0); this.startTrackingPosition(0);
this.lastSongURL = currentSong.url; this.lastSongURL = currentSong.url;
} }
} catch (error) { } catch (error: unknown) {
this.removeCurrent(); this.removeCurrent();
throw error; throw error;
} }
@ -171,7 +171,7 @@ export default class {
this.status = STATUS.PAUSED; this.status = STATUS.PAUSED;
this.disconnect(); this.disconnect();
} }
} catch (error) { } catch (error: unknown) {
this.queuePosition--; this.queuePosition--;
throw error; throw error;
} }
@ -282,7 +282,7 @@ export default class {
await fs.access(this.getCachedPath(url)); await fs.access(this.getCachedPath(url));
return true; return true;
} catch (_) { } catch (_: unknown) {
return false; return false;
} }
} }
@ -313,7 +313,7 @@ export default class {
format = formats.find(filter); format = formats.find(filter);
const nextBestFormat = (formats: ytdl.videoFormat[]): ytdl.videoFormat | undefined => { const nextBestFormat = (formats: ytdl.videoFormat[]): ytdl.videoFormat | undefined => {
if (formats[0].live) { if (formats[0].isLive) {
formats = formats.sort((a, b) => (b as unknown as {audioBitrate: number}).audioBitrate - (a as unknown as {audioBitrate: number}).audioBitrate); // Bad typings formats = formats.sort((a, b) => (b as unknown as {audioBitrate: number}).audioBitrate - (a as unknown as {audioBitrate: number}).audioBitrate); // Bad typings
return formats.find(format => [128, 127, 120, 96, 95, 94, 93].includes(parseInt(format.itag as unknown as string, 10))); // Bad typings return formats.find(format => [128, 127, 120, 96, 95, 94, 93].includes(parseInt(format.itag as unknown as string, 10))); // Bad typings
@ -321,7 +321,13 @@ export default class {
formats = formats formats = formats
.filter(format => format.averageBitrate) .filter(format => format.averageBitrate)
.sort((a, b) => b.averageBitrate - a.averageBitrate); .sort((a, b) => {
if (a && b) {
return b.averageBitrate! - a.averageBitrate!;
}
return 0;
});
return formats.find(format => !format.bitrate) ?? formats[0]; return formats.find(format => !format.bitrate) ?? formats[0];
}; };

7565
yarn.lock

File diff suppressed because it is too large Load diff