mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
Accidently left some imgur code in general.py
This commit is contained in:
parent
732fde6ae7
commit
1aa3c6b3b1
@ -6,7 +6,6 @@ import datetime
|
|||||||
import time
|
import time
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import asyncio
|
import asyncio
|
||||||
from imgurpython import ImgurClient
|
|
||||||
|
|
||||||
settings = {"POLL_DURATION" : 60}
|
settings = {"POLL_DURATION" : 60}
|
||||||
|
|
||||||
@ -175,24 +174,6 @@ class General:
|
|||||||
except:
|
except:
|
||||||
await self.bot.say("Error.")
|
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)
|
@commands.command(pass_context=True, no_pm=True)
|
||||||
async def poll(self, ctx, *text):
|
async def poll(self, ctx, *text):
|
||||||
"""Starts/stops a poll
|
"""Starts/stops a poll
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class Image:
|
|||||||
await self.bot.say("Only top or new is a valid subcommand.")
|
await self.bot.say("Only top or new is a valid subcommand.")
|
||||||
return
|
return
|
||||||
items = imgurclient.subreddit_gallery(text[0], sort=imgSort, window='day', page=0)
|
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'")
|
await self.bot.say("This subreddit section does not exist, try 'funny'")
|
||||||
else:
|
else:
|
||||||
await self.bot.say("{} {} {}".format(items[0].link, items[1].link, items[2].link))
|
await self.bot.say("{} {} {}".format(items[0].link, items[1].link, items[2].link))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user