# 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](https://docs.kogno.io/contexts/blocks) in a context or in the callbacks from the [`Conversation`](https://docs.kogno.io/conversation) 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="replies-notifications/text"><code>text</code></a></td><td>Text message</td><td>All</td></tr><tr><td><a href="replies-notifications/button"><code>button</code></a></td><td>Text message with one or more buttons.</td><td>All</td></tr><tr><td><a href="replies-notifications/quick_reply"><code>quick_reply</code></a></td><td>Text message with one or more buttons below.</td><td>All</td></tr><tr><td><a href="replies-notifications/raw"><code>raw</code></a></td><td>Calls to each platform with raw params.</td><td>All</td></tr><tr><td><a href="replies-notifications/list"><code>list</code></a></td><td>Multiple choice list.</td><td>WhatsApp</td></tr><tr><td><a href="replies-notifications/carousel"><code>carousel</code></a></td><td>Carrousel images, title, description, link, among others.</td><td>Messenger</td></tr><tr><td><a href="replies-notifications/url"><code>url</code></a></td><td>Url with image, title and description.</td><td>All</td></tr><tr><td><a href="replies-notifications/typing"><code>typing</code></a></td><td>Pause for X seconds.</td><td>All</td></tr><tr><td><a href="replies-notifications/image"><code>image</code></a></td><td>Sends an image.</td><td>All</td></tr><tr><td><a href="replies-notifications/video"><code>video</code></a></td><td>Sends a video.</td><td>All</td></tr><tr><td><a href="replies-notifications/html"><code>html</code></a></td><td>Message in HTML format.</td><td>Telegram</td></tr><tr><td><a href="replies-notifications/markdown"><code>markdown</code></a></td><td>Message in Markdown format.</td><td>Telegram</td></tr><tr><td><a href="replies-notifications/contact"><code>contact</code></a></td><td>Contact information.</td><td>WhatsApp &#x26; Telegram</td></tr><tr><td><a href="replies-notifications/location"><code>location</code></a></td><td>Sends a location.</td><td>WhatsApp &#x26; Telegram</td></tr><tr><td><a href="replies-notifications/recurring_notification_request"><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="replies-notifications/messenger_generic_template"><code>messenger_generic_template</code></a></td><td>The generic template from Messenger.</td><td>Messenger</td></tr><tr><td><a href="replies-notifications/whatsapp_template"><code>whatsapp_template</code></a></td><td>WhatsApp media message template.</td><td>WhatApp</td></tr></tbody></table>
