Mattermost-server: Include '@username' in matterbuild's cutplugin slashcommand response

Created on 16 Jul 2020  路  1Comment  路  Source: mattermost/mattermost-server

When matterbuild鈥檚 cutplugin slash command is invoked, the command response does not include the user who triggers the command, which sometimes leads to confusion in the channel as to who invoked the command. Thus the proposal is to include @username in the responses for better visibility.

The POST request that hits the matterbuild service contains the username of the person who triggered the command. All there is required is to extract that data and include it in the command responses.

POST Request contains

channel_id=jux16pkewjrkfj3ehep1psxyxc&
channel_name=town-square&
command=%2Ftest&
response_url=http%3A%2F%2Flocalhost%3A8065%2Fhooks%2Fcommands%2Fxbrkb8p393gjpq5cawei7npije&
team_domain=test&
team_id=carya1qs77bemjup96ff538snh&
text=asd&
token=okwexkjpe7ygb8eq1ww58t483w&
user_id=aoa1agao6t8fmx3ikt1j9w5ybw&
user_name=somename
channel_mentions=\<"saepe-5", "aut-8"]
channel*mentions*ids=\["r3j6sby343fpfdxcbwqg95rfsa", "ehjj46yk7ifptr5bpfb966s6mc"]
user_mentions=\["aaron.peterson", "aaron.medina"]
user*mentions*ids=\["q5s3b7xzgprp5eid8h66j9epsy", "czwmumrmw7dfxecww7qibkkoor">

More details: https://docs.mattermost.com/developer/slash-commands.html#custom-slash-command

Messages to update:
https://github.com/mattermost/matterbuild/blob/master/server/server.go#L446
https://github.com/mattermost/matterbuild/blob/master/server/server.go#L491

Matterbuild repo: https://github.com/mattermost/matterbuild/


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-26990

Easy Good First Issue Help Wanted PR Exists TecGo

Most helpful comment

I'm willing to work on this, already opened a PR: https://github.com/mattermost/matterbuild/pull/46

>All comments

I'm willing to work on this, already opened a PR: https://github.com/mattermost/matterbuild/pull/46

Was this page helpful?
0 / 5 - 0 ratings