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.217]) by gnuweeb.org (Postfix) with ESMTPSA id 111387E257; Mon, 3 Oct 2022 23:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664841227; bh=BCOOxM6H9V0Ms5TeD0XRBmxd7bdHMl/GWof5PWgFW+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KxKvvAUATDyWkMcf/xL23w5HyYc8pxoWugsz+PhR4aXNkrXzwJWJDPPEyRsI+RzMZ KsDrZgt1v1qF/d/k7IHIygewcXyQ5S4r2HfdOtX/0891y8K+NTbw7jPk7aR+81tT5W 4C2Wj+w5XpTXpCbfKND1mXuKRp09LbhK8jT4N2x76WeQeftE+XpyaBqRH6fcWWkAbn Vjy5sRmS55rf/JTBFpP4C98t1E3pMpAmNZFF3Nzv4IVJEDsNcf72bwFtmslMCHSCFH Gq1uox2gnrFmK5oTf0IpuKAHa24zdBQ4ers/PYV4u8Quptz2D2gZLTw1wACMUhEqGx gTTpC7CVA8iCg== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 24/28] discord: Add channel_link() in the atom/utils.py Date: Tue, 4 Oct 2022 06:52:25 +0700 Message-Id: <20221003235230.1824-25-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221003235230.1824-1-kiizuha@gnuweeb.org> References: <20221003235230.1824-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Add channel_link() to create a Discord channel URL with guild id and channel id. Signed-off-by: Muhammad Rizki --- daemon/atom/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/atom/utils.py b/daemon/atom/utils.py index 870ee70..a30d5cb 100644 --- a/daemon/atom/utils.py +++ b/daemon/atom/utils.py @@ -306,3 +306,7 @@ def create_chat_link(chat: Chat): chat_id_str = str(chat.id).replace("-100","") return f"t.me/c/{chat_id_str}/1" + + +def channel_link(guild_id: int, channel_id: int): + return f"https://discord.com/channels/{guild_id}/{channel_id}" -- Muhammad Rizki