telebot-ts API Documentation - v1.0.0
    Preparing search index...

    Interface ConversationControl

    Controller interface passed as the first argument to modern linear conversation functions.

    interface ConversationControl {
        ask(text: string, filter?: BaseFilter): Promise<string>;
        exit(): never;
        wait(filter?: BaseFilter): Promise<Update>;
    }
    Index
    • Sends a prompt message to the user and pauses until their response arrives.

      Parameters

      • text: string

        The prompt message to send.

      • Optionalfilter: BaseFilter

        Optional filter that the response must satisfy.

      Returns Promise<string>

      The text of the user's response message.

      const name = await conversation.ask("What is your name?");
      
    • Permanently exits the active conversation flow immediately.

      Returns never

    • Pauses execution until the next update from this user/chat arrives.

      Parameters

      • Optionalfilter: BaseFilter

        Optional filter that the incoming update must satisfy.

      Returns Promise<Update>

      The incoming Update that satisfied the condition.

      const update = await conversation.wait();
      console.log("Received response:", update.effective_message?.text);