From 2ee1110e41ed05ea25ad8915218260f08cc44b67 Mon Sep 17 00:00:00 2001 From: "Vgr E. Barry" Date: Mon, 2 Nov 2015 21:23:55 -0500 Subject: [PATCH] Fix !wiki not accounting for PMs --- src/wolfgame.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/wolfgame.py b/src/wolfgame.py index 87d784c..0c27edc 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -8481,16 +8481,25 @@ def wiki(cli, nick, chan, rest): # no arguments, just print a link to the wiki 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 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): - 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 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 query = re.escape(rest.strip())