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.217]) by gnuweeb.org (Postfix) with ESMTPSA id B0BCE7E257; Mon, 3 Oct 2022 23:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664841225; bh=3mSBwlUJR0iPa6Mlqy5eEzbO8qnficarUSgp3dq73Xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YMW5ZZ1hGUInkBo4sJfGkoCP1VliOxVQ8vx0Nr/gcpfwa0AoUGgmgoGWrFheIsMCu dJWjpop38nuxp/ht+PTwUcycmK3jkS7+hiPqjUwsBcSIu9L7ghoJS0VH20mWckZoWq 8LXtMJKBHJCfkcVJUFc1PZwyVo0V577WPDbaccjqneCD3RZOBiWVBChjnEBZY2SOmk ykBS5WPFE/tRPq7UeBtgztBtFASff83EDywxompsWaUSnC9ncBdGJPp28URq1C4kPa HNLZfm2IvdH3Tbsg4xMmVwTB4PVoQ+VnLCCrxLYsr/CENnUP/+BYIJQyNhBk0sd76y TralKu8S2EEhQ== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 23/28] discord: Add a delete atom slash command Date: Tue, 4 Oct 2022 06:52:24 +0700 Message-Id: <20221003235230.1824-24-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221003235230.1824-1-kiizuha@gnuweeb.org> References: <20221003235230.1824-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