diff options
Diffstat (limited to 'api/pluralkit-integration.php')
-rw-r--r-- | api/pluralkit-integration.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/api/pluralkit-integration.php b/api/pluralkit-integration.php index 0bc5d23..6d1166c 100644 --- a/api/pluralkit-integration.php +++ b/api/pluralkit-integration.php @@ -93,6 +93,36 @@ if ($input["type"] === "CREATE_SWITCH" || $input["type"] === "UPDATE_SWITCH" || if ($system === "gdapd") { $topic = "public-switches-raindrops"; + + if (count($fronters["members"]) > 0) { + file_get_contents('https://' . $ntfy["server"] . '/public-switches-fr', false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 $name vient de switch\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Voir sur Cold Haze, https://fr.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " est désormais au front" + ] + ])); + } else { + file_get_contents('https://' . $ntfy["server"] . '/public-switches-fr', false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 $name vient de switch\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Voir sur Cold Haze, https://fr.equestria.horse/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "Le poney de trait est désormais au front" + ] + ])); + } } else { $topic = "public-switches-cloudburst"; } |