forked from Stan/limnoria-wfg
Resolve issue ids using Gitea instead of Trac
This commit is contained in:
parent
562f8f2cc6
commit
1b5d10d676
@ -45,7 +45,7 @@ def configure(advanced):
|
||||
conf.registerPlugin('wfg', True)
|
||||
|
||||
wfg.ticketUrl.setValue(
|
||||
something("Specify the URL of the ticketing system instance.", default="https://trac.wildfiregames.com/"))
|
||||
something("Specify the URL of the ticketing system instance.", default="https://gitea.wildfiregames.com/0ad/0ad/issues/"))
|
||||
|
||||
wfg.channels.setValue(
|
||||
anything("On which irc channels the bot should answer to #. If empty, prints on each joined channel.", default="", acceptEmpty=True))
|
||||
|
@ -75,7 +75,7 @@ class wfg(callbacks.Plugin):
|
||||
if matchobj is not None:
|
||||
ticket_number = matchobj.group(0).lstrip('#')
|
||||
ticket_url = self.registryValue('ticketUrl')
|
||||
url = f'{ticket_url.rstrip("/")}/ticket/{ticket_number}'
|
||||
url = f'{ticket_url.rstrip("/")}/{ticket_number}'
|
||||
|
||||
# Fetch the title of the ticket page
|
||||
try:
|
||||
@ -85,11 +85,11 @@ class wfg(callbacks.Plugin):
|
||||
parser.feed(html)
|
||||
title = parser.title if parser.title else "No title found"
|
||||
# Clean up the title if necessary
|
||||
title = re.sub(r'\s*–\s*Wildfire Games\s*$', '', title)
|
||||
title = re.sub(r'\s-\s0ad\s-\s*Wildfire Games\s*$', '', title)
|
||||
except Exception as e:
|
||||
return
|
||||
|
||||
response = f'{title} – {url}'
|
||||
response = f'{title} – {response.url}'
|
||||
irc.queueMsg(ircmsgs.privmsg(channel, response))
|
||||
|
||||
Class = wfg
|
||||
|
Loading…
Reference in New Issue
Block a user