Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log filtered command name #1631

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion errbot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def some_filter(self, msg, cmd, args, dry_run):
command is authorized or not.
\"\"\"
# If wishing to block the incoming command:
return None, None, None
return None, cmd, args
# Otherwise pass data through to the (potential) next filter:
return msg, cmd, args

Expand Down
4 changes: 2 additions & 2 deletions errbot/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def _process_command_filters(
for cmd_filter in self.command_filters:
msg, cmd, args = cmd_filter(msg, cmd, args, dry_run)
if msg is None:
return None, None, None
return None, cmd, args
return msg, cmd, args
except Exception:
log.exception(
Expand All @@ -440,7 +440,7 @@ def _process_command(self, msg, cmd, args, match):
# first it must go through the command filters
msg, cmd, args = self._process_command_filters(msg, cmd, args, False)
if msg is None:
log.info("Command %s blocked or deferred.", cmd)
log.info("Command \"%s\" blocked or deferred.", cmd)
return

frm = msg.frm
Expand Down