mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-31 16:07:44 +03:00 
			
		
		
		
	Add .video_note and .gif convenience properties to NewMessage
This commit is contained in:
		
							parent
							
								
									cf650e061e
								
							
						
					
					
						commit
						2fb42772c6
					
				|  | @ -522,6 +522,23 @@ class NewMessage(_EventBuilder): | ||||||
|             """ |             """ | ||||||
|             return self._document_by_attribute(types.DocumentAttributeVideo) |             return self._document_by_attribute(types.DocumentAttributeVideo) | ||||||
| 
 | 
 | ||||||
|  |         @property | ||||||
|  |         def video_note(self): | ||||||
|  |             """ | ||||||
|  |             If the message media is a document with a Video attribute, | ||||||
|  |             this returns the (:obj:`Document`) object. | ||||||
|  |             """ | ||||||
|  |             return self._document_by_attribute(types.DocumentAttributeVideo, | ||||||
|  |                                                lambda attr: attr.round_message) | ||||||
|  | 
 | ||||||
|  |         @property | ||||||
|  |         def gif(self): | ||||||
|  |             """ | ||||||
|  |             If the message media is a document with an Animated attribute, | ||||||
|  |             this returns the (:obj:`Document`) object. | ||||||
|  |             """ | ||||||
|  |             return self._document_by_attribute(types.DocumentAttributeAnimated) | ||||||
|  | 
 | ||||||
|         @property |         @property | ||||||
|         def sticker(self): |         def sticker(self): | ||||||
|             """ |             """ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user