lunarflu HF staff commited on
Commit
3c830fa
1 Parent(s): cb7cea6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -121,23 +121,23 @@ async def on_message(message):
121
  except SlackApiError as e:
122
  print(f"Error posting to Slack: {e.response['error']}")
123
 
124
- def find_slack_thread_ts(thread_id):
125
- # search for a Slack thread based on Discord thread_id"""
126
- try:
127
- response = slack_client.conversations_history(
128
- channel=SLACK_CHANNEL_ID_TEST,
129
- limit=1000 # adjustable
130
- )
131
- messages = response['messages']
132
-
133
- for message in messages:
134
- if f"Discord Thread ID: {thread_id}" in message['text']:
135
- return message['ts']
136
-
137
- except SlackApiError as e:
138
- print(f"Error fetching Slack messages: {e.response['error']}")
139
-
140
- return None
141
 
142
 
143
 
 
121
  except SlackApiError as e:
122
  print(f"Error posting to Slack: {e.response['error']}")
123
 
124
+ def find_slack_thread_ts(thread_id):
125
+ # search for a Slack thread based on Discord thread_id"""
126
+ try:
127
+ response = slack_client.conversations_history(
128
+ channel=SLACK_CHANNEL_ID_TEST,
129
+ limit=1000 # adjustable
130
+ )
131
+ messages = response['messages']
132
+
133
+ for message in messages:
134
+ if f"Discord Thread ID: {thread_id}" in message['text']:
135
+ return message['ts']
136
+
137
+ except SlackApiError as e:
138
+ print(f"Error fetching Slack messages: {e.response['error']}")
139
+
140
+ return None
141
 
142
 
143