<s> class ApiSendAction ( object ) : <EOL> def set_content ( self , message ) : <EOL> raise NotImplementedError <EOL> def set_to ( self , recipients ) : <EOL> if '<STR_LIT>' in self . _data : <EOL> del self . _data [ '<STR_LIT>' ] <EOL> if isinstance ( recipients , list ) : <EOL> self . _data [ '<STR_LIT:to>' ] = '<STR_LIT:U+002C>' . join ( recipients ) <EOL> else : <EOL> self . _data [ '<STR_LIT:to>' ] = recipients <EOL> return self <EOL> def set_group ( self , group ) : <EOL> try : <EOL> del self . _data [ '<STR_LIT:to>' ] <EOL> except : <EOL> pass <EOL> self . _data [ '<STR_LIT>' ] = group <EOL> return self <EOL> def set_date ( self , timestamp ) : <EOL> self . _data [ '<STR_LIT:date>' ] = str ( int ( timestamp ) ) <EOL> return self <EOL> def set_idx ( self , idx ) : <EOL> def check_string ( string ) : <EOL> return ( len ( string ) <= <NUM_LIT> and string . isalnum ( ) ) <EOL> if isinstance ( idx , ( list , tuple ) ) : <EOL> self . _data = "<STR_LIT:|>" . join ( [ i for i in idx if check_string ( i ) ] ) <EOL> elif check_string ( idx ) : <EOL> self . _data [ '<STR_LIT>' ] = idx <EOL> return self <EOL> def set_check_idx ( self , check_idx = True ) : <EOL> if not check_idx : <EOL> try : <EOL> del self . _data [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> else : <EOL> self . _data [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> return self <EOL> def send_test ( self , test = True ) : <EOL> if not test : <EOL> try : <EOL> del self . _data [ '<STR_LIT:test>' ] <EOL> except KeyError : <EOL> pass <EOL> else : <EOL> self . _data [ '<STR_LIT:test>' ] = <NUM_LIT:1> <EOL> return self <EOL> def set_id ( self , message_id ) : <EOL> self . _data [ '<STR_LIT>' ] = int ( message_id ) <EOL> return self <EOL> def clear ( self ) : <EOL> self . _data . clear ( ) </s>
