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.177]) by gnuweeb.org (Postfix) with ESMTPSA id 12977804FD; Sat, 1 Oct 2022 13:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664629510; bh=YTHPGPVrQmv1daZV/MEcHY5IspBDTNGUC2Q/87M9acc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FPYm5J/Rjs958ypkc4JW0Ynu0qUN3MoLX0FlHwoX4qjuu8mArxj15AHsH3xMASG1A gKuKEv8rIPPirqDLEwjio9Ax4A1ZJJFlDg07VddNAvqULQMB/Wfy908znLVu9NufjE lJkzxARoh/Veb150jn5T0sQOIDCxsR1BIkW5wcPUATr6sn685zxjm836s0mA5JJx4H G8er2eUAAgKemFsDNfTckAJaqRiu3cgpox/YNzCF95ZBSIkgAEhxftnvfpyiHyA/00 aRj5I5AZX1yTj/FA6sgmdzCelKsWVQyRYeL2DOtXtRZgl/bPqCLlmb7HEpVpsFjocq KxIsT3zmvlCeg== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v1 22/26] discord: Add channel_link() in the atom/utils.py Date: Sat, 1 Oct 2022 20:03:50 +0700 Message-Id: <20221001130355.784-23-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221001130355.784-1-kiizuha@gnuweeb.org> References: <20221001130355.784-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 bf1f0da..66f351f 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