This commit is contained in:
Yasir Aris M 2024-07-29 11:43:39 +07:00 committed by GitHub
parent 6f0801ed27
commit 8877f4c156
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -47,7 +47,7 @@ async def gemini_chatbot(_, ctx: Message, strings):
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.")
else: else:
await ctx.reply_msg(html.escape(f'{response.json()["candidates"][0]["content"]["parts"][0]["text"]}\n\n<b>Powered by:</b> <code>Gemini Flash 1.5</code>')) await ctx.reply_msg(html.escape(response.json()["candidates"][0]["content"]["parts"][0]["text"])+'\n<b>Powered by:</b> <code>Gemini Flash 1.5</code>')
await msg.delete() await msg.delete()
except Exception as e: except Exception as e:
await ctx.reply_msg(str(e)) await ctx.reply_msg(str(e))

View file

@ -181,7 +181,7 @@ async def removebg(_, ctx: Client):
return await ctx.reply_msg("Only support photo for remove background.") return await ctx.reply_msg("Only support photo for remove background.")
prg = await ctx.reply("Processing...") prg = await ctx.reply("Processing...")
source = await ctx.reply_to_message.download() source = await ctx.reply_to_message.download()
await gen_trans_image(ctx.reply_to_message, f"transp_bckgrnd-{ctx.from_user.id}.png") await gen_trans_image(source, f"transp_bckgrnd-{ctx.from_user.id}.png")
await ctx.reply_photo(f"transp_bckgrnd-{ctx.from_user.id}.png") await ctx.reply_photo(f"transp_bckgrnd-{ctx.from_user.id}.png")
await prg.delete_msg() await prg.delete_msg()
os.remove(source) os.remove(source)