lansenger-sdk-ts 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/models.d.ts CHANGED
@@ -898,6 +898,7 @@ export declare class ChatMessageInfo {
898
898
  content?: AnyDict | null;
899
899
  });
900
900
  toDict(): AnyDict;
901
+ plainText(): string;
901
902
  }
902
903
  export declare class ChatMessagesResult {
903
904
  success: boolean;
package/dist/models.js CHANGED
@@ -964,6 +964,21 @@ class ChatMessageInfo {
964
964
  d.content = this.content;
965
965
  return d;
966
966
  }
967
+ plainText() {
968
+ const content = this.content;
969
+ if (content === null || content === undefined)
970
+ return "";
971
+ if (typeof content === "string")
972
+ return content;
973
+ if (typeof content === "object") {
974
+ if ("text" in content && content.text)
975
+ return content.text;
976
+ if ("formatText" in content && typeof content.formatText === "object" && content.formatText !== null) {
977
+ return content.formatText.content || "";
978
+ }
979
+ }
980
+ return "";
981
+ }
967
982
  }
968
983
  exports.ChatMessageInfo = ChatMessageInfo;
969
984
  class ChatMessagesResult {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lansenger-sdk-ts",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Lansenger SDK — TypeScript SDK for Lansenger Smart Bot API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",