mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-03 19:14:51 +00:00
Fix bard
This commit is contained in:
parent
4dbbf5e363
commit
55a2eee77c
1 changed files with 6 additions and 2 deletions
|
|
@ -17,13 +17,17 @@ openai.api_key = OPENAI_API
|
|||
|
||||
# This only for testing things, since maybe in future it will got blocked
|
||||
@app.on_message(filters.command("bard", COMMAND_HANDLER))
|
||||
@use_chat_lang()
|
||||
async def bard_chatbot(self: Client, ctx: Message, strings):
|
||||
if len(ctx.command) == 1:
|
||||
return await ctx.reply_msg(strings("no_question").format(cmd=ctx.command[0]), quote=True, del_in=5)
|
||||
msg = await ctx.reply_msg(strings("find_answers_str"), quote=True)
|
||||
data = {'message': ctx.input, 'session_id':'XAjzKUFvf_nQtNg4bt0pG54rCLnaWeJFE1_FXuQnVjNyfmjDhkKZyoqXqW5cgBmmnf8Eqg.'}
|
||||
try:
|
||||
req = await http.post("https://bard-api-rho.vercel.app/ask", json=data)
|
||||
await msg.edit_msg(req.get("content"))
|
||||
except Exception as e:
|
||||
await msg.edit_msg(str(e))
|
||||
|
||||
@app.on_message(filters.command("ask", COMMAND_HANDLER))
|
||||
@ratelimiter
|
||||
|
|
|
|||
Loading…
Reference in a new issue