mirror of https://github.com/zulip/zulip.git
Merge branch 'fix-issue-19589' of github.com:salandei/zulip into fix-issue-19589
This commit is contained in:
commit
4161bebd97
|
@ -149,6 +149,10 @@ Here's how we fill in the fields that a Slack-format webhook expects:
|
|||
<tr>
|
||||
<td><code>text</code></td>
|
||||
<td>The content of the message (in Markdown)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>command</code></td>
|
||||
<td>The bot mention</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>trigger_word</code></td>
|
||||
|
@ -173,8 +177,8 @@ The above data is posted as list of tuples (not JSON), here's an example:
|
|||
('timestamp', 1532078950),
|
||||
('user_id', 'U21'),
|
||||
('user_name', 'Full Name'),
|
||||
('command', '@**test**'),
|
||||
('text', 'The content of the message'),
|
||||
('command', '/test'),
|
||||
('text', 'content'),
|
||||
('trigger_word', 'mention'),
|
||||
('service_id', 27)]
|
||||
```
|
||||
|
|
|
@ -137,7 +137,7 @@ class SlackOutgoingWebhookService(OutgoingWebhookServiceInterface):
|
|||
command_re = r"(@\*\*[\w]+\*\*)"
|
||||
text = event["command"]
|
||||
message_parts = re.split(command_re, text)
|
||||
if re.fullmatch(command_re, message_parts[1]):
|
||||
if len(message_parts) == 3 and re.fullmatch(command_re, message_parts[1]):
|
||||
slash_command = "/" + message_parts[1][3:-2]
|
||||
text = message_parts[2].strip()
|
||||
|
||||
|
|
Loading…
Reference in New Issue