use reply() in !wiki
This commit is contained in:
parent
a2cd0d15e2
commit
7184a02d54
@ -8145,25 +8145,16 @@ 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:
|
||||||
if chan == nick:
|
reply(cli, nick, chan, "https://github.com/lykoss/lykos/wiki")
|
||||||
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):
|
||||||
if chan == nick:
|
reply(cli, nick, chan, messages["wiki_request_timed_out"], private=True)
|
||||||
pm(cli, nick, messages["wiki_request_timed_out"])
|
|
||||||
else:
|
|
||||||
cli.notice(nick, messages["wiki_request_timed_out"])
|
|
||||||
return
|
return
|
||||||
if not page:
|
if not page:
|
||||||
if chan == nick:
|
reply(cli, nick, chan, messages["wiki_no_open"], private=True)
|
||||||
pm(cli, nick, messages["wiki_no_open"])
|
|
||||||
else:
|
|
||||||
cli.notice(nick, messages["wiki_no_open"])
|
|
||||||
return
|
return
|
||||||
|
|
||||||
query = re.escape(rest.strip())
|
query = re.escape(rest.strip())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user