From 328258d2af82a030993aa13195a8b1962d080d75 Mon Sep 17 00:00:00 2001 From: Davte Date: Mon, 26 Nov 2018 17:32:07 +0100 Subject: [PATCH] Accept dict subclasses (such as OrderedDict) as update and user_record --- davtelepot/custombot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/davtelepot/custombot.py b/davtelepot/custombot.py index 6abe71b..26503c0 100644 --- a/davtelepot/custombot.py +++ b/davtelepot/custombot.py @@ -479,14 +479,14 @@ class Bot(telepot.aio.Bot, Gettable): """ if ( language is None - and type(update) is dict + and isinstance(update, dict) and 'from' in update and 'language_code' in update['from'] ): language = update['from']['language_code'] if ( language is None - and type(user_record) is dict + and isinstance(user_record, dict) and 'language_code' in user_record ): language = user_record['language_code']