{"size": 1124, "ext": "js", "max_stars_repo_path": "dist/commands/links.js", "max_stars_repo_name": "ItsSilvie/bot", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/commands/links.js", "max_issues_repo_name": "ItsSilvie/bot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/commands/links.js", "max_forks_repo_name": "ItsSilvie/bot", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.1142857143, "max_line_length": 73, "alphanum_fraction": 0.5106761566}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const links_1 = require("../data/links");
const command = {
    name: 'links',
    generator: (subcommand) => {
        return subcommand
            .setName(command.name)
            .setDescription('Returns a chosen Grand Archive URL.')
            .addStringOption(option => {
            links_1.default.forEach(({ name }) => {
                option.addChoice(name, name);
            });
            return option
                .setName('to')
                .setDescription('What link would you like?')
                .setRequired(true);
        });
    },
    handler: async (interaction) => {
        const topic = interaction.options.getString('to');
        const match = links_1.default.find(({ name }) => name === topic);
        if (!match) {
            return interaction.reply({
                content: 'I can\'t find that help topic.',
            });
        }
        const { url, name, } = match;
        return interaction.reply({
            content: `${name}: ${url}`,
        });
    },
};
exports.default = command;
