BotInfo.fromMap constructor
Implementation
BotInfo.fromMap(Map<String, dynamic> map) {
extra = map['@extra'];
client_id = map['@client_id'];
share_text = map['share_text'];
description = map['description'];
if (map['photo'] != null) {
photo = TdApiMap.fromMap(map['photo']) as Photo;
}
if (map['animation'] != null) {
animation = TdApiMap.fromMap(map['animation']) as Animation;
}
if (map['menu_button'] != null) {
menu_button = TdApiMap.fromMap(map['menu_button']) as BotMenuButton;
}
if (map['commands'] != null) {
commands = [];
for (var someValue in map['commands']) {
if (someValue != null) {
commands?.add(TdApiMap.fromMap(someValue) as BotCommand);
}
}
}
if (map['default_group_administrator_rights'] != null) {
default_group_administrator_rights = TdApiMap.fromMap(map['default_group_administrator_rights']) as ChatAdministratorRights;
}
if (map['default_channel_administrator_rights'] != null) {
default_channel_administrator_rights = TdApiMap.fromMap(map['default_channel_administrator_rights']) as ChatAdministratorRights;
}
}