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-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 ( {
title : 'a' ,
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.' ,
mixin ( embedBuilder ) {
return embedBuilder
. setAuthor ( {
name : 'Jellyfin Discord Bot' ,
iconURL :
'https://github.com/walkxcode/dashboard-icons/blob/main/png/jellyfin.png?raw=true' ,
url : 'https://github.com/manuel-rw/jellyfin-discord-music-bot' ,
} )
. 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-16 13:48:39 +01:00
] ,
} ;
}
}