Skip to content

Commit

Permalink
Added private_view input to hide response (only works on slash comman…
Browse files Browse the repository at this point in the history
…d) as well as fixed issue with .reply
  • Loading branch information
jfitz02 committed Aug 22, 2024
1 parent 99fc34e commit 55ab68f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cogs/commands/summarise.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ def build_prompt(self, bullet_points, channel_name):
@commands.cooldown(CONFIG.SUMMARISE_LIMIT, CONFIG.SUMMARISE_COOLDOWN * 60, commands.BucketType.channel)
@commands.hybrid_command(help=LONG_HELP_TEXT, brief=SHORT_HELP_TEXT)
async def tldr(
self, ctx: Context, number_of_messages: int = 100, bullet_point_output: bool = False ):
self, ctx: Context, number_of_messages: int = 100, bullet_point_output: bool = False, private_view: bool = False):
number_of_messages = 400 if number_of_messages > 400 else number_of_messages



# avoid banned users
if not await is_author_banned_openai(ctx):
await ctx.send("You are banned from OpenAI!")
Expand All @@ -60,9 +59,8 @@ async def tldr(
async with ctx.typing():
response = await self.dispatch_api(messages)
if response:
prev = ctx.message
for content in split_into_messages(response):
prev = await prev.reply(content, allowed_mentions=mentions)
await ctx.send(content, allowed_mentions=mentions, ephemeral=private_view)

async def dispatch_api(self, messages) -> Optional[str]:
logging.info(f"Making OpenAI request: {messages}")
Expand Down

0 comments on commit 55ab68f

Please sign in to comment.