EPChatConversation
@objcMembers
public class EPChatConversation : Object, Codable
This object represents a chat conversation in which a bot will run.
-
The id of the chat conversation.
Declaration
Swift
public internal(set) dynamic var id: String { get }
-
The last date at which the chat conversation was modified.
Declaration
Swift
public internal(set) dynamic var updatedAt: Date { get }
-
The url of the current bot avatar image.
Declaration
Swift
public internal(set) dynamic var avatarUrl: String { get }
-
The base64 data of the current bot avatar image.
Declaration
Swift
public internal(set) dynamic var avatarBase64: String? { get }
-
The uuid of the currently played bot.
Declaration
Swift
public internal(set) dynamic var botUuid: String { get }
-
The current chat conversation language code. It is used to determine the language used by the bot.
Declaration
Swift
public internal(set) dynamic var languageCode: String { get }
-
Get the bot context as a dictonary.
Declaration
Swift
public var botContextValue: [String : Any] { get }
-
Get the bot context as an array of EPContextObject objects.
Declaration
Swift
public var botContextObjects: [EPContextObject] { get }
-
Represents the name of the currently running bot. If the bot doesn’t exist, a default name is returned.
Declaration
Swift
public var conversationDescription: String { get }
-
Get all the chat conversation messages.
Declaration
Swift
public var allMessages: [EPChatMessage] { get }
-
Creates a chat conversation object based on the provided data content.
Throws
An error containing the following message: The provided data is malformed or is not a chat conversation export data.Declaration
Swift
@discardableResult public class func createFrom(exportedData: Data) throws -> EPChatConversation?
Parameters
exportedData
The data to use to restore the chat conversation. This data must be obtained from the chat conversation export method.
Return Value
The restored chat conversation or
nil
if the restoration didn’t work.
-
Declaration
Swift
public required init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to encoder: Encoder) throws
-
Intializes a new chat conversation for the given bot UUID.
Declaration
Swift
public convenience init(botUuid: String, chatConversationId: String? = nil, initialContext: [EPContextObject] = [])
Parameters
botUuid
The bot UUID to use with this chat conversation.
chatConversationId
A specific id to be able to retrieve the chat conversation later. Default value is
nil
.initalContext
An array of context objects to use as the initial chat conversation context. Default value is
[]
.
-
Export the chat conversation to a json data object.
Declaration
Swift
public func export() -> Data?
Return Value
The chat conversation json data.