🚨 Fix compiler errors

This commit is contained in:
Manuel 2023-02-19 12:57:44 +01:00
parent 7a085e70cf
commit 6c75861c49
12 changed files with 5358 additions and 17130 deletions

9305
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,9 @@
import { TransformPipe } from '@discord-nestjs/common'; import { Command, DiscordCommand } from '@discord-nestjs/core';
import { Injectable } from '@nestjs/common/decorators';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { CommandInteraction } from 'discord.js'; import { CommandInteraction } from 'discord.js';
import { DiscordMessageService } from '../clients/discord/discord.message.service'; import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { DiscordVoiceService } from '../clients/discord/discord.voice.service'; import { DiscordVoiceService } from '../clients/discord/discord.voice.service';
@ -9,7 +11,7 @@ import { DiscordVoiceService } from '../clients/discord/discord.voice.service';
name: 'disconnect', name: 'disconnect',
description: 'Join your current voice channel', description: 'Join your current voice channel',
}) })
@UsePipes(TransformPipe) @Injectable()
export class DisconnectCommand implements DiscordCommand { export class DisconnectCommand implements DiscordCommand {
constructor( constructor(
private readonly discordVoiceService: DiscordVoiceService, private readonly discordVoiceService: DiscordVoiceService,

View File

@ -1,14 +1,16 @@
import { TransformPipe } from '@discord-nestjs/common'; import { Command, DiscordCommand } from '@discord-nestjs/core';
import { Injectable } from '@nestjs/common';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { CommandInteraction } from 'discord.js'; import { CommandInteraction } from 'discord.js';
import { DiscordMessageService } from '../clients/discord/discord.message.service'; import { DiscordMessageService } from '../clients/discord/discord.message.service';
@Command({ @Command({
name: 'help', name: 'help',
description: 'Get help if you're having problems with this bot', description: 'Get help if you're having problems with this bot',
}) })
@UsePipes(TransformPipe) @Injectable()
export class HelpCommand implements DiscordCommand { export class HelpCommand implements DiscordCommand {
constructor(private readonly discordMessageService: DiscordMessageService) {} constructor(private readonly discordMessageService: DiscordMessageService) {}

View File

@ -1,15 +1,17 @@
import { TransformPipe } from '@discord-nestjs/common'; import { Command, DiscordCommand } from '@discord-nestjs/core';
import { Injectable } from '@nestjs/common';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { CommandInteraction } from 'discord.js'; import { CommandInteraction } from 'discord.js';
import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { PlaybackService } from '../playback/playback.service'; import { PlaybackService } from '../playback/playback.service';
import { DiscordMessageService } from '../clients/discord/discord.message.service';
@Command({ @Command({
name: 'next', name: 'next',
description: 'Go to the next track in the playlist', description: 'Go to the next track in the playlist',
}) })
@UsePipes(TransformPipe) @Injectable()
export class SkipTrackCommand implements DiscordCommand { export class SkipTrackCommand implements DiscordCommand {
constructor( constructor(
private readonly playbackService: PlaybackService, private readonly playbackService: PlaybackService,

View File

@ -1,7 +1,9 @@
import { TransformPipe } from '@discord-nestjs/common'; import { Command, DiscordCommand } from '@discord-nestjs/core';
import { Injectable } from '@nestjs/common';
import { CommandInteraction } from 'discord.js';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { CommandInteraction, InteractionReplyOptions } from 'discord.js';
import { DiscordMessageService } from '../clients/discord/discord.message.service'; import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { DiscordVoiceService } from '../clients/discord/discord.voice.service'; import { DiscordVoiceService } from '../clients/discord/discord.voice.service';
@ -9,7 +11,7 @@ import { DiscordVoiceService } from '../clients/discord/discord.voice.service';
name: 'pause', name: 'pause',
description: 'Pause or resume the playback of the current track', description: 'Pause or resume the playback of the current track',
}) })
@UsePipes(TransformPipe) @Injectable()
export class PausePlaybackCommand implements DiscordCommand { export class PausePlaybackCommand implements DiscordCommand {
constructor( constructor(
private readonly discordVoiceService: DiscordVoiceService, private readonly discordVoiceService: DiscordVoiceService,

View File

@ -1,16 +1,15 @@
import { TransformPipe } from '@discord-nestjs/common';
import { import {
Command, Command,
DiscordTransformedCommand, DiscordTransformedCommand,
On, On,
Payload, Payload,
TransformedCommandExecutionContext, TransformedCommandExecutionContext,
UsePipes,
} from '@discord-nestjs/core'; } from '@discord-nestjs/core';
import { RemoteImageResult } from '@jellyfin/sdk/lib/generated-client/models'; import { RemoteImageResult } from '@jellyfin/sdk/lib/generated-client/models';
import { Logger } from '@nestjs/common/services'; import { Logger } from '@nestjs/common/services';
import { Injectable } from '@nestjs/common';
import { import {
ComponentType, ComponentType,
@ -37,7 +36,7 @@ import { trimStringToFixedLength } from '../utils/stringUtils/stringUtils';
name: 'play', name: 'play',
description: 'Search for an item on your Jellyfin instance', description: 'Search for an item on your Jellyfin instance',
}) })
@UsePipes(TransformPipe) @Injectable()
export class PlayItemCommand export class PlayItemCommand
implements DiscordTransformedCommand<TrackRequestDto> implements DiscordTransformedCommand<TrackRequestDto>
{ {

View File

@ -1,19 +1,21 @@
import { TransformPipe } from '@discord-nestjs/common'; import { Command, DiscordCommand } from '@discord-nestjs/core';
import { Injectable } from '@nestjs/common';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { CommandInteraction } from 'discord.js'; import { CommandInteraction } from 'discord.js';
import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { PlaybackService } from '../playback/playback.service'; import { PlaybackService } from '../playback/playback.service';
import { Constants } from '../utils/constants'; import { Constants } from '../utils/constants';
import { formatMillisecondsAsHumanReadable } from '../utils/timeUtils';
import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { chooseSuitableRemoteImageFromTrack } from '../utils/remoteImages/remoteImages'; import { chooseSuitableRemoteImageFromTrack } from '../utils/remoteImages/remoteImages';
import { trimStringToFixedLength } from '../utils/stringUtils/stringUtils'; import { trimStringToFixedLength } from '../utils/stringUtils/stringUtils';
import { formatMillisecondsAsHumanReadable } from '../utils/timeUtils';
@Command({ @Command({
name: 'playlist', name: 'playlist',
description: 'Print the current track information', description: 'Print the current track information',
}) })
@UsePipes(TransformPipe) @Injectable()
export class PlaylistCommand implements DiscordCommand { export class PlaylistCommand implements DiscordCommand {
constructor( constructor(
private readonly discordMessageService: DiscordMessageService, private readonly discordMessageService: DiscordMessageService,

View File

@ -1,15 +1,17 @@
import { TransformPipe } from '@discord-nestjs/common'; import { Command, DiscordCommand } from '@discord-nestjs/core';
import { Injectable } from '@nestjs/common/decorators';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { CommandInteraction } from 'discord.js'; import { CommandInteraction } from 'discord.js';
import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { PlaybackService } from '../playback/playback.service'; import { PlaybackService } from '../playback/playback.service';
import { DiscordMessageService } from '../clients/discord/discord.message.service';
@Command({ @Command({
name: 'previous', name: 'previous',
description: 'Go to the previous track', description: 'Go to the previous track',
}) })
@UsePipes(TransformPipe) @Injectable()
export class PreviousTrackCommand implements DiscordCommand { export class PreviousTrackCommand implements DiscordCommand {
constructor( constructor(
private readonly playbackService: PlaybackService, private readonly playbackService: PlaybackService,

View File

@ -1,25 +1,26 @@
import { TransformPipe } from '@discord-nestjs/common';
import { import {
Command, Command,
DiscordCommand, DiscordCommand,
InjectDiscordClient, InjectDiscordClient,
UsePipes,
} from '@discord-nestjs/core'; } from '@discord-nestjs/core';
import { getSystemApi } from '@jellyfin/sdk/lib/utils/api/system-api';
import { Injectable } from '@nestjs/common';
import { Client, CommandInteraction, Status } from 'discord.js'; import { Client, CommandInteraction, Status } from 'discord.js';
import { formatDuration, intervalToDuration } from 'date-fns'; import { formatDuration, intervalToDuration } from 'date-fns';
import { Constants } from '../utils/constants';
import { DiscordMessageService } from '../clients/discord/discord.message.service'; import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { JellyfinService } from '../clients/jellyfin/jellyfin.service'; import { JellyfinService } from '../clients/jellyfin/jellyfin.service';
import { Constants } from '../utils/constants';
import { getSystemApi } from '@jellyfin/sdk/lib/utils/api/system-api';
@Command({ @Command({
name: 'status', name: 'status',
description: 'Display the current status for troubleshooting', description: 'Display the current status for troubleshooting',
}) })
@UsePipes(TransformPipe) @Injectable()
export class StatusCommand implements DiscordCommand { export class StatusCommand implements DiscordCommand {
constructor( constructor(
@InjectDiscordClient() @InjectDiscordClient()

View File

@ -1,16 +1,18 @@
import { TransformPipe } from '@discord-nestjs/common'; import { Command, DiscordCommand } from '@discord-nestjs/core';
import { Injectable } from '@nestjs/common';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { CommandInteraction } from 'discord.js'; import { CommandInteraction } from 'discord.js';
import { PlaybackService } from '../playback/playback.service';
import { DiscordMessageService } from '../clients/discord/discord.message.service'; import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { DiscordVoiceService } from '../clients/discord/discord.voice.service'; import { DiscordVoiceService } from '../clients/discord/discord.voice.service';
import { PlaybackService } from '../playback/playback.service';
@Command({ @Command({
name: 'stop', name: 'stop',
description: 'Stop playback entirely and clear the current playlist', description: 'Stop playback entirely and clear the current playlist',
}) })
@UsePipes(TransformPipe) @Injectable()
export class StopPlaybackCommand implements DiscordCommand { export class StopPlaybackCommand implements DiscordCommand {
constructor( constructor(
private readonly playbackService: PlaybackService, private readonly playbackService: PlaybackService,

View File

@ -1,8 +1,9 @@
import { TransformPipe } from '@discord-nestjs/common'; import { Command, DiscordCommand } from '@discord-nestjs/core';
import { Injectable, Logger } from '@nestjs/common';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { Logger } from '@nestjs/common';
import { CommandInteraction, GuildMember } from 'discord.js'; import { CommandInteraction, GuildMember } from 'discord.js';
import { DiscordMessageService } from '../clients/discord/discord.message.service'; import { DiscordMessageService } from '../clients/discord/discord.message.service';
import { DiscordVoiceService } from '../clients/discord/discord.voice.service'; import { DiscordVoiceService } from '../clients/discord/discord.voice.service';
@ -10,7 +11,7 @@ import { DiscordVoiceService } from '../clients/discord/discord.voice.service';
name: 'summon', name: 'summon',
description: 'Join your current voice channel', description: 'Join your current voice channel',
}) })
@UsePipes(TransformPipe) @Injectable()
export class SummonCommand implements DiscordCommand { export class SummonCommand implements DiscordCommand {
private readonly logger = new Logger(SummonCommand.name); private readonly logger = new Logger(SummonCommand.name);

13086
yarn.lock

File diff suppressed because it is too large Load Diff