diff --git a/helper/webhooktool.php b/helper/webhooktool.php index 41120b8..a57ecf7 100644 --- a/helper/webhooktool.php +++ b/helper/webhooktool.php @@ -13,9 +13,17 @@ if(!check_function_exists("send_web_hook")) { function send_web_hook($message, $networkid, $options=array()) { $response = false; + + $config = get_config(); $id = get_value_in_array("id", $options, ""); $username = get_value_in_array("username", $options, "ReasonableBot"); + // get default webhook client id + if(empty($id)) { + $id = get_value_in_array(sprintf("webhook_%s_id", $network_id), $config, ""); + } + + // send message to each networks switch($networkid) { case "nateon": $request_url = sprintf("https://teamroom.nate.com/api/webhook/%s", $id);