Skip to content

Commit

Permalink
port the fix to storing json in telegram channel to 1.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai committed Sep 17, 2019
1 parent ab9b0ae commit 7494a1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Expand Up @@ -18,6 +18,7 @@ Fixed
- Default one-hot representation for label featurization inside ``EmbeddingIntentClassifier`` if label features don't exist.
- Policy ensemble no longer incorrectly wrings "missing mapping policy" when
mapping policy is present.
- "test" from ``utter_custom_json`` now correctly saved to tracker when using telegram channel

Removed
-------
Expand Down
3 changes: 3 additions & 0 deletions rasa/core/channels/telegram.py
@@ -1,4 +1,5 @@
import logging
from copy import deepcopy
from sanic import Blueprint, response
from sanic.request import Request
from telegram import (
Expand Down Expand Up @@ -94,6 +95,8 @@ async def send_text_with_buttons(
async def send_custom_json(
self, recipient_id: Text, json_message: Dict[Text, Any], **kwargs: Any
) -> None:
json_message = deepcopy(json_message)

recipient_id = json_message.pop("chat_id", recipient_id)

send_functions = {
Expand Down

0 comments on commit 7494a1e

Please sign in to comment.