fix: button always shows DEFAULT_BUTTON_TEXT when field is null/empty

This commit is contained in:
Nik (Claude)
2026-06-16 21:14:57 +03:00
parent 5852b9f439
commit d9cbbc5fbf
2 changed files with 81 additions and 3 deletions
+1 -3
View File
@@ -75,9 +75,7 @@ async function publishToTelegram({ channel, text, photoUrl, article }) {
const base = await settings.get('TELEGRAM_API_BASE', 'https://api.telegram.org');
// Inline-кнопка — только если есть статья и кнопка не отключена
const buttonText = channel.auto_publish_button_text === null
? null
: (channel.auto_publish_button_text || DEFAULT_BUTTON_TEXT);
const buttonText = channel.auto_publish_button_text || DEFAULT_BUTTON_TEXT;
let reply_markup = undefined;
if (article && buttonText) {
reply_markup = {