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 [175.158.50.43]) by gnuweeb.org (Postfix) with ESMTPSA id 08F3A81A2A; Wed, 18 Jan 2023 17:54:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1674064476; bh=G1RKfUu1iWeiyHZCP2Fn0CDmABoOeKWgVBiyUWIFPGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jSy0ltCGG+GT9JW/TvWYgeq5QxP86d/8GtE8VdUyW83yEQqIzc9ti7TcBsLF9K+uX qM4mMp63/FOM08VkfIaHoezpaKL0a/Wt7o6tT0QHmaQeNre1DHRHPoOZ2xZIA81oq9 ERXEAu0o/94x6QXUmBsLeHMb9A9JxuaxXkGDaXKbrs04I1ELgELGpaLnBzSK6VBJAR yjIVvu02Oerm237uU9HwwzZj0mFBpJ7CVvFyaI98rSZeeAcaQMwfzsDbDM38goSQzA jmqFjTg5trzH+5fWnZqsphSZj4eR1MmVPQgyJvXMLt+oOUEbOih1SMqlaJMTBQeALv M0XvObiwFrAqw== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 10/17] discord: typing: Add return type annotations Date: Thu, 19 Jan 2023 00:53:49 +0700 Message-Id: <20230118175356.1853-11-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20230118175356.1853-1-kiizuha@gnuweeb.org> References: <20230118175356.1853-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Add return type annotations for send_text_email() & send_patch_email(). This improves code readability and helps with understanding the type of object returned by these functions. Signed-off-by: Muhammad Rizki --- daemon/dscord/gnuweeb/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/dscord/gnuweeb/client.py b/daemon/dscord/gnuweeb/client.py index 78ec3f9..7d6433b 100644 --- a/daemon/dscord/gnuweeb/client.py +++ b/daemon/dscord/gnuweeb/client.py @@ -4,7 +4,7 @@ # import discord -from discord import Interaction +from discord import Interaction, Message from discord.ext import commands from discord import Intents from typing import Union @@ -60,7 +60,7 @@ class GWClient(commands.Bot): @filters.wait_on_limit async def send_text_email(self, guild_id: int, chat_id: int, text: str, - reply_to: Union[int, None] = None, url: str = None): + reply_to: Union[int, None] = None, url: str = None) -> Message: self.logger.debug("[send_text_email]") channel = self.get_channel(chat_id) @@ -77,7 +77,7 @@ class GWClient(commands.Bot): @filters.wait_on_limit async def send_patch_email(self, mail, guild_id: int, chat_id: int, text: str, - reply_to: Union[int, None] = None, url: str = None): + reply_to: Union[int, None] = None, url: str = None) -> Message: self.logger.debug("[send_patch_email]") tmp, doc, caption, url = utils.prepare_patch( mail, text, url, Platform.DISCORD -- Muhammad Rizki