fix title

This commit is contained in:
2026-08-03 11:51:16 +03:30
parent ec0fd28efc
commit d360539208
14 changed files with 286 additions and 53 deletions
+19 -1
View File
@@ -57,6 +57,10 @@ TXT;
*/
public function scheduleBroadcastIfEligible(): void
{
if (! $this->hasPriceChannelAccess()) {
return;
}
if (! $this->config->getBool('price_channel_enabled', false)) {
return;
}
@@ -81,6 +85,10 @@ TXT;
public function broadcastIfEligible(): void
{
try {
if (! $this->hasPriceChannelAccess()) {
return;
}
if (! $this->config->getBool('price_channel_enabled', false)) {
return;
}
@@ -202,6 +210,10 @@ TXT;
public function broadcastAfterTemplateChange(): void
{
try {
if (! $this->hasPriceChannelAccess()) {
return;
}
if (! $this->config->getBool('price_channel_enabled', false)) {
return;
}
@@ -323,7 +335,7 @@ TXT;
'selected' => $isSelected,
'has_token' => $token !== '',
'destinations' => $chatIds,
'will_send' => $isSelected && $token !== '' && $chatIds !== [],
'will_send' => $this->hasPriceChannelAccess() && $isSelected && $token !== '' && $chatIds !== [],
];
}
@@ -333,6 +345,7 @@ TXT;
$display = $trade !== null ? $this->computeDisplayPrices() : null;
return [
'access' => $this->hasPriceChannelAccess(),
'enabled' => $this->config->getBool('price_channel_enabled', false),
'selected_messengers' => $selected,
'min_seconds' => $this->config->getInt('price_channel_min_seconds', 120),
@@ -850,6 +863,11 @@ TXT;
}
/** @return array<int, string> */
private function hasPriceChannelAccess(): bool
{
return $this->config->getBool('price_channel_access', false);
}
private function parseList(string $raw): array
{
$parts = preg_split('/[,\n]+/', trim($raw)) ?: [];