[Feature] Listen for standalone ticket references
dgw opened this issue · comments
A number of IRC bots that support GitHub also detect issue/PR references without requiring that the reference be a URL. For example, if someone says, Yeah, that happens because of a regression in #9001
, the bot will dig up the details for #9001
and send them to the channel.
sopel-github doesn't currently do this, but it would probably be a useful function for Sopel's own IRC channel, since issue numbers get thrown around there a fair bit. An admin-/op-only command like .gh-hook
would need to be added for configuring the target repo for any given channel.
Conveniently, GitHub's issues
API endpoint returns data for PRs too, so there's no need to check which type an in-text reference to #9001
is before fetching its info. (The id
returned for a PR differs depending on which endpoint is used, but we don't use that particular property anywhere.)
From IRC discussion with @dgw:
Ideal would be to default both the github user and repo to what's configured, so that all three of these would work with sopel-irc/sopel
as the configured repo:
#123
->sopel-irc/sopel#123
sopel.chat#555
->sopel-irc/sopel.chat#555
SpiceBot/SpiceBot#432
(unchanged)