- Everywhere on the website "Legion" instead of "Gilde" (Legionsleitung, Legionsmitglieder, ...) - Link buttons keep their text color on hover (previously gold on gold, e.g. "Zum Lumishop") - Sidebar: scrollbar hairline-thin and only visible on hover, menu more compact on low screens - Activity check: bot color #206694 is the first entry of the palette and the default Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
37 lines
1.4 KiB
PHP
37 lines
1.4 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/events_api.php';
|
|
|
|
/**
|
|
* Aktivitaetschecks des Discord-Bots (/api/activity-checks, cogs/activity.py im Bot).
|
|
* Der Bot postet die Nachricht mit den Buttons "Ich bin da" / "Ich bin nicht da", sammelt die
|
|
* Antworten und fuehrt beim Abschluss die Folgen aus - die Website legt Checks an, zeigt sie an
|
|
* und kann sie vorzeitig beenden.
|
|
*
|
|
* @param array<string, mixed> $queryParams
|
|
* @param array<string, mixed>|null $jsonBody
|
|
* @return array<string, mixed>
|
|
* @throws RuntimeException
|
|
*/
|
|
function activity_api_request(string $method, string $path = '', array $queryParams = [], ?array $jsonBody = null): array
|
|
{
|
|
$base = preg_replace('#/raids$#', '', raids_api_config()['url']);
|
|
|
|
return bot_api_request($method, $base . '/activity-checks' . $path, $queryParams, $jsonBody, 'Aktivitätscheck-API');
|
|
}
|
|
|
|
/** Farben zur schnellen Auswahl (Discord-Embed-Farbe links am Rand). */
|
|
const ACTIVITY_COLORS = [
|
|
'#206694' => 'Botfarbe',
|
|
'#c9a227' => 'Gold',
|
|
'#5865f2' => 'Blurple',
|
|
'#3ba55d' => 'Grün',
|
|
'#ed4245' => 'Rot',
|
|
'#f0b232' => 'Orange',
|
|
'#9b59b6' => 'Lila',
|
|
'#1abc9c' => 'Türkis',
|
|
];
|
|
|
|
const ACTIVITY_DEFAULT_DM = 'Hallo {name}! Du hast dich beim Aktivitätscheck **{titel}** auf **{server}** nicht zurückgemeldet. '
|
|
. 'Melde dich bitte bei der Legionsleitung, wenn du weiterhin dabei sein möchtest.';
|