fix: button always shows DEFAULT_BUTTON_TEXT when field is null/empty
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user