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 5F4DF8121B; Fri, 21 Oct 2022 13:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666359941; bh=m6ErSehqpuDRVeji3lP3LDLHrbNiNgj0UNnHMV+Q3Us=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UCOEURdMrX0vCofmyYGqeFApO5S0B9OnWbOyWSflQfd7mtF97/7xH2hXkOQFUm5VW 3YZHYtuexDQyEfHlKVPHpZF47mN9eUJjmbwaDuQROqqMNWTc7iBP/0FhXXeTO12gOj WFbRCBAv9DQccMXUUUUw1mXnwLLPUisHG1G0eUwq02zTfi/vQL/Zz+Oy+1mxZaJCYF TY0KUTQ55tsBNRI75GjYRWjhiKc1VLhhIO24/IBBTlrCXKwOfGJa5+b15hyVINoAIB LpoG6ivNgNFcxWRP8bO4UAmIc6FSVkZEqRPUuhAzIOLhRX2seMqFyE8VDKmOk/8SMN 5g0D2sCVKJ6Vg== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v3 1/9] discord: Add send_text_mail_interaction() Date: Fri, 21 Oct 2022 20:45:12 +0700 Message-Id: <20221021134520.701-2-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221021134520.701-1-kiizuha@gnuweeb.org> References: <20221021134520.701-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