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

Commit 3692cc4

Browse files
author
FloatCobra
authored
Merge pull request #200 from XAOS1502/patch-4
Docstrings and tags for gif
2 parents 4b9db59 + 04870e8 commit 3692cc4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cogs/misc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
from PIL import Image
5858
import safygiphy
5959
from ext import embedtobox
60+
from ext import nsfwgif
6061

6162

6263
class NumericStringParserForPython3(object):
@@ -157,8 +158,13 @@ def __init__(self, bot):
157158

158159
@commands.command()
159160
async def gif(self, ctx, *, tag):
160-
''' Get a random gif. Usage: gif <tag> '''
161+
''' Get a random gif. Usage: gif <tag>
162+
this command is sfw, to use nsfw gifs
163+
load community.nsfw '''
161164
g = safygiphy.Giphy()
165+
tag = tag.lower()
166+
if tag in nsfwgif.nsfw:
167+
return await ctx.send('`Please use the nsfw commands to see content like this.`', delete_after=5)
162168
gif = g.random(tag=tag)
163169
color = await ctx.get_dominant_color(ctx.author.avatar_url)
164170
em = discord.Embed(color=color)

0 commit comments

Comments
 (0)