JackDotJS / OptiBot

(DISCONTINUED) The original Discord bot for OptiFine. https://discord.gg/3mMpcwW
1 stars 0 forks source link

Mojira issue tracker #161

Open ZenithRogue opened 4 years ago

ZenithRogue commented 4 years ago

Mentioning an issue in a message image

Will return that issue as a link, with some basic info image

Mentioning multiple issues in a single message should return all (limit to 4), omitting repeats image

Mojang doesnt have any API documented for Mojira, but I found the Jira API from Atlassian. Just slap https://jira.atlassian.com/rest/api/latest/issue/JRA-9.json together with the Mojira host, and you get https://bugs.mojang.com/rest/api/latest/issue/MC-192845.json

Object paths for the tracker demonstrated above are as follows:

Title: fields.summary Issue since: fields.versions[0].name Status: fields.status.name

Issue permalink

Upon first glance, it may be tempting to use https://bugs.mojang.com/projects/MC/issues/MC-192845 to link back to the issue, but for some fuck-off reason this will often fail, and link back to the most recently posted issue.

So instead we will use https://bugs.mojang.com/browse/MC-192845 as a permalink to the issue

Regular Expression

here is the regex match for ya /(?<!\S)MC-([0-9]{3,6})(?!\S)/g

ZenithRogue commented 3 years ago

Plz :crie: