Skip to content

Commit

Permalink
Attempt to fix #71
Browse files Browse the repository at this point in the history
  • Loading branch information
szastupov committed Nov 11, 2018
1 parent 7a6c2e6 commit e1e018f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aiotg/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,14 +651,14 @@ def _process_inline_query(self, query):
return self._default_inline(iq)

def _process_callback_query(self, query):
chat = Chat.from_message(self, query["message"])
chat = Chat.from_message(self, query["message"]) if "message" in query else None
cq = CallbackQuery(self, query)
for patterns, handler in self._callbacks:
match = re.search(patterns, cq.data, re.I)
if match:
return handler(chat, cq, match)

if not chat.is_group() or self.default_in_groups:
if chat and not chat.is_group() or self.default_in_groups:
return self._default_callback(chat, cq)

def _process_pre_checkout_query(self, query):
Expand Down

0 comments on commit e1e018f

Please sign in to comment.