mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
Update code.py
This commit is contained in:
@@ -264,6 +264,8 @@ async def pretend(ctx, pretend_to_be: str, message: str):
|
|||||||
if data[3] == 0:
|
if data[3] == 0:
|
||||||
await ctx.respond("The bot is disabled", ephemeral=True)
|
await ctx.respond("The bot is disabled", ephemeral=True)
|
||||||
return
|
return
|
||||||
|
#set the openai api key
|
||||||
|
openai.api_key = data[2]
|
||||||
response = openai.Completion.create(engine="davinci", prompt=f"{pretend_to_be} and answer to {ctx.author.mention}:\n{message} \n AI:", max_tokens=50, temperature=0.9, frequency_penalty=0.0, presence_penalty=0.0, stop=["\n"])
|
response = openai.Completion.create(engine="davinci", prompt=f"{pretend_to_be} and answer to {ctx.author.mention}:\n{message} \n AI:", max_tokens=50, temperature=0.9, frequency_penalty=0.0, presence_penalty=0.0, stop=["\n"])
|
||||||
#send the message
|
#send the message
|
||||||
await ctx.respond(response["choices"][0]["text"])
|
await ctx.respond(response["choices"][0]["text"])
|
||||||
|
|||||||
Reference in New Issue
Block a user