Add showprompt command (admin only) to display full system prompt
This commit is contained in:
@@ -380,6 +380,18 @@ class Assistant(commands.Cog):
|
|||||||
await self.config.guild(ctx.guild).system_prompt.set(prompt)
|
await self.config.guild(ctx.guild).system_prompt.set(prompt)
|
||||||
await ctx.send("System prompt updated.")
|
await ctx.send("System prompt updated.")
|
||||||
|
|
||||||
|
@assistant.command(name="showprompt")
|
||||||
|
@checks.admin_or_permissions(manage_guild=True)
|
||||||
|
async def assistant_showprompt(self, ctx: commands.Context):
|
||||||
|
"""Show the full system prompt (admin only)."""
|
||||||
|
prompt = await self.config.guild(ctx.guild).system_prompt()
|
||||||
|
if len(prompt) <= 2000:
|
||||||
|
await ctx.send(f"```\n{prompt}\n```")
|
||||||
|
else:
|
||||||
|
chunks = [prompt[i:i + 1990] for i in range(0, len(prompt), 1990)]
|
||||||
|
for chunk in chunks:
|
||||||
|
await ctx.send(f"```\n{chunk}\n```")
|
||||||
|
|
||||||
@assistant.command(name="question")
|
@assistant.command(name="question")
|
||||||
async def assistant_question(self, ctx: commands.Context):
|
async def assistant_question(self, ctx: commands.Context):
|
||||||
"""Toggle question mode (messages must end with ?)."""
|
"""Toggle question mode (messages must end with ?)."""
|
||||||
|
|||||||
Reference in New Issue
Block a user