fix(config.py): fix typo in max_uses variable declaration

feat(config.py): add support for TENOR_API_KEY environment variable to be able to use Tenor API for sending gifs
feat(functionscalls.py): add new function send_a_gif to send a gif in the channel
fix(makeprompt.py): add support for calling send_a_gif function in chatgpt_process function
This commit is contained in:
Paillat
2023-07-18 21:53:07 +02:00
parent 12f13ca6c4
commit e91fafdc51
3 changed files with 57 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ from src.functionscalls import (
reply_to_last_message,
send_a_stock_image,
create_a_thread,
send_a_gif,
functions,
server_normal_channel_functions,
)
@@ -144,6 +145,12 @@ async def chatgpt_process(
"`A server normal text channel only function has been called in a non standard channel. Please retry`",
delete_after=10,
)
if name == "send_a_gif":
if arguments.get("query"):
query = arguments.get("query")
reply = arguments.get("message", "")
limit = arguments.get("limit", 15)
await send_a_gif(message, query, reply, limit)
if name == "":
await message.channel.send(
"The function call is empty. Please retry.", delete_after=10