Fix !wiki not accounting for PMs
This commit is contained in:
parent
806097444b
commit
2ee1110e41
@ -8481,15 +8481,24 @@ def wiki(cli, nick, chan, rest):
|
||||
|
||||
# no arguments, just print a link to the wiki
|
||||
if not rest:
|
||||
if chan == nick:
|
||||
pm(cli, nick, "https://github.com/lykoss/lykos/wiki")
|
||||
else:
|
||||
cli.msg(chan, "https://github.com/lykoss/lykos/wiki")
|
||||
return
|
||||
|
||||
try:
|
||||
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):
|
||||
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
|
||||
if not page:
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user