Skip to content

Commit e4a3260

Browse files
authored
Merge pull request mattmakai#151 from aoberoi/update-slack-bot-tut-regex
makes username regex capture group non-greedy, fixes mattmakai#150
2 parents cadd0d8 + 5c12f22 commit e4a3260

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/posts/160604-build-first-slack-bot-python.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ variable values and then instantiate the Slack client.
128128
# constants
129129
RTM_READ_DELAY = 1 # 1 second delay between reading from RTM
130130
EXAMPLE_COMMAND = "do"
131-
MENTION_REGEX = "^<@(|[WU].+)>(.*)"
131+
MENTION_REGEX = "^<@(|[WU].+?)>(.*)"
132132

133133

134134
The code instantiates the `SlackClient` client with our `SLACK_BOT_TOKEN`
@@ -263,7 +263,7 @@ starterbot_id = None
263263
# constants
264264
RTM_READ_DELAY = 1 # 1 second delay between reading from RTM
265265
EXAMPLE_COMMAND = "do"
266-
MENTION_REGEX = "^<@(|[WU].+)>(.*)"
266+
MENTION_REGEX = "^<@(|[WU].+?)>(.*)"
267267

268268
def parse_bot_commands(slack_events):
269269
"""

0 commit comments

Comments
 (0)