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.123]) by gnuweeb.org (Postfix) with ESMTPSA id B2BC381214; Sat, 22 Oct 2022 06:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666421532; bh=ADnsF+F/GbI9qd7rjBeB6lUgxfJbN3FHfDWDR9IjAso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hr7/+86PR96BSClFAPQzGmK1Ch0LXa6HKiAvHZaCgOknXVE5I2YGstbSjdmUX+FRw SuY4m0VcfkbSIhlsVqNgS35o/WTG9HR36n/2fV+3cdotTOmiS/IZBQ0/G+ltsn/oUW 8SgKX4SSgbQe+9QZD9BwU+74HbtWrXX1uuuiP57cHBD3TMKCnNIOvKqFjqX7jL3Orf Sm9aGape4F5ugxLnCSYmmMHXcDmsYMLa/fd5MFkD5zDaoJNLRV8z/6VyNQw4WgKjLu onqSnF3s5q6qG33bWu24OP34+8lLkP3JLARfoA9nMwjz2wwPQDirOwDmYoG1sJLUQi zSjX4ZdvknRAA== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v4 2/9] discord: Add send_patch_mail_interaction() Date: Sat, 22 Oct 2022 13:51:42 +0700 Message-Id: <20221022065149.865-3-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221022065149.865-1-kiizuha@gnuweeb.org> References: <20221022065149.865-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This function is just the same as send_text_mail_interaction(), the different between them is send_patch_mail_interaction() for sending a lore email message with patch file attachment. Signed-off-by: Muhammad Rizki --- daemon/dscord/gnuweeb/client.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/daemon/dscord/gnuweeb/client.py b/daemon/dscord/gnuweeb/client.py index 15a6eee..b921f7d 100644 --- a/daemon/dscord/gnuweeb/client.py +++ b/daemon/dscord/gnuweeb/client.py @@ -85,3 +85,17 @@ class GWClient(commands.Bot): content=text, view=models.FullMessageBtn(url) ) + + + async def send_patch_mail_interaction(self, mail, i: "Interaction", + text: str, url: str = None): + tmp, doc, caption, url = utils.prepare_patch( + mail, text, url, "discord" + ) + m = await i.response.send_message( + content=caption, + file=discord.File(doc), + view=models.FullMessageBtn(url) + ) + utils.remove_patch(tmp) + return m -- Muhammad Rizki