mirror of
https://github.com/informaticker/discord-jellyfin-bot.git
synced 2024-11-25 02:51:57 +01:00
♻️ Fix code smells (#231)
This commit is contained in:
parent
bf1acb121b
commit
36ba5143db
@ -1,7 +1,7 @@
|
|||||||
import { DiscordModule } from '@discord-nestjs/core';
|
import { DiscordModule } from '@discord-nestjs/core';
|
||||||
|
|
||||||
import { Logger, Module, OnModuleInit } from '@nestjs/common';
|
import { Logger, Module, OnModuleInit } from '@nestjs/common';
|
||||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
import { ConfigModule } from '@nestjs/config';
|
||||||
import { EventEmitterModule } from '@nestjs/event-emitter';
|
import { EventEmitterModule } from '@nestjs/event-emitter';
|
||||||
import { ScheduleModule } from '@nestjs/schedule';
|
import { ScheduleModule } from '@nestjs/schedule';
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { CollectorInterceptor, SlashCommandPipe } from '@discord-nestjs/common';
|
import { CollectorInterceptor, SlashCommandPipe } from '@discord-nestjs/common';
|
||||||
import {
|
import {
|
||||||
AppliedCollectors,
|
|
||||||
Command,
|
Command,
|
||||||
Handler,
|
Handler,
|
||||||
IA,
|
IA,
|
||||||
@ -13,11 +12,9 @@ import { Injectable, Logger, UseInterceptors } from '@nestjs/common';
|
|||||||
import {
|
import {
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
ButtonBuilder,
|
ButtonBuilder,
|
||||||
ButtonInteraction,
|
|
||||||
ButtonStyle,
|
ButtonStyle,
|
||||||
CommandInteraction,
|
CommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
InteractionCollector,
|
|
||||||
InteractionReplyOptions,
|
InteractionReplyOptions,
|
||||||
InteractionUpdateOptions,
|
InteractionUpdateOptions,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
@ -33,10 +30,10 @@ import {
|
|||||||
|
|
||||||
import { Interval } from '@nestjs/schedule';
|
import { Interval } from '@nestjs/schedule';
|
||||||
import { lightFormat } from 'date-fns';
|
import { lightFormat } from 'date-fns';
|
||||||
|
import { defaultMemberPermissions } from 'src/utils/environment';
|
||||||
import { PlaylistInteractionCollector } from './playlist.interaction-collector';
|
import { PlaylistInteractionCollector } from './playlist.interaction-collector';
|
||||||
import { PlaylistCommandParams } from './playlist.params';
|
import { PlaylistCommandParams } from './playlist.params';
|
||||||
import { PlaylistTempCommandData } from './playlist.types';
|
import { PlaylistTempCommandData } from './playlist.types';
|
||||||
import { defaultMemberPermissions } from 'src/utils/environment';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@Command({
|
@Command({
|
||||||
@ -59,7 +56,6 @@ export class PlaylistCommand {
|
|||||||
async handler(
|
async handler(
|
||||||
@InteractionEvent(SlashCommandPipe) dto: PlaylistCommandParams,
|
@InteractionEvent(SlashCommandPipe) dto: PlaylistCommandParams,
|
||||||
@IA() interaction: CommandInteraction,
|
@IA() interaction: CommandInteraction,
|
||||||
@AppliedCollectors(0) collector: InteractionCollector<ButtonInteraction>,
|
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const page = dto.page ?? 0;
|
const page = dto.page ?? 0;
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ export class SearchHint {
|
|||||||
return `🎵 ${this.name}`;
|
return `🎵 ${this.name}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
async toTracks(searchService: JellyfinSearchService): Promise<Track[]> {
|
async toTracks(searchService: JellyfinSearchService): Promise<Track[]> {
|
||||||
return [new Track(this.id, this.name, this.runtimeInMilliseconds, {})];
|
return [new Track(this.id, this.name, this.runtimeInMilliseconds, {})];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { EventEmitter2, OnEvent } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
|
|
||||||
import { Track } from './Track';
|
import { Track } from './Track';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user