diff --git a/api/command.go b/api/command.go index b4c9bb6164..1e58308ad2 100644 --- a/api/command.go +++ b/api/command.go @@ -106,6 +106,7 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { parts := strings.Split(command, " ") trigger := parts[0][1:] + trigger = strings.ToLower(trigger) message := strings.Join(parts[1:], " ") provider := GetCommandProvider(trigger) @@ -286,6 +287,7 @@ func createCommand(c *Context, w http.ResponseWriter, r *http.Request) { return } + cmd.Trigger = strings.ToLower(cmd.Trigger) cmd.CreatorId = c.Session.UserId cmd.TeamId = c.TeamId diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx index f8bc615382..c025680434 100644 --- a/webapp/actions/channel_actions.jsx +++ b/webapp/actions/channel_actions.jsx @@ -24,7 +24,11 @@ export function goToChannel(channel) { } export function executeCommand(channelId, message, suggest, success, error) { - Client.executeCommand(channelId, message, suggest, success, error); + let msg = message; + + msg = msg.substring(0, msg.indexOf(' ')).toLowerCase() + msg.substring(msg.indexOf(' '), msg.length); + + Client.executeCommand(channelId, msg, suggest, success, error); } export function setChannelAsRead(channelIdParam) { diff --git a/webapp/components/integrations/components/add_command.jsx b/webapp/components/integrations/components/add_command.jsx index e72670e476..cf563875b9 100644 --- a/webapp/components/integrations/components/add_command.jsx +++ b/webapp/components/integrations/components/add_command.jsx @@ -72,7 +72,7 @@ export default class AddCommand extends React.Component { const command = { display_name: this.state.displayName, description: this.state.description, - trigger: this.state.trigger.trim(), + trigger: this.state.trigger.trim().toLowerCase(), url: this.state.url.trim(), method: this.state.method, username: this.state.username,