Skip to content
This repository has been archived by the owner on Jul 31, 2018. It is now read-only.

Docstrings and tags for gif #200

Merged
merged 1 commit into from
Nov 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cogs/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from PIL import Image
import safygiphy
from ext import embedtobox
from ext import nsfwgif


class NumericStringParserForPython3(object):
Expand Down Expand Up @@ -157,8 +158,13 @@ def __init__(self, bot):

@commands.command()
async def gif(self, ctx, *, tag):
''' Get a random gif. Usage: gif <tag> '''
''' Get a random gif. Usage: gif <tag>
this command is sfw, to use nsfw gifs
load community.nsfw '''
g = safygiphy.Giphy()
tag = tag.lower()
if tag in nsfwgif.nsfw:
return await ctx.send('`Please use the nsfw commands to see content like this.`', delete_after=5)
gif = g.random(tag=tag)
color = await ctx.get_dominant_color(ctx.author.avatar_url)
em = discord.Embed(color=color)
Expand Down