WordPress/matrix

Mention a group of contributors

Closed this issue · 10 comments

akirk commented

Environment

No response

Expected Behavior

We'd like to be able to ping a group of people with one mention, for example @learn-team.

Actual Behavior

Matrix doesn't support this. When bridged from Slack, such messages with a group ping contain something like this: <!subteam^ABC123>

Screenshots

No response

Additional Context

No response

akirk commented

We're planning to implement this using a bot that can listen to texts like above and it would then start a thread on the message and mention everyone the bot has stored in reference to this mention. We don't have details yet on how such a group would be configured.

I worry about doing the mention in a thread as it will then encourage the conversation to be threaded which is against the norms of some team.

akirk commented

I see, thanks for that opinion. I just suggested this to try and avoid a large list of mentions cluttering the room for larger groups. It is certainly possible to just post such a message directly in a room.

Perhaps there could be a switch for each team to determine whether a thread would be better or not? Training would probably prefer a thread at this point.

Earlier, the idea I had about @mentionsbot was it would hold the definition of what "groups" exist and configuration for each of them. Any existing member of a group can interact in a DM with this bot to add folks to the group !add ashfame or remove themselves !leave.

We can also have it work like @mentionsbot learn instead of / addition to @learn-team. This would make it a mention pill, similar to when a user is mentioned @ vs just text.

Regarding diff notification configurations, it can be:

  1. Mention all users in a thread
  2. Mention all users outside of thread
  3. @mentionsbot DM all users of the mentioned group with a link to where they were mentioned
  4. Each group can be just a room (Eg: #mentionsbot-learn) where all group mentions are posted with links.
akirk commented

Thanks @ashfame, these are some good ideas. I especially like how a dedicated room could be something like your notification center.

But since this is an important feature for many teams, I believe we should somewhat cut some corners for now and build a minimal viable bot first and then expand it later as we find we need it.

Specifically, I believe we should:

  1. Hardcode the lists in the bot for now, since it will live in https://github.com/wordpress/matrix-bots you can submit a PR if the list needs to be changed. This includes both the groupname → person to mention, as well as the people who can use those group pings.
  2. The bot should respond to the same syntax as on Slack to lower the learning curve. Thus @learn-team. We can later use a @mentionsbot syntax if we deem it useful. It should also react to the slack-bridged representation (I believe something like <!subteam^T123> so that mapping needs also to be hardcoded.
  3. The bot will do the mentioning by posting a message in the main room (not a thread) saying something: "Pinging all members of the Learn team" and uses the m.mentions property to "silently" mention all the people in the group.

This should do for a first version that fulfils the largest needs and that we can subsequently extend as needed. What do you think?

I also agree that forcing mentions into threads is suboptimal. More closely mimicking group @mentions like they exist in Slack is more optimal.

I like the plan above as a first step. Let's see how that goes 🎉

Agreed, let's give it a try and see how it works in reality and whether folks find is sufficient or not.

Documenting the progress here:

mentionsbot v1.0.0 went live earlier and works with defined keywords @keyword and with their slack subteam when pinged from slack side and message is carried over by slack bridge.

Groups are defined from this config file: https://github.com/WordPress/matrix-bots/blob/main/plugins/mentions/prod-config.yaml PRs can be submitted (Slack groups aren't synced yet)

By default it quotes the triggering message while pinging the members. And replies in a thread when it was triggered in a thread.

Screenshot 2023-12-15 at 10 32 19 AM

With mentionsbot v1.0.1 its now possible to choose preference of whether the triggering message should be quoted and if it should always be in a thread - https://github.com/WordPress/matrix-bots/pull/137/files#diff-e1abf82a82e706553a7ea895416ff4bd886a40ca6636acb9fef7ddb51d2af973