capture also voice messages
This commit is contained in:
parent
88aaeed330
commit
fe292a4fa9
1 changed files with 3 additions and 1 deletions
4
robot.py
4
robot.py
|
@ -132,6 +132,8 @@ def handle_rest(bot, update):
|
||||||
file = update.message.audio.file_id
|
file = update.message.audio.file_id
|
||||||
elif update.message.video is not None:
|
elif update.message.video is not None:
|
||||||
file = update.message.video.file_id
|
file = update.message.video.file_id
|
||||||
|
elif update.message.voice is not None:
|
||||||
|
file = update.message.voice.file_id
|
||||||
if file is not None:
|
if file is not None:
|
||||||
try:
|
try:
|
||||||
url = bot.getFile(file).file_path
|
url = bot.getFile(file).file_path
|
||||||
|
@ -166,7 +168,7 @@ def main():
|
||||||
dp.add_error_handler(error)
|
dp.add_error_handler(error)
|
||||||
|
|
||||||
dp.add_handler(MessageHandler(Filters.entity(MessageEntity.URL), handle_url))
|
dp.add_handler(MessageHandler(Filters.entity(MessageEntity.URL), handle_url))
|
||||||
dp.add_handler(MessageHandler(Filters.photo | Filters.video | Filters.audio | Filters.document, handle_rest))
|
dp.add_handler(MessageHandler(Filters.photo | Filters.video | Filters.audio | Filters.voice | Filters.document, handle_rest))
|
||||||
|
|
||||||
updater.start_polling()
|
updater.start_polling()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue