Files
openclaw/apps/macos/Sources/Clawdbot/GatewayAgentChannel.swift

27 lines
582 B
Swift
Raw Normal View History

2026-01-07 11:00:21 +00:00
import Foundation
enum GatewayAgentChannel: String, CaseIterable, Sendable {
case last
case webchat
case whatsapp
case telegram
init(raw: String?) {
let trimmed = raw?
.trimmingCharacters(in: .whitespacesAndNewlines)
.lowercased() ?? ""
self = GatewayAgentChannel(rawValue: trimmed) ?? .last
}
func shouldDeliver(_ isLast: Bool) -> Bool {
switch self {
case .webchat:
false
2026-01-07 11:00:21 +00:00
case .last:
isLast
2026-01-07 11:00:21 +00:00
case .whatsapp, .telegram:
true
2026-01-07 11:00:21 +00:00
}
}
}