ConversationPlugin<CTX extends Context> constructor

ConversationPlugin<CTX extends Context>({
  1. ConversationStorage? storage,
  2. String getStorageKey(
    1. CTX ctx
    )?,
  3. Duration defaultTimeout = const Duration(minutes: 30),
  4. Duration cleanupInterval = const Duration(minutes: 5),
  5. void onConversationExpired(
    1. String conversationName,
    2. String key
    )?,
  6. Future<void> onConversationTimeout(
    1. String conversationName,
    2. CTX? ctx
    )?,
})

Creates a conversation plugin.

Implementation

ConversationPlugin({
  ConversationStorage? storage,
  String Function(CTX ctx)? getStorageKey,
  this.defaultTimeout = const Duration(minutes: 30),
  this.cleanupInterval = const Duration(minutes: 5),
  this.onConversationExpired,
  this.onConversationTimeout,
})  : storage = storage ?? MemoryConversationStorage(),
      getStorageKey = getStorageKey ?? _defaultStorageKeyGenerator;