@@ -337,7 +337,7 @@ async def handle_bot_mention(event, gh, *args, context, **kwargs):
337337 """Respond when someone mentions @mybot"""
338338 mention = context.mention
339339 issue_url = event.data["issue"]["comments_url"]
340-
340+
341341 await gh.post(
342342 issue_url,
343343 data={"body": f"Hello! You mentioned me at position {mention.position}"}
@@ -379,7 +379,7 @@ def handle_bot_mention(event, gh, *args, context, **kwargs):
379379 """Respond when someone mentions @mybot"""
380380 mention = context.mention
381381 issue_url = event.data["issue"]["comments_url"]
382-
382+
383383 gh.post(
384384 issue_url,
385385 data={"body": f"Hello! You mentioned me at position {mention.position}"}
@@ -578,19 +578,19 @@ Each handler receives a `context` parameter with detailed information about the
578578@gh.mention(username=" mybot" )
579579async def handle_mention(event, gh, * args, context, ** kwargs):
580580 mention = context.mention
581-
581+
582582 # Access mention details
583583 print(f" Username: {mention.username}" ) # "mybot"
584584 print(f"Position: {mention.position}") # Character position in comment
585585 print(f"Line: {mention.line_info.lineno}") # Line number (1-based)
586586 print(f"Line text: {mention.line_info.text}") # Full text of the line
587-
587+
588588 # Navigate between mentions in the same comment
589589 if mention.previous_mention:
590590 print(f"Previous: @{mention.previous_mention.username}")
591591 if mention.next_mention:
592592 print(f"Next: @{mention.next_mention.username}")
593-
593+
594594 # Check the scope (ISSUE, PR, or COMMIT)
595595 print(f"Scope: {context.scope}")
596596` ` `
@@ -646,7 +646,7 @@ The mention parser follows GitHub's rules:
646646Examples:
647647```
648648@bot help ✓ Detected
649- Hey @bot can you help? ✓ Detected
649+ Hey @bot can you help? ✓ Detected
650650@deploy-bot start ✓ Detected
651651See @user' s comment ✓ Detected
652652
@@ -665,7 +665,7 @@ When a comment contains multiple mentions, each matching mention triggers a sepa
665665@gh.mention(username=re.compile(r" .*-bot" ))
666666async def handle_bot_mention(event, gh, * args, context, ** kwargs):
667667 mention = context.mention
668-
668+
669669 # For comment: "@deploy-bot start @test-bot validate @user check"
670670 # This handler is called twice:
671671 # 1. For @deploy-bot (mention.username = "deploy-bot")
0 commit comments