From 1aa3c6b3b16c3fd094810a2b0c2db562f7f5f7a4 Mon Sep 17 00:00:00 2001 From: Emil Hammarstrom Date: Mon, 8 Feb 2016 11:18:08 +0100 Subject: [PATCH] Accidently left some imgur code in general.py --- cogs/general.py | 19 ------------------- cogs/image.py | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/cogs/general.py b/cogs/general.py index 3a0e4c08d..bbaffb01b 100644 --- a/cogs/general.py +++ b/cogs/general.py @@ -6,7 +6,6 @@ import datetime import time import aiohttp import asyncio -from imgurpython import ImgurClient settings = {"POLL_DURATION" : 60} @@ -175,24 +174,6 @@ class General: except: await self.bot.say("Error.") - @commands.command(no_pm=True) - async def imgur(self, *text): - """Retrieves a random imgur picture. - If a link combination e.g. As3DsA4 is provided it will try to retrieve that image.""" - imgurclient = ImgurClient("", "") - if text == (): - rand = randint(0, 59) #60 results per generated page - items = imgurclient.gallery_random(page=0) - await self.bot.say(items[rand].link) - #elif text == "viral top": - #items = imgurclient.gallery(section='hot', sort='viral', page=0, window='day', show_viral=True) - #await self.bot.say(items[0].link) - #await self.bot.say(items[1].link) - #await self.bot.say(items[2].link) - #else: - #item = imgurclient.get_image(text) - #await self.bot.say(item.link) - @commands.command(pass_context=True, no_pm=True) async def poll(self, ctx, *text): """Starts/stops a poll diff --git a/cogs/image.py b/cogs/image.py index c79e7be69..17821ba22 100644 --- a/cogs/image.py +++ b/cogs/image.py @@ -38,7 +38,7 @@ class Image: await self.bot.say("Only top or new is a valid subcommand.") return items = imgurclient.subreddit_gallery(text[0], sort=imgSort, window='day', page=0) - if (len(items) < 1): + if (len(items) < 3): await self.bot.say("This subreddit section does not exist, try 'funny'") else: await self.bot.say("{} {} {}".format(items[0].link, items[1].link, items[2].link))