Skip to content

Commit 1797f07

Browse files
committed
Remove redundant function
1 parent 1eda7ca commit 1797f07

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

telebot/util.py

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -643,40 +643,6 @@ def validate_web_app_data(token: str, raw_init_data: str):
643643
return hmac.new(secret_key.digest(), data_check_string.encode(), sha256).hexdigest() == init_data_hash
644644

645645

646-
def get_media_file_id(message: types.Message, content_types: Optional[List[str]] = None):
647-
"""
648-
Use this method to get file id of message media if it's present.
649-
650-
:param message: The message to get media from
651-
:type message: :class:`telebot.types.Message`
652-
653-
:param content_types: Types of media to look for, by default all types are considered.
654-
:type content_types: :obj:`list[str]`, optional
655-
656-
:return: file_id or :obj:`None`
657-
:rtype: :obj:`str` | :obj:`None`
658-
"""
659-
if content_types is None:
660-
content_types = content_type_media
661-
662-
if "animation" in content_types and message.animation is not None:
663-
return message.animation.file_id
664-
elif "audio" in content_types and message.audio is not None:
665-
return message.audio.file_id
666-
elif "document" in content_types and message.document is not None:
667-
return message.document.file_id
668-
elif "photo" in content_types and message.photo is not None:
669-
return message.photo[0].file_id
670-
elif "sticker" in content_types and message.sticker is not None:
671-
return message.sticker.file_id
672-
elif "video" in content_types and message.video is not None:
673-
return message.video.file_id
674-
elif "video_note" in content_types and message.video_note is not None:
675-
return message.video_note.file_id
676-
elif "voice" in content_types and message.voice is not None:
677-
return message.voice.file_id
678-
679-
680646
__all__ = (
681647
"content_type_media", "content_type_service", "update_types",
682648
"WorkerThread", "AsyncTask", "CustomRequestResponse",
@@ -685,7 +651,7 @@ def get_media_file_id(message: types.Message, content_types: Optional[List[str]]
685651
"chunks", "generate_random_token", "pil_image_to_file",
686652
"is_command", "extract_command", "extract_arguments",
687653
"split_string", "smart_split", "escape", "user_link", "quick_markup",
688-
"antiflood", "get_media_file_id", "parse_web_app_data", "validate_web_app_data",
654+
"antiflood", "parse_web_app_data", "validate_web_app_data",
689655
"or_set", "or_clear", "orify", "OrEvent", "per_thread",
690656
"webhook_google_functions"
691657
)

0 commit comments

Comments
 (0)