GitHubBotIdentityResolver
public final class GitHubBotIdentityResolver
io/agentscope/extensions/channel/github/GitHubBotIdentityResolver.java:37–100GitHub Bot 身份解析器,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.github 包。核心成员包括 refresh、botUserId、botLogin、GitHubBotIdentityResolver。
Resolves the bot's GitHub user id (and login) for the configured PAT by calling
GET /user. Used for bot-loop self-detection in the webhook handler — when a
webhook delivers a comment authored by the bot itself, the channel must drop it instead of
looping forever.
The lookup is best-effort: a network failure does not block startup. The resolved id is
cached for the lifetime of the channel and accessed via #botUserId().
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public GitHubBotIdentityResolver(String apiBase, String token, String botLoginOverride) | 初始化 `GitHubBotIdentityResolver` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void refresh() | 执行刷新相关操作。 Synchronously attempts to resolve `GET /user` and cache the response. |
public long botUserId() | 返回 `botUserId` 结果。 Returns the bot's numeric user id, or `-1` if unresolved. |
public String botLogin() | 返回 `botLogin` 结果。 Returns the bot's login (handle), or null if unresolved. |
构造器详情Constructor Detail
GitHubBotIdentityResolver
public GitHubBotIdentityResolver(String apiBase, String token, String botLoginOverride)
初始化 GitHubBotIdentityResolver 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiBase | String | API 基类(类型 `String`)。The api base. |
token | String | 令牌(类型 `String`)。The token. |
botLoginOverride | String | bot Login Override(类型 `String`)。The bot login override. |
io/agentscope/extensions/channel/github/GitHubBotIdentityResolver.java:46–52方法详情Method Detail
refresh
public void refresh()
执行刷新相关操作。
Synchronously attempts to resolve GET /user and cache the response.
io/agentscope/extensions/channel/github/GitHubBotIdentityResolver.java:58–85botUserId
public long botUserId()
返回 botUserId 结果。
Returns the bot's numeric user id, or -1 if unresolved.
longio/agentscope/extensions/channel/github/GitHubBotIdentityResolver.java:88–90botLogin
public String botLogin()
返回 botLogin 结果。
Returns the bot's login (handle), or null if unresolved.
Stringio/agentscope/extensions/channel/github/GitHubBotIdentityResolver.java:93–95