Various fixes

This commit is contained in:
Ilya Laktyushin
2022-06-20 18:48:59 +05:00
parent ba599ffd32
commit 4b51b8c1ad
8 changed files with 49 additions and 20 deletions

View File

@@ -16,8 +16,9 @@ extension BotMenuButton {
extension BotInfo {
convenience init(apiBotInfo: Api.BotInfo) {
switch apiBotInfo {
case let .botInfo(_, _, description, descriptionPhoto, _, apiCommands, apiMenuButton):
case let .botInfo(_, _, description, descriptionPhoto, descriptionDocument, apiCommands, apiMenuButton):
let photo: TelegramMediaImage? = descriptionPhoto.flatMap(telegramMediaImageFromApiPhoto)
let video: TelegramMediaFile? = descriptionDocument.flatMap { telegramMediaFileFromApiDocument($0, noPremium: false) }
var commands: [BotCommand] = []
if let apiCommands = apiCommands {
commands = apiCommands.map { command in
@@ -31,7 +32,7 @@ extension BotInfo {
if let apiMenuButton = apiMenuButton {
menuButton = BotMenuButton(apiBotMenuButton: apiMenuButton)
}
self.init(description: description ?? "", photo: photo, commands: commands, menuButton: menuButton)
self.init(description: description ?? "", photo: photo, video: video, commands: commands, menuButton: menuButton)
}
}
}