mirror of
https://github.com/danog/Telegram.git
synced 2024-12-04 10:27:46 +01:00
28 lines
973 B
Mathematica
28 lines
973 B
Mathematica
|
#import "TGBridgeBotInfo+TGBotInfo.h"
|
||
|
#import "TGBotInfo.h"
|
||
|
#import "TGBridgeBotCommandInfo+TGBotCommandInfo.h"
|
||
|
|
||
|
@implementation TGBridgeBotInfo (TGBotInfo)
|
||
|
|
||
|
+ (TGBridgeBotInfo *)botInfoWithTGBotInfo:(TGBotInfo *)botInfo userId:(int32_t)userId
|
||
|
{
|
||
|
TGBridgeBotInfo *bridgeBotInfo = [[TGBridgeBotInfo alloc] init];
|
||
|
bridgeBotInfo->_version = botInfo.version;
|
||
|
bridgeBotInfo->_userId = userId;
|
||
|
bridgeBotInfo->_shortDescription = botInfo.shortDescription;
|
||
|
bridgeBotInfo->_botDescription = botInfo.botDescription;
|
||
|
|
||
|
NSMutableArray *commandList = [[NSMutableArray alloc] init];
|
||
|
for (TGBotComandInfo *commandInfo in botInfo.commandList)
|
||
|
{
|
||
|
TGBridgeBotCommandInfo *bridgeCommandInfo = [TGBridgeBotCommandInfo botCommandInfoWithTGBotCommandInfo:commandInfo];
|
||
|
if (bridgeCommandInfo != nil)
|
||
|
[commandList addObject:bridgeCommandInfo];
|
||
|
}
|
||
|
bridgeBotInfo->_commandList = commandList;
|
||
|
|
||
|
return bridgeBotInfo;
|
||
|
}
|
||
|
|
||
|
@end
|