Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,13 +62,13 @@ async def on_message(message):
|
|
| 62 |
try:
|
| 63 |
# title
|
| 64 |
response = slack_client.chat_postMessage(
|
| 65 |
-
channel=
|
| 66 |
text=f"New post in {message.channel.name} by {message.author}:\n*{title}*"
|
| 67 |
)
|
| 68 |
# reply in thread
|
| 69 |
thread_ts = response['ts']
|
| 70 |
slack_client.chat_postMessage(
|
| 71 |
-
channel=
|
| 72 |
text=content,
|
| 73 |
thread_ts=thread_ts
|
| 74 |
)
|
|
@@ -79,7 +79,7 @@ async def on_message(message):
|
|
| 79 |
async def post_to_slack(author, content, channel, url, slack_mention, trigger):
|
| 80 |
try:
|
| 81 |
response = slack_client.chat_postMessage(
|
| 82 |
-
channel=
|
| 83 |
text=f"{slack_mention} (for the keyword -> '{trigger}')\nFrom {author} in channel #{channel}: {content}\n{url}"
|
| 84 |
)
|
| 85 |
except SlackApiError as e:
|
|
|
|
| 62 |
try:
|
| 63 |
# title
|
| 64 |
response = slack_client.chat_postMessage(
|
| 65 |
+
channel=SLACK_CHANNEL_ID,
|
| 66 |
text=f"New post in {message.channel.name} by {message.author}:\n*{title}*"
|
| 67 |
)
|
| 68 |
# reply in thread
|
| 69 |
thread_ts = response['ts']
|
| 70 |
slack_client.chat_postMessage(
|
| 71 |
+
channel=SLACK_CHANNEL_ID,
|
| 72 |
text=content,
|
| 73 |
thread_ts=thread_ts
|
| 74 |
)
|
|
|
|
| 79 |
async def post_to_slack(author, content, channel, url, slack_mention, trigger):
|
| 80 |
try:
|
| 81 |
response = slack_client.chat_postMessage(
|
| 82 |
+
channel=SLACK_CHANNEL_ID,
|
| 83 |
text=f"{slack_mention} (for the keyword -> '{trigger}')\nFrom {author} in channel #{channel}: {content}\n{url}"
|
| 84 |
)
|
| 85 |
except SlackApiError as e:
|