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

ignore @ mentions which are not meant for the bot itself #44

Closed
bb-Ricardo opened this issue Jul 2, 2020 · 5 comments
Closed

ignore @ mentions which are not meant for the bot itself #44

bb-Ricardo opened this issue Jul 2, 2020 · 5 comments
Milestone

Comments

@bb-Ricardo
Copy link
Owner

from #43

We have the bot in a shared channel with all lot of people who probably muted this channel, and sometimes you want to @ a person and you will get the response I didn't understand the command I would love a ignore character if a line starts with @ or # the line is not ment for the bot this would save some responses of the bot during a short convo about the problem like # I have acked the problem working on it or @here, working on it

@william-sy
Copy link

Thanks for making this a ticket!

@william-sy
Copy link

Currently, I have it like this. But I am not too happy about it just yet.
Screenshot 2020-07-03 at 13 39 11

The @ always ignores if the ignore_mentions is True or False (ideally the command definition dictionary get adjusted accordingly?)

But if you enable ignore_mentions then the mention function gets ignored and is send to the @ command. I did not really see a different way of doing it.

    # strip any mention "strings" from beginning of message, or ignore if desired.
    ignore=config["slack.ignore_mentions"]
    matches = re.search(mention_regex, slack_message)
    if matches and ignore == False:
        slack_message = matches.group(2).strip()
    elif matches and ignore == True:
        slack_message = "@"
  # This ideally gets ignored if ignore_menstions == False
  # Or should not be needed in the first place.
    {
        "name": "@",
        "shortcut": None,
        "short_description": "Please ignore me",
        "long_description": "This will ignore slack mentions to your team after the `@` mark.",
        "command_handler": "ignore_conversation"
    }

Perhaps you have a idea about it?

@bb-Ricardo bb-Ricardo added this to the 1.1.0 milestone Aug 13, 2020
@bb-Ricardo
Copy link
Owner Author

added to 'next-release'. Can you test it?

@william-sy
Copy link

Hi, I tested this and it seems to work perfectly! 👍

Screenshot 2020-11-09 at 13 39 09

Sorry for the late response!

@bb-Ricardo
Copy link
Owner Author

no problem, thank you for testing. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants