Created
July 4, 2020 12:44
-
-
Save miditkl/58b78b8304a835e6d9d471c067b4b0df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
import tenorpy | |
bot = commands.Bot(command_prefix='!') | |
t = tenorpy.Tenor() | |
@commands.command() | |
async def gif(ctx, giftag): | |
"""This command will return a tenor gif if you type "!gif cat" as example.""" | |
getgifurl = t.random(str(giftag)) | |
await ctx.send(f'{getgifurl}') | |
@gif.error | |
async def gif_error(ctx, error): | |
if isinstance(error, commands.MissingRequiredArgument): | |
await ctx.send('Giftag cant be None. Please give a valid giftag to search.') | |
bot.run('BOT_TOKEN') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment