fix(telegram): reply to /start only in private chats #100
Reference in New Issue
Block a user
Delete Branch "feature/telegram-private-reply-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix the
BUTTON_TYPE_INVALIDthe main bot logged on group messages.Since the bot became an admin in the moderated discussion group (and
allowed_updatesincludesmessage), it receives the group's messages. Its default handler replied to every message with a Mini App launch button — an inlineweb_appbutton, which Telegram permits only in private chats — so a reply in the group failed withBUTTON_TYPE_INVALID. The failure is silent (the send is rejected, no message appears), which is why no error surfaced to users.Now
handleStartreplies only in a private chat; in the group the bot only manages permissions. The promo bot gets the same guard. Tests cover private-replies and group-ignored for both bots.