From 2616e8171486af57879cb067b8bdeb647a1cfecf Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sun, 26 May 2019 03:11:35 +0900 Subject: [PATCH] Update webhooktool.php --- helper/webhooktool.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/helper/webhooktool.php b/helper/webhooktool.php index 82b84bc..5c27464 100644 --- a/helper/webhooktool.php +++ b/helper/webhooktool.php @@ -13,17 +13,11 @@ 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"); + $username = get_value_in_array("username", $options, "ReasonableBot"); + $message = str_replace("http", "hxxp", $message); - // 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); @@ -38,6 +32,7 @@ if(!check_function_exists("send_web_hook")) { )); } + break; case "discord":