Skip to content

Commit 513c4ff

Browse files
committed
can handle multiple posts in one message
1 parent d284cb5 commit 513c4ff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
@app.message(re.compile("(@\d*)"))
1818
# @app.message(re.compile("(hi|hello|hey)"))
1919
def message_hello(say, context):
20-
number = context['matches'][0].replace('@','')
21-
post_url = url + number
22-
# say() sends a message to the channel where the event was triggered
23-
say(f"The number is {number}. the url is: {post_url}")
20+
for match in context['matches']:
21+
number = match.replace('@','')
22+
post_url = url + number
23+
# say() sends a message to the channel where the event was triggered
24+
say(f"The number is {number}. the url is: {post_url}")
2425

2526

2627
# Run the app

0 commit comments

Comments
 (0)