2022-12-16 13:48:39 +01:00
import { TransformPipe } from '@discord-nestjs/common' ;
2022-12-17 17:56:55 +01:00
import { Command , DiscordCommand , UsePipes } from '@discord-nestjs/core' ;
import { CommandInteraction } from 'discord.js' ;
2022-12-17 20:51:03 +01:00
import { DiscordMessageService } from '../clients/discord/discord.message.service' ;
2022-12-17 17:56:55 +01:00
import { GenericCustomReply } from '../models/generic-try-handler' ;
2022-12-16 13:48:39 +01:00
@Command ( {
name : 'help' ,
2022-12-16 14:15:32 +01:00
description : 'Get help if you're having problems with this bot' ,
2022-12-16 13:48:39 +01:00
} )
@UsePipes ( TransformPipe )
2022-12-17 17:56:55 +01:00
export class HelpCommand implements DiscordCommand {
2022-12-17 20:51:03 +01:00
constructor ( private readonly discordMessageService : DiscordMessageService ) { }
2022-12-20 11:03:24 +01:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2022-12-17 17:56:55 +01:00
handler ( commandInteraction : CommandInteraction ) : GenericCustomReply {
2022-12-16 13:48:39 +01:00
return {
embeds : [
2022-12-17 20:51:03 +01:00
this . discordMessageService . buildMessage ( {
2022-12-18 19:39:03 +01:00
title : 'Jellyfin Discord Bot' ,
2022-12-17 20:51:03 +01:00
description :
'Jellyfin Discord Bot is an open source and self-hosted Discord bot, that integrates with your Jellyfin Media server and enables you to playback music from your libraries. You can use the Discord Slash Commands to invoke bot commands.' ,
2022-12-18 19:39:03 +01:00
authorUrl : 'https://github.com/manuel-rw/jellyfin-discord-music-bot' ,
2022-12-17 20:51:03 +01:00
mixin ( embedBuilder ) {
2022-12-18 19:39:03 +01:00
return embedBuilder . addFields ( [
{
name : 'Report an issue' ,
value :
'https://github.com/manuel-rw/jellyfin-discord-music-bot/issues/new/choose' ,
inline : true ,
} ,
{
name : 'Source code' ,
value :
'https://github.com/manuel-rw/jellyfin-discord-music-bot' ,
inline : true ,
} ,
] ) ;
2022-12-17 20:51:03 +01:00
} ,
} ) ,
2022-12-16 13:48:39 +01:00
] ,
} ;
}
}