Fix !wiki not accounting for PMs
This commit is contained in:
parent
806097444b
commit
2ee1110e41
@ -8481,16 +8481,25 @@ def wiki(cli, nick, chan, rest):
|
|||||||
|
|
||||||
# no arguments, just print a link to the wiki
|
# no arguments, just print a link to the wiki
|
||||||
if not rest:
|
if not rest:
|
||||||
cli.msg(chan, "https://github.com/lykoss/lykos/wiki")
|
if chan == nick:
|
||||||
|
pm(cli, nick, "https://github.com/lykoss/lykos/wiki")
|
||||||
|
else:
|
||||||
|
cli.msg(chan, "https://github.com/lykoss/lykos/wiki")
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
page = urllib.request.urlopen("https://raw.githubusercontent.com/wiki/lykoss/lykos/Home.md", timeout=2).read().decode("ascii", errors="replace")
|
page = urllib.request.urlopen("https://raw.githubusercontent.com/wiki/lykoss/lykos/Home.md", timeout=2).read().decode("ascii", errors="replace")
|
||||||
except (urllib.error.URLError, socket.timeout):
|
except (urllib.error.URLError, socket.timeout):
|
||||||
cli.notice(nick, "Request to https://github.com/lykoss/lykos/wiki timed out.")
|
if chan == nick:
|
||||||
|
pm(cli, nick, "Request to https://github.com/lykoss/lykos/wiki timed out.")
|
||||||
|
else:
|
||||||
|
cli.notice(nick, "Request to https://github.com/lykoss/lykos/wiki timed out.")
|
||||||
return
|
return
|
||||||
if not page:
|
if not page:
|
||||||
cli.notice(nick, "Could not open https://github.com/lykoss/lykos/wiki")
|
if chan == nick:
|
||||||
|
pm(cli, nick, "Could not open https://github.com/lykoss/lykos/wiki")
|
||||||
|
else:
|
||||||
|
cli.notice(nick, "Could not open https://github.com/lykoss/lykos/wiki")
|
||||||
return
|
return
|
||||||
|
|
||||||
query = re.escape(rest.strip())
|
query = re.escape(rest.strip())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user