From 02611f2ae1722a93f05f80d94a0f6820b4e4ea0f Mon Sep 17 00:00:00 2001 From: Federico Rapetti Date: Sat, 4 Mar 2023 22:40:26 +0100 Subject: [PATCH] Fix all lint errors (#909) Co-authored-by: Max Isom --- CHANGELOG.md | 1 + src/bot.ts | 4 +--- src/services/add-query-to-queue.ts | 1 + src/services/get-songs.ts | 6 ++---- src/services/youtube-api.ts | 5 +---- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7aa1c1..043e996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Fixed +- Fixed all lint errors - Create the guild settings when not found instead of returning an error - Add temporary workaround to avoid VoiceConnection being stuck in signalling state diff --git a/src/bot.ts b/src/bot.ts index 596c54e..949d9f0 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -23,9 +23,7 @@ export default class { private readonly commandsByName!: Collection; private readonly commandsByButtonId!: Collection; - constructor( - @inject(TYPES.Client) client: Client, - @inject(TYPES.Config) config: Config) { + constructor(@inject(TYPES.Client) client: Client, @inject(TYPES.Config) config: Config) { this.client = client; this.config = config; this.shouldRegisterCommandsOnBot = config.REGISTER_COMMANDS_ON_BOT; diff --git a/src/services/add-query-to-queue.ts b/src/services/add-query-to-queue.ts index dc972cd..b5367a2 100644 --- a/src/services/add-query-to-queue.ts +++ b/src/services/add-query-to-queue.ts @@ -1,5 +1,6 @@ /* eslint-disable complexity */ import {ChatInputCommandInteraction, GuildMember} from 'discord.js'; +import {URL} from 'node:url'; import {inject, injectable} from 'inversify'; import shuffle from 'array-shuffle'; import {TYPES} from '../types.js'; diff --git a/src/services/get-songs.ts b/src/services/get-songs.ts index fbb4937..1c68e7e 100644 --- a/src/services/get-songs.ts +++ b/src/services/get-songs.ts @@ -1,6 +1,6 @@ import {inject, injectable} from 'inversify'; import * as spotifyURI from 'spotify-uri'; -import {SongMetadata, QueuedPlaylist, MediaSource} from '../services/player.js'; +import {SongMetadata, QueuedPlaylist, MediaSource} from './player'; import {TYPES} from '../types.js'; import ffmpeg from 'fluent-ffmpeg'; import YoutubeAPI from './youtube-api.js'; @@ -11,9 +11,7 @@ export default class { private readonly youtubeAPI: YoutubeAPI; private readonly spotifyAPI: SpotifyAPI; - constructor( - @inject(TYPES.Services.YoutubeAPI) youtubeAPI: YoutubeAPI, - @inject(TYPES.Services.SpotifyAPI) spotifyAPI: SpotifyAPI) { + constructor(@inject(TYPES.Services.YoutubeAPI) youtubeAPI: YoutubeAPI, @inject(TYPES.Services.SpotifyAPI) spotifyAPI: SpotifyAPI) { this.youtubeAPI = youtubeAPI; this.spotifyAPI = spotifyAPI; } diff --git a/src/services/youtube-api.ts b/src/services/youtube-api.ts index 01a29dc..d2528d4 100644 --- a/src/services/youtube-api.ts +++ b/src/services/youtube-api.ts @@ -29,10 +29,7 @@ export default class { private readonly ytsrQueue: PQueue; - constructor( - @inject(TYPES.ThirdParty) thirdParty: ThirdParty, - @inject(TYPES.Config) config: Config, - @inject(TYPES.KeyValueCache) cache: KeyValueCacheProvider) { + constructor(@inject(TYPES.ThirdParty) thirdParty: ThirdParty, @inject(TYPES.Config) config: Config, @inject(TYPES.KeyValueCache) cache: KeyValueCacheProvider) { this.youtube = thirdParty.youtube; this.youtubeKey = config.YOUTUBE_API_KEY; this.cache = cache;