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 277DB804FD; Sat, 1 Oct 2022 13:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664629519; bh=WX/b46cHErAKNeGldU65dEUEP+GM6cKD5mBN3P4JKBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XMSJMN+j/YyDOKQGP9qUMxNRjvcAZucph8a2SvKYwrPyYEDaIb/WPEmIlZT0ztKue A7YzvTAMJDkpbPoHbgrRSoVyiPQ/OyoxSjN64iTx31ry5TWrfGK0TpXgBVxa5GqnjK 5AVXy+0cotQWfCLrX3twP9ITiVwstZTD6ck3l6xChEMHySZVex5wrW4WTT5dd6FqFG aH7+Lv8LPz/z0KN2xtGYcdjjCPnXs2y3Ldih6PMtuqEuHxs8qqvHFVqfoKo3dqLaft L7ghCI5v9/ZmOg8tezsfSkIUjrC6bC6ks4mr5j8y7yE7LgHrx97nq9o5SqIVKmkzGK r1QvRV/wRA/7g== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v1 25/26] discord: Add a delete broadcast slash command Date: Sat, 1 Oct 2022 20:03:53 +0700 Message-Id: <20221001130355.784-26-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 `/broadcast delete` to delete current Discord channel from listening new lore email message. Signed-off-by: Muhammad Rizki --- .../plugins/slash_commands/manage_broadcast.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/daemon/dscord/gnuweeb/plugins/slash_commands/manage_broadcast.py b/daemon/dscord/gnuweeb/plugins/slash_commands/manage_broadcast.py index b9dd5e1..c04560d 100644 --- a/daemon/dscord/gnuweeb/plugins/slash_commands/manage_broadcast.py +++ b/daemon/dscord/gnuweeb/plugins/slash_commands/manage_broadcast.py @@ -65,3 +65,20 @@ class ManageBroadcastSC(commands.Cog): t = f"Success add this channel for send email messages." await i.response.send_message(t, ephemeral=True) + + + @broadcast.command( + name="delete", + description="Delete broadcast channel from sending email messages." + ) + @filters.lore_admin + async def del_channel(self, i: "Interaction"): + success = self.bot.db.delete_broadcast(i.channel_id) + if not success: + t = "Failed to delete this channel\n" + t += "Maybe because already deleted or not exists." + await i.response.send_message(t, ephemeral=True) + return + + t = f"Success delete this channel from sending email messages." + await i.response.send_message(t, ephemeral=True) -- Muhammad Rizki