import #forbidden#
import openai
from #forbidden#.ext import commands
openai.api_key = YOUR_API
client = #forbidden#.Client()
bot = commands.Bot(command_prefix='!', intents=#forbidden#.Intents.all())
@bot.command()
async def ask(ctx, *, message : str):
response = openai.Completion.create(
model="text-davinci-003",
prompt=message,
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
embed=#forbidden#.Embed(title="🔰 MY BOT", url="YOUR_SITE_URL", description="Powered by OpenAI")
embed.set_thumbnail(url="YOUR_IMAGE_URL")
embed.add_field(name="✔ Question", value=message, inline=False)
embed.add_field(name="✔ Resoponse", value=response['choices'][0]['text'], inline=True)
await ctx.send(embed=embed)
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
await ctx.send("Unknown command.")
bot.run(TOKEN)