generateResponse(message, this_command, undo_command, start, end, reason) {
        //Create some helpers and ensure needed parts:
        var friendlyStart = dateTools.makeFriendlyDates(start);
        var friendlyStartUndo = format(new Date(start + offset), 'MMM dd');
        //Make certain there's an end value.
        if (!end) {
            end = start;
        }
        var friendlyEnd = dateTools.makeFriendlyDates(end);
        var friendlyEndUndo = format(new Date(end + offset), 'MMM dd');
        //Select the appropriate type of response, and shorten if it's a single day.
        if (message.channel.type === 'DM') {
            if (start != end) {
                message.reply(`Ok, I've marked you ${this_command} from ${friendlyStart} until ${friendlyEnd}.  \n\nTo undo this, type: !${undo_command} ${friendlyStartUndo} ${friendlyEndUndo} `);
            } else {
                message.reply(`Ok, I've marked you ${this_command} on ${friendlyStart}.  \n\nTo undo this, type: !${undo_command} ${friendlyStartUndo}`);
            }
        } else {
            if (start != end) {
                message.member.send(`Ok, I've marked you ${this_command} from ${friendlyStart} until ${friendlyEnd}.  \n\nTo undo this, type: !${undo_command} ${friendlyStartUndo} ${friendlyEndUndo} `);
            } else {
                message.member.send(`Ok, I've marked you ${this_command} on ${friendlyStart}.  \n\nTo undo this, type: !${undo_command} ${friendlyStartUndo}`);
            }
        }
        //Handle channel posts for absences and lates. Shorten if only a single day.
        if (this_command === 'absent') {
            if (start != end) {
                client.channels.cache.get(`${process.env.attendance_channel}`).send(`${message.author.username} will be absent from ${friendlyStart} until ${friendlyEnd}. They commented: ${reason}`);
            } else {
                client.channels.cache.get(`${process.env.attendance_channel}`).send(`${message.author.username} will be absent on ${friendlyStart}. They commented: ${reason}`);
            }
        }
        if (this_command === 'late') {
            if (start != end) {
                client.channels.cache.get(`${process.env.attendance_channel}`).send(`${message.author.username} will be late to raid from ${friendlyStart} until ${friendlyEnd}. They commented: ${reason}`);
            } else {
                client.channels.cache.get(`${process.env.attendance_channel}`).send(`${message.author.username} will be late on ${friendlyStart}. They commented: ${reason}`);
            }

        }
    }
//command generateResponse for notifying the user of what has been done.
command generateResponse for notifying the user of what has been done.
command generateResponse for notifying the user of what has been done .
generateResponse(message, this_command, undo_command, start, end, reason) {
        var friendlyStart = dateTools.makeFriendlyDates(start);
        var friendlyStartUndo = format(new Date(start + offset), 'MMM dd');
        if (!end) {
            end = start;
        }
        var friendlyEnd = dateTools.makeFriendlyDates(end);
        var friendlyEndUndo = format(new Date(end + offset), 'MMM dd');
        if (message.channel.type === 'DM') {
            if (start != end) {
                message.reply(`Ok, I've marked you ${this_command} from ${friendlyStart} until ${friendlyEnd}.  \n\nTo undo this, type: !${undo_command} ${friendlyStartUndo} ${friendlyEndUndo} `);
            } else {
                message.reply(`Ok, I've marked you ${this_command} on ${friendlyStart}.  \n\nTo undo this, type: !${undo_command} ${friendlyStartUndo}`);
            }
        } else {
            if (start != end) {
                message.member.send(`Ok, I've marked you ${this_command} from ${friendlyStart} until ${friendlyEnd}.  \n\nTo undo this, type: !${undo_command} ${friendlyStartUndo} ${friendlyEndUndo} `);
            } else {
                message.member.send(`Ok, I've marked you ${this_command} on ${friendlyStart}.  \n\nTo undo this, type: !${undo_command} ${friendlyStartUndo}`);
            }
        }
        if (this_command === 'absent') {
            if (start != end) {
                client.channels.cache.get(`${process.env.attendance_channel}`).send(`${message.author.username} will be absent from ${friendlyStart} until ${friendlyEnd}. They commented: ${reason}`);
            } else {
                client.channels.cache.get(`${process.env.attendance_channel}`).send(`${message.author.username} will be absent on ${friendlyStart}. They commented: ${reason}`);
            }
        }
        if (this_command === 'late') {
            if (start != end) {
                client.channels.cache.get(`${process.env.attendance_channel}`).send(`${message.author.username} will be late to raid from ${friendlyStart} until ${friendlyEnd}. They commented: ${reason}`);
            } else {
                client.channels.cache.get(`${process.env.attendance_channel}`).send(`${message.author.username} will be late on ${friendlyStart}. They commented: ${reason}`);
            }
        }
    }
generateResponse ( message , this_command , undo_command , start , end , reason ) { var friendlyStart = dateTools . makeFriendlyDates ( start ) ; var friendlyStartUndo = format ( new Date ( start + offset ) , 'MMM dd' ) ; if ( ! end ) { end = start ; } var friendlyEnd = dateTools . makeFriendlyDates ( end ) ; var friendlyEndUndo = format ( new Date ( end + offset ) , 'MMM dd' ) ; if ( message . channel . type === 'DM' ) { if ( start != end ) { message . reply ( ` ${ this_command } ${ friendlyStart } ${ friendlyEnd } \n \n ${ undo_command } ${ friendlyStartUndo } ${ friendlyEndUndo } ` ) ; } else { message . reply ( ` ${ this_command } ${ friendlyStart } \n \n ${ undo_command } ${ friendlyStartUndo } ` ) ; } } else { if ( start != end ) { message . member . send ( ` ${ this_command } ${ friendlyStart } ${ friendlyEnd } \n \n ${ undo_command } ${ friendlyStartUndo } ${ friendlyEndUndo } ` ) ; } else { message . member . send ( ` ${ this_command } ${ friendlyStart } \n \n ${ undo_command } ${ friendlyStartUndo } ` ) ; } } if ( this_command === 'absent' ) { if ( start != end ) { client . channels . cache . get ( ` ${ process . env . attendance_channel } ` ) . send ( ` ${ message . author . username } ${ friendlyStart } ${ friendlyEnd } ${ reason } ` ) ; } else { client . channels . cache . get ( ` ${ process . env . attendance_channel } ` ) . send ( ` ${ message . author . username } ${ friendlyStart } ${ reason } ` ) ; } } if ( this_command === 'late' ) { if ( start != end ) { client . channels . cache . get ( ` ${ process . env . attendance_channel } ` ) . send ( ` ${ message . author . username } ${ friendlyStart } ${ friendlyEnd } ${ reason } ` ) ; } else { client . channels . cache . get ( ` ${ process . env . attendance_channel } ` ) . send ( ` ${ message . author . username } ${ friendlyStart } ${ reason } ` ) ; } } }
command generateResponse for notifying the user of what has been done.
command generateResponse for notifying the user of what has been done .
//Create some helpers and ensure needed parts: //Make certain there's an end value. //Select the appropriate type of response, and shorten if it's a single day. //Handle channel posts for absences and lates. Shorten if only a single day.