MCPcopy Create free account
hub / github.com/TechifyBots/File-Stream-Bot / get_media_from_message

Function get_media_from_message

biisal/utils/file_properties.py:32–46  ·  view source on GitHub ↗
(message: "Message")

Source from the content-addressed store, hash-verified

30 return file_id
31
32def get_media_from_message(message: "Message") -> Any:
33 media_types = (
34 "audio",
35 "document",
36 "photo",
37 "sticker",
38 "animation",
39 "video",
40 "voice",
41 "video_note",
42 )
43 for attr in media_types:
44 media = getattr(message, attr, None)
45 if media:
46 return media
47
48
49def get_hash(media_msg: Message) -> str:

Callers 6

parse_file_idFunction · 0.85
parse_file_unique_idFunction · 0.85
get_file_idsFunction · 0.85
get_hashFunction · 0.85
get_nameFunction · 0.85
get_media_file_sizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected