Files
StickerSlack/StickerSlack/Models/Cachet/SlackResponse.swift
T
Nihaal Sharma 8dd8169aae major refactor, now im going to use generics and "any StickerProtocol" to have more shared logic
changed id on stickerprotocol to string cos of giphy
downloadedemojis > downloadedStickers
removed hoarder from emojipreview cos its not used
added toGif in GifObject
2026-03-17 10:09:24 +00:00

28 lines
491 B
Swift

//
// SlackResponse.swift
// StickerSlack
//
// Created by neon443 on 15/10/2025.
//
import Foundation
struct SlackResponse: Identifiable, Codable {
var type: String
var id: String
var name: String
var imageUrl: String
var alias: String?
static func toEmojis(from response: [SlackResponse]?) -> [Emoji]? {
guard let response else { return nil }
return response.map { item in
Emoji(
name: item.name,
url: URL(string: item.imageUrl)!,
id: item.id
)
}
}
}