From 1ce2218d6ce149441336f93dd13b738b12f145f1 Mon Sep 17 00:00:00 2001 From: Xory Date: Wed, 20 Aug 2025 21:45:45 +0300 Subject: [PATCH] ephemeral messages :D --- README.md | 4 ++-- main.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 31cf2f2..45eaa4a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A search engine in your discord client. - [X] Command exec - [X] Image & PDF recognitiion - [X] System Prompt & Safety -- [ ] Ephermal +- [X] Ephemeral - [ ] Research - [ ] VC capabilities (difficult af to implement) -- [ ] ~~Image creation~~ (thrown out due to payment requirements) +- [ ] Image creation diff --git a/main.py b/main.py index 53a036f..973d088 100644 --- a/main.py +++ b/main.py @@ -66,8 +66,11 @@ async def generation(interaction: discord.Interaction) -> None: @bot.tree.command(name="ask", description="ai thing yes 👍") @app_commands.allowed_installs(guilds=False, users=True) @app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True) -async def ask(interaction: discord.Interaction, prompt: str, attachment: Optional[discord.Attachment]) -> None: - await interaction.response.defer() +async def ask(interaction: discord.Interaction, prompt: str, attachment: Optional[discord.Attachment], ephemeral: bool) -> None: + if not ephemeral: + await interaction.response.defer() + else: + await interaction.response.defer(ephemeral=True) attachment_text: str | None = None attachment_data: bytes | None = None