Consolidated issue tool - handles ALL issue operations based on action.
(
action: str,
issue_number: int = None,
keywords: str = None,
state: str = "open",
title: str = None,
description: str = None,
body: str = None,
comment: str = None,
comment_id: int = None, # For edit_comment/delete_comment actions
reason: str = "completed",
labels: list[str] = None,
assignees: list[str] = None,
milestone: str = None,
lock: bool = None,
related_issues: list[int] = None,
relationship: str = None,
discord_username: str = None,
include_comments: bool = False,
limit: int = 10,
child_issue_number: int = None, # For sub-issue actions
edit_index: int = None, # For get_history - get full diff for specific edit (0=most recent)
# Injected by bot.py for subscriptions (legacy params kept for compatibility)
user_id: int = 0,
channel_id: int = 0,
guild_id: int = None,
reporter: str = "Discord User",
user_role_ids: list[int] = None,
# New: context dict injected by pollinations client
_context: dict = None,
**kwargs, # Catch any extra args
)
| 982 | |
| 983 | |
| 984 | async def tool_github_issue( |
| 985 | action: str, |
| 986 | issue_number: int = None, |
| 987 | keywords: str = None, |
| 988 | state: str = "open", |
| 989 | title: str = None, |
| 990 | description: str = None, |
| 991 | body: str = None, |
| 992 | comment: str = None, |
| 993 | comment_id: int = None, # For edit_comment/delete_comment actions |
| 994 | reason: str = "completed", |
| 995 | labels: list[str] = None, |
| 996 | assignees: list[str] = None, |
| 997 | milestone: str = None, |
| 998 | lock: bool = None, |
| 999 | related_issues: list[int] = None, |
| 1000 | relationship: str = None, |
| 1001 | discord_username: str = None, |
| 1002 | include_comments: bool = False, |
| 1003 | limit: int = 10, |
| 1004 | child_issue_number: int = None, # For sub-issue actions |
| 1005 | edit_index: int = None, # For get_history - get full diff for specific edit (0=most recent) |
| 1006 | # Injected by bot.py for subscriptions (legacy params kept for compatibility) |
| 1007 | user_id: int = 0, |
| 1008 | channel_id: int = 0, |
| 1009 | guild_id: int = None, |
| 1010 | reporter: str = "Discord User", |
| 1011 | user_role_ids: list[int] = None, |
| 1012 | # New: context dict injected by pollinations client |
| 1013 | _context: dict = None, |
| 1014 | **kwargs, # Catch any extra args |
| 1015 | ) -> dict: |
| 1016 | """ |
| 1017 | Consolidated issue tool - handles ALL issue operations based on action. |
| 1018 | """ |
| 1019 | # Extract context if provided (new approach - avoids re-registering handlers per message) |
| 1020 | is_admin = False |
| 1021 | is_collaborator = False |
| 1022 | context_user_id = None |
| 1023 | context_user_name = None |
| 1024 | if _context: |
| 1025 | is_admin = _context.get("is_admin", False) |
| 1026 | is_collaborator = _context.get("is_collaborator", False) |
| 1027 | context_user_id = _context.get("user_id") |
| 1028 | context_user_name = _context.get("user_name") |
| 1029 | user_id = _context.get("user_id", user_id) |
| 1030 | channel_id = _context.get("channel_id", channel_id) |
| 1031 | guild_id = _context.get("guild_id", guild_id) |
| 1032 | reporter = _context.get("reporter", reporter) |
| 1033 | user_role_ids = _context.get("user_role_ids", user_role_ids) |
| 1034 | |
| 1035 | action = action.lower() |
| 1036 | |
| 1037 | # COLLABORATOR ACTIONS - allowed for users with collaborator role (matches git collaborator perms) |
| 1038 | # close, reopen, label, unlabel, assign, unassign — same as GitHub collaborator access |
| 1039 | COLLABORATOR_ACTIONS = { |
| 1040 | "close", |
| 1041 | "reopen", |
nothing calls this directly
no test coverage detected