Action
public struct Action : Lookupable
Actions are messages, that should be output by the client. They can include text, media (images, links, lists, etc), quickreplies, etc. Some actions can also be fallback messages, providing an output if an older client doesn’t support a certain media type, by using Action.fallbackFor
-
Non-unique id of the action. Required by wit, but currently unused by clients. Example: “rss”
Declaration
Swift
public let id: String -
The message to output. Can be nil, in which case media or mediaAdvanced should be set. Example: “Wie komme ich zum Schwedenplatz”. Fallback for old clients and not shown on new clients if
templateMarkdownis not nil. Optional if templateMarkdown is not set.Declaration
Swift
public var template: String? -
The message to output in markdown format. Can be nil, in which case media or mediaAdvanced should be set. Example: “Wie komme ich zum Schwedenplatz”. Overrides
template. If templateMarkdown is set,templatemust also be set with a fallback markdown-less text. Optional.Declaration
Swift
public var templateMarkdown: String? -
**Deprecated: ** Use `quickRepliesAdvanced` instead.Important: this property is called ‘quickreplies’ (no camel case) in the json for backwards compatibility.
Array of quick reply strings to output as quick reply buttons with this action. If the string is in the format “String to send|String to output” then the first string will be sent to WienBotKitura whe the second string will be the button of the title. Optional.
Declaration
Swift
public let quickReplies: [String]? -
Array of
QuickReplyAdvancedto output as quick reply buttons with this action. These buttons can trigger messages to send to the server as well as other actions such as starting the reservation system. Optional.Declaration
Swift
public var quickRepliesAdvanced: [QuickReplyAdvanced]? -
Deprecated.** Used to show images, buttons and other media types. The exact keys and values are not documented, please use
mediaAdvancedinstead.Declaration
Swift
public let media: [String : String]? -
Used to output non-string messages, such as images and lists. This will fully replace
mediain future. Optional.Declaration
Swift
public var mediaAdvanced: WaveMedia? -
Can contain an array of
WaveMediaTypefor which this action is a fallback for. If the client knows how to render all of theWaveMediaTypein the array, then do not output this action. Useful for older clients that may not support media types such as ‘list’. Optional.Declaration
Swift
public let fallbackFor: [WaveMediaType]?
Action Structure Reference