Skip to content

Feature: Support Telegram Guest Bots (Bot API 10.0) #35

@Rustam-Z

Description

@Rustam-Z

Summary

Bot API 10.0 (April 28, 2025) introduced Guest Bots — bots can now receive messages from chats they're not members of. This is directly relevant to Luna/pyclaudir: it would allow deployment into new groups without requiring full membership, reducing friction for new users.

What are Guest Bots?

A user can invoke a bot from any chat (even one the bot hasn't joined) via a guest query. The bot receives the message, processes it, and replies — without ever being added as a member.

New API surface to support

Element Type Description
guest_query_id string Unique ID of the guest query; used to respond via answerGuestQuery()
guest_bot_caller_user User The user who initiated the guest interaction
guest_bot_caller_chat Chat The chat from which the guest query came
supports_guest_queries bool Field on User — whether a bot supports guest queries
answerGuestQuery() Method Send a reply back into the originating chat
SentGuestMessage Class Represents the message sent back via answerGuestQuery()

What pyclaudir needs

  1. Dispatcher changes — detect incoming updates with guest_query_id present and route them as a new message type (e.g. GuestMessage)
  2. Context injection — populate guest_bot_caller_user and guest_bot_caller_chat into the <msg> envelope Luna receives, so she knows who asked and from where
  3. Reply routing — when Luna calls send_message / reply_to_message in response to a guest query, the harness should use answerGuestQuery() instead of the normal send path
  4. supports_guest_queries flag — set this to true in bot settings once the above is implemented

UX benefit

Luna could be invoked in groups without needing to be added as a member first. Lower barrier to entry for new communities trying Luna out.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions