discord-jellyfin-bot/src/commands/help.command.ts

46 lines
1.7 KiB
TypeScript
Raw Normal View History

2022-12-16 13:48:39 +01:00
import { TransformPipe } from '@discord-nestjs/common';
import { Command, DiscordCommand, UsePipes } from '@discord-nestjs/core';
import { CommandInteraction } from 'discord.js';
import { DiscordMessageService } from '../clients/discord/discord.message.service';
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)
export class HelpCommand implements DiscordCommand {
constructor(private readonly discordMessageService: DiscordMessageService) {}
2022-12-20 11:03:24 +01:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
handler(commandInteraction: CommandInteraction): GenericCustomReply {
2022-12-16 13:48:39 +01:00
return {
embeds: [
this.discordMessageService.buildMessage({
2022-12-18 19:39:03 +01:00
title: 'Jellyfin Discord Bot',
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',
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-16 13:48:39 +01:00
],
};
}
}