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 autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.125.209]) by gnuweeb.org (Postfix) with ESMTPSA id 17D0C81946; Mon, 19 Dec 2022 23:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1671493968; bh=XUKY/p4GUVAproJ10POR7MpOIZvhBnE1Hmb+1qKdgdY=; h=From:To:Cc:Subject:Date:From; b=GA4BJz5d8C+kS1QSKDLrklYoVRXGj85APQQX6KEgEtzXOrtLGd//p02Qe8P+Kp4WC CgXCNodUZSyWlnqrv4CpxEJb/0xqCYoiD5Xj1Bk9sNPsaBY/u/tvrEC11r9xN8vw7g AP2uiNa/7Jq33jliIzwQJaag8pEYM7I9JcMNPTjGa0XlVP/IipPfl7FkZxRPprnG/g E6ZWWcKJPUD7vf9Y8xOJ39nWR4seG2VTUqly9ZV2NqoXP3ylmEmUwWIwgZZUMEyVlz 8YPhiR0wBba9Z6/sggvJ7tlrKyCAzOOIakPvUYKnVmtsjfrMR1RY0675XYjUXWSxt0 R2tNid83idq0A== From: Muhammad Rizki To: Cc: Muhammad Rizki , Alviro Iskandar Setiawan , Ammar Faizi , GNU/Weeb Mailing List Subject: [PATCH 01/28] discord: Add send_text_mail_interaction() Date: Tue, 20 Dec 2022 06:51:59 +0700 Message-Id: <20221219235226.1567-1-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 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 Link: https://lore.gnuweeb.org/gwml/20221022065149.865-2-kiizuha@gnuweeb.org Cc: Alviro Iskandar Setiawan Cc: Ammar Faizi Cc: GNU/Weeb Mailing List Signed-off-by: Ammar Faizi --- 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) + ) -- 2.34.1.windows.1