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 8FA02811D6; Thu, 20 Oct 2022 08:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666255143; bh=m6ErSehqpuDRVeji3lP3LDLHrbNiNgj0UNnHMV+Q3Us=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f4PQP78MAO/pjhBpErcKOqUf3jiEl8qXKFDbW1N5prnnChxDh53faKVjQtYdOEK2F 44xX/HNxPHXr72iBmafP8U8wqEtPMXrH3VNMc6yqbkSwAy+Qr6J2U6THKaKM2gCS1h X2tA6G0zhXqTok6OHpphfKa6s8eOQpUdTTZzoc1ZKbYHm7ixfoaHmSrB0rmJp6Woc0 bXALH3LDHD1rsR++4f3i/b5xL91VVXDrQJ7VZHzm3ZTuxXNKVU/NSYzLoeF025S7kr VtDSQwTXF4FdmZ8X3RVfB7am4UgtSp5yZTzXgAAxJYvC4y0zntw7lRDaXDU7auM2Xn AymjpY3ivf2sQ== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 1/8] discord: Add send_text_mail_interaction() Date: Thu, 20 Oct 2022 15:38:38 +0700 Message-Id: <20221020083845.907-2-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221020083845.907-1-kiizuha@gnuweeb.org> References: <20221020083845.907-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Add send_text_mail_interaction() for the `/atom get {url}` to get the specific lore email message from an URL in future use. Signed-off-by: Muhammad Rizki --- daemon/dscord/gnuweeb/client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/daemon/dscord/gnuweeb/client.py b/daemon/dscord/gnuweeb/client.py index 03a1b8c..15a6eee 100644 --- a/daemon/dscord/gnuweeb/client.py +++ b/daemon/dscord/gnuweeb/client.py @@ -4,6 +4,7 @@ # import discord +from discord import Interaction from discord.ext import commands from discord import Intents from dscord.config import ACTIVITY_NAME @@ -76,3 +77,11 @@ class GWClient(commands.Bot): utils.remove_patch(tmp) return m + + + async def send_text_mail_interaction(self, i: "Interaction", + text: str, url: str = None): + return await i.response.send_message( + content=text, + view=models.FullMessageBtn(url) + ) -- Muhammad Rizki