Skip to content

Commit

Permalink
summarize-topic: Use channel id instead of name.
Browse files Browse the repository at this point in the history
This avoid us from partially capturing channel name if it includes `-`.
  • Loading branch information
amanagr committed Dec 5, 2024
1 parent 1cbaa43 commit 08a21e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zulip/integrations/litellm/summarize-topic
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ if __name__ == "__main__":

base_url, narrow_hash = url.split("#")
narrow_hash_terms = narrow_hash.split("/")
channel = narrow_hash_terms[2].split("-")[1]
channel = int(narrow_hash_terms[2].split("-")[0])
topic = narrow_hash_terms[4]
channel = urllib.parse.unquote(channel.replace(".", "%"))
topic = urllib.parse.unquote(topic.replace(".", "%"))

narrow = [
Expand Down

0 comments on commit 08a21e3

Please sign in to comment.