Add elaborate context menu action

Kaveen Kumarasinghe 2 years ago
parent 6b879fad54
commit d477fec9dd

@ -626,11 +626,19 @@ class Commands(discord.Cog, name="Commands"):
@discord.message_command(
name="Paraphrase",
guild_ids=ALLOWED_GUILDS,
checks=[Check.check_dalle_roles()],
checks=[Check.check_gpt_roles()],
)
async def paraphrase_action(self, ctx, message: discord.Message):
await self.converser_cog.paraphrase_action(ctx, message)
@discord.message_command(
name="Elaborate",
guild_ids=ALLOWED_GUILDS,
checks=[Check.check_gpt_roles()],
)
async def elaborate_action(self, ctx, message: discord.Message):
await self.converser_cog.elaborate_action(ctx, message)
# Search slash commands
@discord.slash_command(
name="search",

@ -1061,3 +1061,13 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
prompt = f"Paraphrase the following text. Maintain roughly the same text length after paraphrasing and the same tone of voice: {prompt} \n\nParaphrased:"
await self.ask_command(ctx, prompt, None, None, None, None, from_action=prompt)
async def elaborate_action(self, ctx, message: discord.Message):
"""Message command. paraphrase the current message content"""
user = ctx.user
prompt = await self.mention_to_username(ctx, message.content)
# Construct the paraphrase prompt
prompt = f"Elaborate upon the subject of the following message: {prompt} \n\nElaboration:"
await self.ask_command(ctx, prompt, None, None, None, None, from_action=prompt)

Loading…
Cancel
Save