solved reacts -> live
Browse files
app.py
CHANGED
@@ -113,7 +113,7 @@ async def on_message(message):
|
|
113 |
if discord_thread_id in thread_mapping:
|
114 |
slack_thread_ts = thread_mapping[discord_thread_id]
|
115 |
# post to slack only if thread already exists
|
116 |
-
post_to_slack_forum_version(message,
|
117 |
|
118 |
await bot.process_commands(message)
|
119 |
|
@@ -124,7 +124,7 @@ async def on_thread_create(thread):
|
|
124 |
if isinstance(thread.parent, discord.ForumChannel) and thread.parent.id in {ASK_FOR_HELP_CHANNEL_ID, GRADIO_CHANNEL_ID, ARGILLA_HELP_CHANNEL_ID, DATA_DISCUSSIONS_CHANNEL_ID}:
|
125 |
discord_thread_id = thread.id
|
126 |
slack_thread_ts = post_to_slack_create_thread(
|
127 |
-
|
128 |
f"New forum thread started in {thread.parent.name} by {thread.owner}: *{thread.name}*\n"
|
129 |
f"{thread.jump_url}"
|
130 |
)
|
@@ -187,7 +187,7 @@ async def on_thread_update(before, after):
|
|
187 |
def react_to_slack_message(thread_ts, emoji):
|
188 |
try:
|
189 |
response = slack_client.reactions_add(
|
190 |
-
channel=
|
191 |
name=emoji,
|
192 |
timestamp=thread_ts
|
193 |
)
|
|
|
113 |
if discord_thread_id in thread_mapping:
|
114 |
slack_thread_ts = thread_mapping[discord_thread_id]
|
115 |
# post to slack only if thread already exists
|
116 |
+
post_to_slack_forum_version(message, SLACK_CHANNEL_ID, message.content, message.author, thread_ts=slack_thread_ts)
|
117 |
|
118 |
await bot.process_commands(message)
|
119 |
|
|
|
124 |
if isinstance(thread.parent, discord.ForumChannel) and thread.parent.id in {ASK_FOR_HELP_CHANNEL_ID, GRADIO_CHANNEL_ID, ARGILLA_HELP_CHANNEL_ID, DATA_DISCUSSIONS_CHANNEL_ID}:
|
125 |
discord_thread_id = thread.id
|
126 |
slack_thread_ts = post_to_slack_create_thread(
|
127 |
+
SLACK_CHANNEL_ID,
|
128 |
f"New forum thread started in {thread.parent.name} by {thread.owner}: *{thread.name}*\n"
|
129 |
f"{thread.jump_url}"
|
130 |
)
|
|
|
187 |
def react_to_slack_message(thread_ts, emoji):
|
188 |
try:
|
189 |
response = slack_client.reactions_add(
|
190 |
+
channel=SLACK_CHANNEL_ID,
|
191 |
name=emoji,
|
192 |
timestamp=thread_ts
|
193 |
)
|