Skip to content

Commit

Permalink
Implemented Imgur command
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonah Pierce committed Mar 17, 2020
1 parent a810c9a commit ca1cc0f
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions cogs/misc/misc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from datetime import datetime
from discord import Embed
from discord.ext.commands import Cog, group, command, Paginator
from functools import partial
from imdb import IMDb
from os import environ
from random import choice, randint
from requests import get
from urllib.parse import quote
Expand All @@ -10,7 +12,7 @@
from cogs.globals import loop

from util.database.database import database
from util.discord import process_scrolling
from util.discord import process_scrolling, process_page_reactions
from util.functions import get_embed_color
from util.imgur import Imgur
from util.string import generate_random_string
Expand Down Expand Up @@ -363,12 +365,29 @@ async def imgur(self, ctx, *params):
),
value = paginator.pages[i]
)

await ctx.send(embed = embed)

# User is only accessing their Imgur album
else:
embed = UNIMPLEMENTED_ERROR

await ctx.send(embed = embed)

# Get the list of images
album_images = await Imgur.get_imgur_album(album_id)

# Create the scrolling embed
await process_scrolling(ctx, self.bot, title = "Images",
pages = [
Embed(
title = "Your Imgur Album",
description = "_ _" if len(album_images) > 0 else "You don't have any images",
colour = await get_embed_color(ctx.author)
).set_image(
url = image["link"]
)
for image in album_images
],
send_page = True
)

@command(
name = "movie",
Expand Down

0 comments on commit ca1cc0f

Please sign in to comment.