# Replies / Notifications

## Usage

### **On-demand**

```ruby
user = User.first
user.notification.text "Hello!"
user.notification.typing 1.second
user.notification.text("How are you today?")
user.notification.send()
```

### As Reply in the Conversation

Using the <mark style="color:blue;">`@reply`</mark> instance, accessible from any [action block](/contexts/blocks.md) in a context or in the callbacks from the [`Conversation`](/conversation.md) class.

```ruby
class MainContext < Conversation

  def blocks

    intent "greeting" do
    
      @reply.text "Hello!"
      @reply.typing_on(2)
      @reply.quick_reply(
        "How are you today?",
        [
          {
            title: "I'm good",
            payload: :good
          },
          {
            title: "Had better days",
            payload: :bad
          }
        ]
      )
      
    end
  
  end

end
```

{% hint style="info" %}
For this case, the call to the `send()` method is not necessary, since i&#x74;*'s* a reply within the conversation, therefore the framework will do it automatically.
{% endhint %}

## Notification Formats

{% hint style="success" %}
In Kogno, we try to **unify** as many formats as possible, in order to allow developers to write a unified code for a **cross-platform** conversational application.
{% endhint %}

<table><thead><tr><th width="373.0597250165314">Format</th><th width="243.56947162426616">Description</th><th>Platforms</th></tr></thead><tbody><tr><td><a href="/pages/G2nEF1tZxhmbzmlhAJpg"><code>text</code></a></td><td>Text message</td><td>All</td></tr><tr><td><a href="/pages/pSatI9sDzM1jmTwkQP1I"><code>button</code></a></td><td>Text message with one or more buttons.</td><td>All</td></tr><tr><td><a href="/pages/lUA76FcljYqvLFiZtaAD"><code>quick_reply</code></a></td><td>Text message with one or more buttons below.</td><td>All</td></tr><tr><td><a href="/pages/zVXbNNfqfvIjO3BLys3q"><code>raw</code></a></td><td>Calls to each platform with raw params.</td><td>All</td></tr><tr><td><a href="/pages/eJD7aMScdXJVb2JgSTXc"><code>list</code></a></td><td>Multiple choice list.</td><td>WhatsApp</td></tr><tr><td><a href="/pages/rgBFd4rnK6ZCdA4qHPYG"><code>carousel</code></a></td><td>Carrousel images, title, description, link, among others.</td><td>Messenger</td></tr><tr><td><a href="/pages/Y4JJa5LbTYC7Aa5hnCqM"><code>url</code></a></td><td>Url with image, title and description.</td><td>All</td></tr><tr><td><a href="/pages/vsJhoeoQjRExPUSN4zip"><code>typing</code></a></td><td>Pause for X seconds.</td><td>All</td></tr><tr><td><a href="/pages/3oBvWjDTVmh3lEHlgCJ0"><code>image</code></a></td><td>Sends an image.</td><td>All</td></tr><tr><td><a href="/pages/00HmRxm6id5hURNz1n7r"><code>video</code></a></td><td>Sends a video.</td><td>All</td></tr><tr><td><a href="/pages/i64Gg4wI3HG3s3HVmw3Z"><code>html</code></a></td><td>Message in HTML format.</td><td>Telegram</td></tr><tr><td><a href="/pages/qsl7vwOhsaKHLmPjGwxY"><code>markdown</code></a></td><td>Message in Markdown format.</td><td>Telegram</td></tr><tr><td><a href="/pages/o62UEF9EnMdkhRab1pBv"><code>contact</code></a></td><td>Contact information.</td><td>WhatsApp &#x26; Telegram</td></tr><tr><td><a href="/pages/1LmSzLpq4PBjEtZ4PnWR"><code>location</code></a></td><td>Sends a location.</td><td>WhatsApp &#x26; Telegram</td></tr><tr><td><a href="/pages/pe4y89Z1ybndSA5Zoi9X"><code>recurring_notification_request</code></a></td><td>Request for subscription to recurring notifications in Messenger.</td><td>Messenger</td></tr><tr><td><a href="/pages/8gumzI9R0FisXDtAhhzA"><code>messenger_generic_template</code></a></td><td>The generic template from Messenger.</td><td>Messenger</td></tr><tr><td><a href="/pages/dhzx58KkMbPPTU1gCYag"><code>whatsapp_template</code></a></td><td>WhatsApp media message template.</td><td>WhatApp</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kogno.io/replies-notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
