From cb96ae10d63a80a440d8fd2949a3c3e4e79701af Mon Sep 17 00:00:00 2001 From: Twentysix Date: Sat, 2 Jul 2016 17:41:16 +0200 Subject: [PATCH] Support for long !urban definitions --- cogs/general.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cogs/general.py b/cogs/general.py index 7a0f321bb..3e325eeb0 100644 --- a/cogs/general.py +++ b/cogs/general.py @@ -199,7 +199,7 @@ class General: data += "Icon: {}\n".format(server.icon_url) data += "```" await self.bot.say(data) - + @commands.command() async def urban(self, *, search_terms : str, definition_number : int=1): """Urban Dictionary search @@ -227,8 +227,12 @@ class General: definition = result['list'][pos]['definition'] example = result['list'][pos]['example'] defs = len(result['list']) - await self.bot.say("**Definition #{} out of {}:\n**{}\n\n" - "**Example:\n**{}".format(pos+1, defs, definition, example)) + msg = ("**Definition #{} out of {}:\n**{}\n\n" + "**Example:\n**{}".format(pos+1, defs, definition, + example)) + msg = pagify(msg, ["\n"]) + for page in msg: + await self.bot.say(page) else: await self.bot.say("Your search terms gave no results.") except IndexError: