Created
January 17, 2018 03:50
-
-
Save colebob9/4febfda84bf93481580d384eebccb154 to your computer and use it in GitHub Desktop.
Replies to every message on a Discord server with a GIF with varying results
This file contains hidden or 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
# GiphyBot v0.1 | |
# colebob9 | |
# Python3 | |
import discord | |
import asyncio | |
from giphypop import translate | |
client = discord.Client() | |
@client.event | |
async def on_ready(): | |
print('------') | |
print('Logged in as') | |
print(client.user.name) | |
print(client.user.id) | |
print('------') | |
@client.event | |
async def on_message(message): | |
if message.author == client.user: | |
pass | |
else: | |
print("") | |
print("%s sent: " % message.author) | |
print(message.content) | |
img = translate(message.content, api_key='GIPHY-KEY') | |
msg = img.url | |
print("Replying with: ") | |
print(msg) | |
await client.send_message(message.channel, msg) | |
client.run('DISCORD-KEY') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment