remove tenor gif bs
This commit is contained in:
parent
8fb4e089be
commit
0438b55ce6
@ -36,7 +36,6 @@ Add your various API tokens:
|
||||
```python
|
||||
GARFBOT_TOKEN = "Discord API token"
|
||||
OPENAI_TOKEN = "OpenAI API token"
|
||||
GIF_TOKEN = "tenor.com API token"
|
||||
```
|
||||
|
||||
I recommend building a docker image using the included DockerFile as a template. Run the container binding /usr/src/app to GarfBot's CWD:
|
||||
|
30
garfmain.py
30
garfmain.py
@ -1,5 +1,4 @@
|
||||
import config
|
||||
# import random
|
||||
import asyncio
|
||||
import discord
|
||||
import subprocess
|
||||
@ -50,16 +49,6 @@ async def on_message(message):
|
||||
await message.channel.send(f"`Please wait... image generation queued: {prompt}`")
|
||||
await picture_time(message, prompt)
|
||||
|
||||
# if message.content.lower() == "lasagna":
|
||||
# await send_gif(message, "garfield lasagna")
|
||||
|
||||
# if message.content.lower() == "monday":
|
||||
# await send_gif(message, "garfield monday")
|
||||
|
||||
# if message.content.lower().startswith("garfgif "):
|
||||
# search_term = message.content[8:]
|
||||
# await send_gif(message, search_term)
|
||||
|
||||
if message.content.lower().startswith("garfping "):
|
||||
try:
|
||||
query = message.content.split()
|
||||
@ -137,25 +126,6 @@ async def on_message(message):
|
||||
await aod_message(garfbot, message)
|
||||
|
||||
|
||||
# # GarfGifs
|
||||
# @garfbot.event
|
||||
# async def send_gif(message, search_term):
|
||||
# lmt = 50
|
||||
# ckey = "garfbot"
|
||||
# r = requests.get(f"https://tenor.googleapis.com/v2/search?q={search_term}&key={gapikey}&client_key={ckey}&limit={lmt}")
|
||||
# if r.status_code == 200:
|
||||
# top_50gifs = json.loads(r.content)
|
||||
# gif_url = random.choice(top_50gifs["results"])["itemurl"]
|
||||
# logger.info(gif_url)
|
||||
# # logger.info(gif_url)
|
||||
# try:
|
||||
# await message.channel.send(gif_url)
|
||||
# except KeyError:
|
||||
# await message.channel.send("Oops, something went wrong.")
|
||||
# else:
|
||||
# await message.channel.send(f"`Oops, something went wrong. Error code: {r.status_code}`")
|
||||
|
||||
|
||||
async def garfbot_connect():
|
||||
while True:
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user