chat 4.13.2 → 4.13.4

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/index.d.ts CHANGED
@@ -62,7 +62,7 @@ interface ChatConfig<TAdapters extends Record<string, Adapter> = Record<string,
62
62
  * Logger instance or log level.
63
63
  * Pass "silent" to disable all logging.
64
64
  */
65
- logger: Logger | LogLevel;
65
+ logger?: Logger | LogLevel;
66
66
  /** State adapter for subscriptions and locking */
67
67
  state: StateAdapter;
68
68
  /**
@@ -1958,6 +1958,7 @@ interface SerializedThread {
1958
1958
  _type: "chat:Thread";
1959
1959
  adapterName: string;
1960
1960
  channelId: string;
1961
+ currentMessage?: SerializedMessage;
1961
1962
  id: string;
1962
1963
  isDM: boolean;
1963
1964
  }
package/dist/index.js CHANGED
@@ -1137,6 +1137,7 @@ var ThreadImpl = class _ThreadImpl {
1137
1137
  _type: "chat:Thread",
1138
1138
  id: this.id,
1139
1139
  channelId: this.channelId,
1140
+ currentMessage: this._currentMessage?.toJSON(),
1140
1141
  isDM: this.isDM,
1141
1142
  adapterName: this.adapter.name
1142
1143
  };
@@ -1160,6 +1161,7 @@ var ThreadImpl = class _ThreadImpl {
1160
1161
  id: json.id,
1161
1162
  adapterName: json.adapterName,
1162
1163
  channelId: json.channelId,
1164
+ currentMessage: json.currentMessage ? Message.fromJSON(json.currentMessage) : void 0,
1163
1165
  isDM: json.isDM
1164
1166
  });
1165
1167
  if (adapter) {
@@ -1394,7 +1396,7 @@ var Chat = class {
1394
1396
  if (typeof config.logger === "string") {
1395
1397
  this.logger = new ConsoleLogger(config.logger);
1396
1398
  } else {
1397
- this.logger = config.logger;
1399
+ this.logger = config.logger || new ConsoleLogger("info");
1398
1400
  }
1399
1401
  const webhooks = {};
1400
1402
  for (const [name, adapter] of Object.entries(config.adapters)) {