Skip to content

Commit

Permalink
fixed parsing function to include message_id
Browse files Browse the repository at this point in the history
  • Loading branch information
zibiax committed Apr 23, 2024
1 parent 762a402 commit b9b5b35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test_draftgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ def parse_slack_message_link(link):
path_parts = parsed_url.path.strip('/').split('/')
if len(path_parts) >= 3 and path_parts[-3] == 'archives':
channel_id = path_parts[-2]
return channel_id
message_id = path_parts[-1]
return channel_id, message_id
print("Error: Invalid Slack message link.")
return None


def retrieve_slack_message(channel_id, slack_token):
def retrieve_slack_message(channel_id, message_id, slack_token):
headers = {
"Authorization": f"Bearer {slack_token}",
}
# Construct the request data
data = {
"channel": channel_id,
"latest": message_id,
"limit": 1,
"inclusive": True
}
Expand Down

0 comments on commit b9b5b35

Please sign in to comment.