adding telegram notifications
Deploy / deploy (push) Successful in 8s

This commit is contained in:
2026-05-06 18:25:15 +02:00
parent 08df9bfe5c
commit e203aac2f5
5 changed files with 177 additions and 1 deletions
+14 -1
View File
@@ -239,12 +239,25 @@ class Repository
}
public function setAllowedUserTokens(array $tokens): void
{
$this->setConfig('allowed_user_tokens', json_encode(array_values($tokens)));
}
public function getConfig(string $key, mixed $default = null): mixed
{
$stmt = $this->db->pdo()->prepare("SELECT value FROM config WHERE key = ?");
$stmt->execute([$key]);
$row = $stmt->fetch();
return $row ? $row['value'] : $default;
}
public function setConfig(string $key, string $value): void
{
$stmt = $this->db->pdo()->prepare(
"INSERT INTO config (key, value) VALUES (?, ?)
ON CONFLICT(key) DO UPDATE SET value = excluded.value"
);
$stmt->execute(['allowed_user_tokens', json_encode(array_values($tokens))]);
$stmt->execute([$key, $value]);
}
// --- Rate Limiting ---