Telegram neu organisiert
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
function telegramServiceFooter(): string
|
||||
{
|
||||
return 'Ein Service des Astronomiemuseums der Sternwarte Sonneberg';
|
||||
}
|
||||
|
||||
function appendTelegramServiceFooter(string $text): string
|
||||
{
|
||||
$footer = telegramServiceFooter();
|
||||
$trimmedText = trim($text);
|
||||
|
||||
if ($trimmedText === '') {
|
||||
return $footer;
|
||||
}
|
||||
|
||||
if (str_contains($trimmedText, $footer)) {
|
||||
return $trimmedText;
|
||||
}
|
||||
|
||||
return $trimmedText . "\n\n" . $footer;
|
||||
}
|
||||
Reference in New Issue
Block a user