Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Zylbersztejn authored Nov 28, 2018
1 parent d1e2d3d commit ea8ba0a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,23 @@ Use the SocketIOInput channel: See [instructions in the Rasa Core documentation]
#### Others
Your backend must expose a socket with [socket.io](http://socket.io)

### Receiving messages from the chat
##### Receiving messages from the chat

```python
@socketio.on('user_uttered')
def handle_message(message):
# do something
```

### Sending messages from the backend to the chat widget
##### Sending messages from the backend to the chat widget

##### sending plain text
###### sending plain text

```python
emit('bot_uttered', {"text": "hello"}, room=session_id)
```

##### sending quick replies
###### sending quick replies

```python
message = {
Expand All @@ -130,7 +130,7 @@ message = {
emit('bot_uttered', message, room=socket_id)
```

##### sending a link Snippet
###### sending a link Snippet

Admittedly a bit far fetched, thinking that Snippets would evolve to carousels
of generic templates :)
Expand All @@ -157,7 +157,7 @@ message = {
emit('bot_uttered', message, room=socket_id)
```

##### sending a Video Message
###### sending a Video Message

```python
message = {
Expand All @@ -172,7 +172,7 @@ message = {
emit('bot_uttered', message, room=socket_id)
```

##### sending an Image Message
###### sending an Image Message

```python
message = {
Expand Down

0 comments on commit ea8ba0a

Please sign in to comment.