diff --git a/src/discord/commands/index.ts b/src/discord/commands/index.ts index b59b8650..f1d089c0 100644 --- a/src/discord/commands/index.ts +++ b/src/discord/commands/index.ts @@ -1,6 +1,5 @@ import ping from './ping' -import pdf from './pdf' import pdfs from './pdfs' import parse from './parse' -export default [ping, pdf, pdfs, parse] +export default [ping, pdfs, parse] diff --git a/src/discord/commands/pdf.ts b/src/discord/commands/pdf.ts deleted file mode 100644 index d7e55ff9..00000000 --- a/src/discord/commands/pdf.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { - ChatInputCommandInteraction, - SlashCommandBuilder, - TextChannel, -} from 'discord.js' -import { downloadPDF } from '../../queues' -import discord from '../../discord' - -export default { - data: new SlashCommandBuilder() - .setName('pdf') - .addStringOption((option) => - option.setName('url').setDescription('URL to PDF file').setRequired(true) - ) - .setDescription( - 'Skicka in en årsredovisning och få tillbaka utsläppsdata.' - ), - - async execute(interaction: ChatInputCommandInteraction) { - console.log('pdf') - const url = interaction.options.getString('url') - if (!url) { - await interaction.followUp({ - content: 'No url provided. Try again with /pdf ', - ephemeral: true, - }) - - return - } - const message = await interaction.reply({ - content: `Tack! Nu är din årsredovisning placerad i kö: -${url}`, - }) - - const thread = await discord.createThread( - { - channelId: interaction.channel.id, - messageId: message.id, - }, - 'pdf' - ) - /*thread.send({ - content: `Tack! Nu är din årsredovisning placerad i kö: - ${url}`, - })*/ - - const threadId = thread.id - - downloadPDF.add('download pdf ' + url.slice(-20), { - url, - threadId, - }) - }, -}