Gemini/GeminiIntents/GetMetaIntentHandler.swift

23 lines
597 B
Swift

//
// GetMetaIntentHandler.swift
// GeminiIntents
//
// Created by Shadowfacts on 10/1/21.
//
import Intents
class GetMetaIntentHandler: NSObject, GetMetaIntentHandling {
func handle(intent: GetMetaIntent, completion: @escaping (GetMetaIntentResponse) -> Void) {
guard let response = intent.response else {
completion(GetMetaIntentResponse(code: .failure, userActivity: nil))
return
}
let intentResp = GetMetaIntentResponse(code: .success, userActivity: nil)
intentResp.meta = response.meta
completion(intentResp)
}
}