{"size": 1443, "ext": "js", "max_stars_repo_path": "commands/Fun/lmgtfy.js", "max_stars_repo_name": "512mb-xyz/512mb-Discord-Bot", "max_stars_repo_stars_event_min_datetime": "2020-10-16T10:45:52.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-10T01:35:07.000Z", "max_issues_repo_path": "commands/Fun/lmgtfy.js", "max_issues_repo_name": "512mb-xyz/512mb-Discord-Bot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "commands/Fun/lmgtfy.js", "max_forks_repo_name": "512mb-xyz/512mb-Discord-Bot", "max_forks_repo_forks_event_min_datetime": "2020-10-24T08:22:26.000Z", "max_forks_repo_forks_event_max_datetime": "2020-10-24T08:22:26.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 35.1951219512, "max_line_length": 122, "alphanum_fraction": 0.5051975052}
const { Command } = require('discord-akairo');
const { MessageEmbed } = require('discord.js');

class lmgtfyCommand extends Command {
    constructor() {
        super('lmgtfy', {
            aliases: ['lmgtfy'],
            description: 'Lmgtfy-ies a query.',
            description: {
                content: 'Lmgtfy-ies a query.',
                usage: '.lmgtfy < Query >',
                examples: '.lmgtfy How do I not ask stupid questions in chat?'
            },
            args: [
                {
                    id: 'lmgtfyQuery',
                    type: 'string',
                    match: 'content',
                    default: null
                }
            ]
        });
    }

    async exec(message, args) {
        if (args.lmgtfyQuery === null) {
            message.channel.send(`${message.author} Please provide a query to Lmgtfy!`);
        } else {
            let lmgtfyQuery = encodeURI(args.lmgtfyQuery);
            const lmgtfyEmbed = new MessageEmbed()
                .setColor(this.client.constants.EMBED_COLOR)
                .setTitle(`Lmgtfy-ied ${args.lmgtfyQuery}`)
                .setURL(`https://lmgtfy.app/?q=${lmgtfyQuery}&iie=1`)
                .setFooter(`Requested by ${message.author.tag} (${message.author.id})`, message.author.displayAvatarURL())
                .setTimestamp()
            message.channel.send(lmgtfyEmbed);
        }
    }
};

module.exports = lmgtfyCommand;