From 9b9c7ced7725dde3d4d24e396bcbda9057e9f156 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 30 Apr 2018 19:34:59 +0200 Subject: [PATCH] Update chat_action.py --- pyrogram/client/chat_action.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/chat_action.py b/pyrogram/client/chat_action.py index 020b0424..2296bcac 100644 --- a/pyrogram/client/chat_action.py +++ b/pyrogram/client/chat_action.py @@ -15,6 +15,7 @@ # # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . + from enum import Enum from pyrogram.api import types @@ -66,10 +67,11 @@ class ChatAction(Enum): """User is uploading a round video note.""" @classmethod - def from_string(cls, action: str) -> 'ChatAction': + def from_string(cls, action: str) -> "ChatAction": for a in iter(ChatAction): if a.name.lower() == action.lower(): return a + raise ValueError("Invalid ChatAction: '{}'. Possible types are {}".format( action, [x.name.lower() for x in iter(ChatAction)] ))