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 6DABA812EC; Sat, 22 Oct 2022 06:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666421530; bh=m6ErSehqpuDRVeji3lP3LDLHrbNiNgj0UNnHMV+Q3Us=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R4jKp/i7Crow+bs41VmAOr2lmJMWx2rkAj6kTnnNyAm6c+6+Vt1KGssW9Mjbsd6Vk J02pxyPJU0kEPlXsa5xwXM9FN525oUYGPluSs1E6V/8zvv+MCWL5t/NEdzNaGvx7Xd +KhI2EobsAguMZq7r8lvrPsaWpXFPTgFEoHCeEKeFOgMeTPP24La+vkorbGXZgymha q4QXkHz/cJlv9i9QyCwJKYIk37xJKxdjVgetzlw9ytH94Byp0US7Yem03q7khvozh3 qDrHsk09cpgWAwv9Ic/+IEeShMPyJLmN44Y0cbRa5ycsFWbyBa1eY7e8Nc8mezhEXm M3AaoTwsmNHBw== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v4 1/9] discord: Add send_text_mail_interaction() Date: Sat, 22 Oct 2022 13:51:41 +0700 Message-Id: <20221022065149.865-2-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: 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