Skip to content
This repository has been archived by the owner on Sep 30, 2022. It is now read-only.

Add video_note as type of note. #36

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tg_bot/modules/helper_funcs/msg_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Types(IntEnum):
AUDIO = 5
VOICE = 6
VIDEO = 7
VIDEO_NOTE = 8


def get_note_type(msg: Message):
Expand Down Expand Up @@ -76,6 +77,11 @@ def get_note_type(msg: Message):
text, buttons = button_markdown_parser(msgtext, entities=entities)
data_type = Types.VIDEO

elif msg.reply_to_message.video_note:
content = msg.reply_to_message.video_note.file_id
text, buttons = button_markdown_parser(msgtext, entities=entities)
data_type = Types.VIDEO_NOTE

return note_name, text, data_type, content, buttons


Expand Down Expand Up @@ -127,4 +133,9 @@ def get_welcome_type(msg: Message):
text = msg.reply_to_message.text
data_type = Types.VIDEO

elif msg.reply_to_message and msg.reply_to_message.video_note:
content = msg.reply_to_message.video_note.file_id
text = msg.reply_to_message.text
data_type = Types.VIDEO_NOTE

return text, data_type, content, buttons
3 changes: 2 additions & 1 deletion tg_bot/modules/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
sql.Types.PHOTO.value: dispatcher.bot.send_photo,
sql.Types.AUDIO.value: dispatcher.bot.send_audio,
sql.Types.VOICE.value: dispatcher.bot.send_voice,
sql.Types.VIDEO.value: dispatcher.bot.send_video
sql.Types.VIDEO.value: dispatcher.bot.send_video,
sql.Types.VIDEO_NOTE.value: dispatcher.bot.send_video_note
}


Expand Down