<commit_before>import { getImage } from '../../helpers';
import { ICommand, ICommandDetail, ICommandParameters, IImage } from '../../interfaces';
import * as _ from 'lodash';

export class Silly implements ICommand {
    private static instance: Silly;
    private commandDetails: Array<ICommandDetail>;

    public static getInstance(): Silly {
        return this.instance || (this.instance = new Silly());
    }

    public execute(params: ICommandParameters): void {
        if (params.processedCommand.parameter === 'citizens') {
            params.msg.channel.sendMessage(this.citizens(params.msg.guild.name), { disable_everyone: false });
        } else {
            getImage(params);
        }
    }

    private citizens(guild: string): string {
        let rhonin = `@everyone CITIZENS OF ${guild.toUpperCase()}!

Raise your eyes to the skies and observe! Today our world's destruction has been averted in defiance of our very makers!

Algalon the Observer, herald of the titans, has been defeated by our brave comrades in the depths of the titan city of Ulduar.

Algalon was sent here to judge the fate of our world. He found a planet whose races had deviated from the titans' blueprints. A planet where not everything had gone according to plan.

Cold logic deemed our world not worth saving. Cold logic, however, does not account for the power of free will. It's up to each of us to prove this is a world worth saving. That our lives... our lives are worth living.`;

        return rhonin;
    }

    public getCommandDetails(images: Array<IImage>): Array<ICommandDetail> {
        this.commandDetails = [{
            command: 'silly',
            description: 'Rhonin has something to tell you!',
            parameters: ['citizens'],
        }];

        _.forEach(images, (image: IImage) => {<commit_msg>Fixed citizens command to not crash app if used in a dm.<commit_after>import { getImage } from '../../helpers';
import { ICommand, ICommandDetail, ICommandParameters, IImage } from '../../interfaces';
import * as _ from 'lodash';

export class Silly implements ICommand {
    private static instance: Silly;
    private commandDetails: Array<ICommandDetail>;

    public static getInstance(): Silly {
        return this.instance || (this.instance = new Silly());
    }

    public execute(params: ICommandParameters): void {
        if (params.processedCommand.parameter === 'citizens') {
            if (params.msg.channel.type === 'text') {
                params.msg.channel.sendMessage(this.citizens(params.msg.guild.name), { disable_everyone: false });
            } else {
                params.msg.channel.sendMessage('Message can only be sent in a guild text channel.');
            }
        } else {
            getImage(params);
        }
    }

    private citizens(guild: string): string {
        let rhonin = `@everyone CITIZENS OF ${guild.toUpperCase()}!

Raise your eyes to the skies and observe! Today our world's destruction has been averted in defiance of our very makers!

Algalon the Observer, herald of the titans, has been defeated by our brave comrades in the depths of the titan city of Ulduar.

Algalon was sent here to judge the fate of our world. He found a planet whose races had deviated from the titans' blueprints. A planet where not everything had gone according to plan.

Cold logic deemed our world not worth saving. Cold logic, however, does not account for the power of free will. It's up to each of us to prove this is a world worth saving. That our lives... our lives are worth living.`;

        return rhonin;
    }

    public getCommandDetails(images: Array<IImage>): Array<ICommandDetail> {
        this.commandDetails = [{
            command: 'silly',
            description: 'Rhonin has something to tell you!',
            parameters: ['citizens'],
        }];

        _.forEach(images, (image: IImage) => {
{'fraction_non_alphanumeric': 0.09425701776976564, 'fraction_numerical': 0.0, 'mean_word_length': 2.967313585291113, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '942757', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1018, 'n_words': 421}