{"size": 843, "ext": "js", "max_stars_repo_path": "external/discordWH.js", "max_stars_repo_name": "idivait/gw2-discord-logs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "external/discordWH.js", "max_issues_repo_name": "idivait/gw2-discord-logs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "external/discordWH.js", "max_forks_repo_name": "idivait/gw2-discord-logs", "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": 23.4166666667, "max_line_length": 51, "alphanum_fraction": 0.5634638197}
/***
 * Discord Webhook Structure POST
 * {
 *  content: Message content(string),
 *  OR
 *  file: Message contents as file (file contents)
 *  OR
 *  embeds: Array of embed objects 
 *  username: Override default username(string),
 *  avatar_url: Override default icon(string),
 *  tts: true if tts (bool)
 * }
 */
let request = require('request');

// Takes the mesage and posts it to the kickchannel
module.exports = (messages, channel)=>{
    //Local vars
    let post = {
        content: 'No message to send',
        username: 'Kickbot'
    };
    
    for (let message of messages) {
        post.content = message;
        request({
            url: channel,
            method: "POST",
            headers: {
                "content-type": "application/json"
            },
            body: JSON.stringify(post)
        })
    }
}
