Skip to content

Commit

Permalink
fix message processing
Browse files Browse the repository at this point in the history
  • Loading branch information
nonamenix committed Mar 6, 2019
1 parent 1288295 commit 6aaa56e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.5.11

* fix message processing

### 0.5.10

* fix bot without mongo_url
Expand Down
6 changes: 5 additions & 1 deletion bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ def _process_message(self, message):

chat = Chat.from_message(self, message)

if "text" in message and message["from"]["id"] in self.moderators:
if (
"text" in message
and "from" in message
and message["from"]["id"] in self.moderators
):
for patterns, handler in self._moderators_commands:
m = re.search(patterns, message["text"], re.I)
if m:
Expand Down

0 comments on commit 6aaa56e

Please sign in to comment.