function checkSecretMessage(post) {
    let isSubmission = post.constructor.name === 'Submission';

    let paragraphs = post[isSubmission ? 'selftext' : 'body'].split('\n\n');
    let firstChars = paragraphs.map((p) => p.charAt(0));
    let firstLetters = firstChars.filter((c) => {
        return c.match(/[A-Za-z0-9]/i);
    });
    let word = firstLetters.join('').toLowerCase();
    let isValidWord = words.check(word) && word.length > MIN_WORD_LENGTH;

    debug(post.author.name);
    if (isValidWord) {
        debug(`Found a secret word: ${post.id} - ${word}`);
        replyToPost(post, word);
    }
}
/**
 * Checks if a given Reddit Submission or Comment contains a "Secret Message"
 * @param  {Object} post A Snoowrap Submission or Comment to check for a secret message
 */
Checks if a given Reddit Submission or Comment contains a "Secret Message"
@param  {Object} post A Snoowrap Submission or Comment to check for a secret message
Checks if a given Reddit Submission or Comment contains a " Secret Message " @param { Object } post A Snoowrap Submission or Comment to check for a secret message
function checkSecretMessage(post) {
    let isSubmission = post.constructor.name === 'Submission';
    let paragraphs = post[isSubmission ? 'selftext' : 'body'].split('\n\n');
    let firstChars = paragraphs.map((p) => p.charAt(0));
    let firstLetters = firstChars.filter((c) => {
        return c.match(/[A-Za-z0-9]/i);
    });
    let word = firstLetters.join('').toLowerCase();
    let isValidWord = words.check(word) && word.length > MIN_WORD_LENGTH;
    debug(post.author.name);
    if (isValidWord) {
        debug(`Found a secret word: ${post.id} - ${word}`);
        replyToPost(post, word);
    }
}
function checkSecretMessage ( post ) { let isSubmission = post . constructor . name === 'Submission' ; let paragraphs = post [ isSubmission ? 'selftext' : 'body' ] . split ( '\n\n' ) ; let firstChars = paragraphs . map ( ( p ) => p . charAt ( 0 ) ) ; let firstLetters = firstChars . filter ( ( c ) => { return c . match ( / [A-Za-z0-9] / i ) ; } ) ; let word = firstLetters . join ( '' ) . toLowerCase ( ) ; let isValidWord = words . check ( word ) && word . length > MIN_WORD_LENGTH ; debug ( post . author . name ) ; if ( isValidWord ) { debug ( ` ${ post . id } ${ word } ` ) ; replyToPost ( post , word ) ; } }
Checks if a given Reddit Submission or Comment contains a "Secret Message"
 @param  {Object} post A Snoowrap Submission or Comment to check for a secret message
Checks if a given Reddit Submission or Comment contains a " Secret Message " @param { Object } post A Snoowrap Submission or Comment to check for a secret message