mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Refactoring
This commit is contained in:
19
submodules/TelegramCore/Sources/ApiUtils/BotInfo.swift
Normal file
19
submodules/TelegramCore/Sources/ApiUtils/BotInfo.swift
Normal file
@@ -0,0 +1,19 @@
|
||||
import Foundation
|
||||
import Postbox
|
||||
import TelegramApi
|
||||
|
||||
import SyncCore
|
||||
|
||||
extension BotInfo {
|
||||
convenience init(apiBotInfo: Api.BotInfo) {
|
||||
switch apiBotInfo {
|
||||
case let .botInfo(_, description, commands):
|
||||
self.init(description: description, commands: commands.map { command in
|
||||
switch command {
|
||||
case let .botCommand(command, description):
|
||||
return BotCommand(text: command, description: description)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user