Update webhooktool.php

This commit is contained in:
Namhyeon Go 2019-05-25 20:37:03 +09:00 committed by GitHub
parent bcec63fb8e
commit 793b846a43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);