added deprecation warnings to other methods
@@ -53,26 +53,39 @@ class CollectingDispatcher:
def utter_custom_message(self, *elements: Dict[Text, Any], **kwargs: Any) -> None:
warnings.warn(
"Use of `utter_custom_message` is deprecated. "
- "Use `utter_elements` to send elements, or "
- "`utter_custom_json` to send a custom json message. ",
+ "Use `utter_message` instead.",
DeprecationWarning,
)
self.utter_elements(*elements, **kwargs)
def utter_elements(self, *elements: Dict[Text, Any], **kwargs: Any) -> None:
"""Sends a message with custom elements to the output channel."""
-
+ warnings.warn(
+ "Use of `utter_elements` is deprecated. "
+ "Use `utter_message` instead.",
+ DeprecationWarning,
+ )
self.utter_message(*elements)
def utter_button_message(
self, text: Text, buttons: List[Dict[Text, Any]], **kwargs: Any
) -> None:
"""Sends a message with buttons to the output channel."""
+ warnings.warn(
+ "Use of `utter_button_message` is deprecated. "
+ "Use `utter_message` instead.",
+ DeprecationWarning,
+ )
self.utter_message(text=text, buttons=buttons)
def utter_attachment(self, attachment: Text, **kwargs: Any) -> None:
"""Send a message to the client with attachments."""
+ warnings.warn(
+ "Use of `utter_attachment` is deprecated. "
+ "Use `utter_message` instead.",
+ DeprecationWarning,
+ )
self.utter_message(attachment=attachment)
@@ -86,6 +99,11 @@ class CollectingDispatcher:
**kwargs: Any,
) -> None:
"""Sends a message template with buttons to the output channel."""
+ warnings.warn(
+ "Use of `utter_button_template` is deprecated. "
+ "Use `utter_message` instead.",
+ DeprecationWarning,
+ )
self.utter_message(template=template, buttons=buttons)
@@ -94,16 +112,31 @@ class CollectingDispatcher:
self, template: Text, tracker: Tracker, silent_fail: bool = False, **kwargs: Any
) -> None:
""""Send a message to the client based on a template."""
+ warnings.warn(
+ "Use of `utter_template` is deprecated. "
+ "Use `utter_message` instead.",
+ DeprecationWarning,
+ )
self.utter_message(template=template)
def utter_custom_json(self, json_message: Dict[Text, Any], **kwargs: Any) -> None:
"""Sends custom json to the output channel."""
+ warnings.warn(
+ "Use of `utter_custom_json` is deprecated. "
+ "Use `utter_message` instead.",
+ DeprecationWarning,
+ )
self.utter_message(json_message=json_message)
def utter_image_url(self, image: Text, **kwargs: Any) -> None:
"""Sends url of image attachment to the output channel."""
+ warnings.warn(
+ "Use of `utter_image_url` is deprecated. "
+ "Use `utter_message` instead.",
+ DeprecationWarning,
+ )
self.utter_message(image=image)
