MCPcopy Create free account
hub / github.com/pollinations/pollinations / tool_subscribe_issue

Function tool_subscribe_issue

apps/polly/src/services/github.py:1552–1589  ·  view source on GitHub ↗

Subscribe a user to issue notifications.

(
    issue_number: int,
    user_id: int,
    channel_id: int,
    guild_id: int = None,
)

Source from the content-addressed store, hash-verified

1550
1551
1552async def tool_subscribe_issue(
1553 issue_number: int,
1554 user_id: int,
1555 channel_id: int,
1556 guild_id: int = None,
1557) -> dict:
1558 """Subscribe a user to issue notifications."""
1559 # Verify issue exists first - reject subscription to non-existent issues
1560 issue = await github_graphql.get_issue_full(issue_number)
1561 if not issue or "error" in issue:
1562 return {
1563 "success": False,
1564 "message": f"Issue #{issue_number} does not exist.",
1565 }
1566
1567 initial_state = {
1568 "state": issue.get("state", "open"),
1569 "comments_count": issue.get("comments_count", 0),
1570 "labels": issue.get("labels", []),
1571 }
1572
1573 success = await subscription_manager.subscribe(
1574 user_id=user_id,
1575 issue_number=issue_number,
1576 channel_id=channel_id,
1577 guild_id=guild_id,
1578 initial_state=initial_state,
1579 )
1580
1581 if success:
1582 return {
1583 "success": True,
1584 "message": f"✅ Subscribed to **#{issue_number}**: {issue.get('title', 'Unknown')}\n\nYou'll get DM notifications when there are updates!",
1585 }
1586 return {
1587 "success": False,
1588 "message": f"❌ Failed to subscribe to #{issue_number}. Please try again.",
1589 }
1590
1591
1592async def tool_unsubscribe_issue(

Callers

nothing calls this directly

Calls 3

get_issue_fullMethod · 0.80
subscribeMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected