IceCubesApp/IceCubesAppIntents/PostIntent.swift
2024-05-02 12:05:48 +02:00

20 lines
564 B
Swift

import Foundation
import AppIntents
struct PostIntent: AppIntent {
static let title: LocalizedStringResource = "Post status to Mastodon"
static var description: IntentDescription {
get {
"Use Ice Cubes to post a status to Mastodon"
}
}
static let openAppWhenRun: Bool = true
@Parameter(title: "Post content", inputConnectionBehavior: .connectToPreviousIntentResult)
var content: String?
func perform() async throws -> some IntentResult {
AppIntentService.shared.handledIntent = .init(intent: self)
return .result()
}
}