mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
34 lines
1.1 KiB
Objective-C
34 lines
1.1 KiB
Objective-C
#import "TGBotInfo.h"
|
|
|
|
#import "PSKeyValueCoder.h"
|
|
|
|
@implementation TGBotInfo
|
|
|
|
- (instancetype)initWithVersion:(int32_t)version shortDescription:(NSString *)shortDescription botDescription:(NSString *)botDescription commandList:(NSArray *)commandList
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
_version = version;
|
|
_botDescription = botDescription;
|
|
_shortDescription = shortDescription;
|
|
_commandList = commandList;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (instancetype)initWithKeyValueCoder:(PSKeyValueCoder *)coder
|
|
{
|
|
return [self initWithVersion:[coder decodeInt32ForCKey:"version"] shortDescription:[coder decodeStringForCKey:"shortDescription"] botDescription:[coder decodeStringForCKey:"botDescription"] commandList:[coder decodeArrayForCKey:"commandList"]];
|
|
}
|
|
|
|
- (void)encodeWithKeyValueCoder:(PSKeyValueCoder *)coder
|
|
{
|
|
[coder encodeInt32:_version forCKey:"version"];
|
|
[coder encodeString:_shortDescription forCKey:"shortDescription"];
|
|
[coder encodeString:_botDescription forCKey:"botDescription"];
|
|
[coder encodeArray:_commandList forCKey:"commandList"];
|
|
}
|
|
|
|
@end
|