From be28b76e4a151689fb666c3dba4839af64bf34e5 Mon Sep 17 00:00:00 2001 From: Leonid Kozarin Date: Sun, 11 Nov 2018 15:42:10 +0300 Subject: [PATCH] Revert "Temporary fix a bug in the 'aiotg' library" This reverts commit 7a81b72b36ea49e33411770d86dc0d13c85b05b5 but the 'default_in_groups' mode will be still enabled. --- app/bot.py | 3 +-- app/fixed_aiotg.py | 22 ---------------------- requirements.txt | 2 +- 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 app/fixed_aiotg.py diff --git a/app/bot.py b/app/bot.py index 39c0b6f..c71f862 100755 --- a/app/bot.py +++ b/app/bot.py @@ -3,8 +3,7 @@ import os import asyncio from aiohttp import web -from aiotg import Chat, InlineQuery, CallbackQuery -from fixed_aiotg import Bot +from aiotg import Bot, Chat, InlineQuery, CallbackQuery from klocmod import LocalizationsContainer import msgdb diff --git a/app/fixed_aiotg.py b/app/fixed_aiotg.py deleted file mode 100644 index 71bd1b9..0000000 --- a/app/fixed_aiotg.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -Temporary fix a KeyError when processing the callback handler of an -inline message. - -See: https://github.com/szastupov/aiotg/issues/71 -""" -import re -import aiotg - - -class Bot(aiotg.Bot): - def _process_callback_query(self, query): - chat = aiotg.Chat.from_message(self, query["message"]) if "message" in query else None - cq = aiotg.CallbackQuery(self, query) - for patterns, handler in self._callbacks: - match = re.search(patterns, cq.data, re.I) - if match: - return handler(chat, cq, match) - - # make an assumption that the inline mode is mostly used in group chats - if chat and not chat.is_group() or self.default_in_groups: - return self._default_callback(chat, cq) diff --git a/requirements.txt b/requirements.txt index 89d891c..8298100 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -aiotg==0.9.7 +git+git://github.com/szastupov/aiotg@e1e018f483bcaa0b5a573c8ed22305331ab0ba37 aiohttp==3.0.5 klocmod==0.1.0