diff --git a/IRCServer.py b/IRCServer.py index 7143b730..414dbe6f 100644 --- a/IRCServer.py +++ b/IRCServer.py @@ -115,7 +115,6 @@ class Server(object): def has_user(self, nickname): return nickname.lower() in self.users def get_user(self, nickname): - print(self.users) if not self.has_user(nickname): new_user = IRCUser.User(nickname, self, self.bot) self.bot.events.on("new").on("user").call( diff --git a/modules/wikipedia.py b/modules/wikipedia.py index 0b1d3401..98f61714 100644 --- a/modules/wikipedia.py +++ b/modules/wikipedia.py @@ -11,13 +11,15 @@ class Module(object): def wikipedia(self, event): page = Utils.get_url(URL_WIKIPEDIA, get_params={ "action": "query", "prop": "extracts", - "titles": event["args"], "exsentences": "2", - "explaintext": "", "formatversion": "2", - "format": "json"}, json=True) + "titles": event["args"], "exintro": "", + "explaintext": "", "exchars": "500", + "redirects": "", "format": "json"}, json=True) if page: - if not "missing" in page["query"]["pages"][0]: - article = page["query"]["pages"][0] + pages = page["query"]["pages"] + article = list(pages.items())[0][1] + if not "missing" in article: title, info = article["title"], article["extract"] + info = info.replace("\n\n", " ").split("\n")[0] event["stdout"].write("%s: %s" % (title, info)) else: event["stderr"].write("No results found")