From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.125.177]) by gnuweeb.org (Postfix) with ESMTPSA id 5AA10804FD; Sat, 1 Oct 2022 13:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664629508; bh=3mSBwlUJR0iPa6Mlqy5eEzbO8qnficarUSgp3dq73Xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X4kb1rEmiOc7Pnq3IzfAquhLpXaKBPmJtib/y8SqiuUEQBLppL3/pW6hgiK26U4K1 lDw5gSGqfFORpIqKrdbr55t1XWkyt9ETVhkib+U9yMXsdMFhKArkY01jDWy7X1mDyT WqyuRd48gNsVD8XKdERcPH4a5n6Hx5aZlMFeh2tME/kXjA3UvCi0YO3fPosXxwFlVb yidN05DLKOhLonrlVgnkSzTOIXah4mdMNXEWmcsyfOjJupRxvpoTlVUAHbOh+uW0ut SnLIKIkbEbZA34qqVnL2GvmGz/XWQdWD9BjSMrKEzolGen8LOjIWXajwBCgoud2loe 7b/Bu/rpvCr+g== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v1 21/26] discord: Add a delete atom slash command Date: Sat, 1 Oct 2022 20:03:49 +0700 Message-Id: <20221001130355.784-22-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221001130355.784-1-kiizuha@gnuweeb.org> References: <20221001130355.784-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Add `/atom delete` to delete a specific atom URL in the database that is currently listening new lore email message. Signed-off-by: Muhammad Rizki --- .../plugins/slash_commands/manage_atom.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/daemon/dscord/gnuweeb/plugins/slash_commands/manage_atom.py b/daemon/dscord/gnuweeb/plugins/slash_commands/manage_atom.py index 409e612..e0a6b9e 100644 --- a/daemon/dscord/gnuweeb/plugins/slash_commands/manage_atom.py +++ b/daemon/dscord/gnuweeb/plugins/slash_commands/manage_atom.py @@ -61,3 +61,21 @@ class ManageAtomSC(commands.Cog): t = f"Success add **{url}** for listening new email." await i.response.send_message(t, ephemeral=True) + + + @atom.command( + name="delete", + description="Delete lore atom URL from receiving lore emails." + ) + @app_commands.describe(url='Lore atom URL.') + @filters.lore_admin + async def del_atom(self, i: "Interaction", url: str): + success = self.bot.db.delete_atom(url) + if not success: + t = "Failed to delete atom URL\n" + t += "Maybe because already deleted or not exists." + await i.response.send_message(t, ephemeral=True) + return + + t = f"Success delete **{url}** from receiving lore emails." + await i.response.send_message(t, ephemeral=True) -- Muhammad Rizki