Skip to content

Commit

Permalink
Merge pull request #105 from ghostty-org/ignore-unknown-mentions
Browse files Browse the repository at this point in the history
fix: ignore unknown entity mentions
  • Loading branch information
trag1c authored Jan 1, 2025
2 parents 72f440a + 2f7d45c commit 674ea33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/components/entity_mentions.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def _get_entities(message: discord.Message) -> tuple[str, int]:
entities: list[str] = []
for repo_name, number_ in matches:
number = int(number_)
kind, entity = entity_cache[cast(RepoName, repo_name or "main"), number]
try:
kind, entity = entity_cache[cast(RepoName, repo_name or "main"), number]
except KeyError:
continue
if entity.number < 10 and repo_name is None:
# Ignore single-digit mentions (likely a false positive)
continue
Expand Down

0 comments on commit 674ea33

Please sign in to comment.