mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
Use post request for better use
Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
parent
1bc29d25c6
commit
16e4f58f4f
1 changed files with 5 additions and 2 deletions
|
|
@ -36,8 +36,11 @@ async def gemini_chatbot(_, ctx: Message, strings):
|
||||||
return await ctx.reply_msg("GOOGLEAI_KEY env is missing!!!")
|
return await ctx.reply_msg("GOOGLEAI_KEY env is missing!!!")
|
||||||
msg = await ctx.reply_msg(strings("find_answers_str"), quote=True)
|
msg = await ctx.reply_msg(strings("find_answers_str"), quote=True)
|
||||||
try:
|
try:
|
||||||
response = await fetch.get(
|
data = {
|
||||||
f'https://yasirapi.eu.org/gemini?query={ctx.text.split(maxsplit=1)[1]}'
|
"query": ctx.text.split(maxsplit=1)[1],
|
||||||
|
}
|
||||||
|
response = await fetch.post(
|
||||||
|
"https://yasirapi.eu.org/gemini", data=data
|
||||||
)
|
)
|
||||||
if not response.json().get("candidates"):
|
if not response.json().get("candidates"):
|
||||||
await ctx.reply_msg("⚠️ Sorry, the prompt you sent maybe contains a forbidden word that is not permitted by AI.")
|
await ctx.reply_msg("⚠️ Sorry, the prompt you sent maybe contains a forbidden word that is not permitted by AI.")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue