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=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.1.2] (unknown [101.128.126.135]) by gnuweeb.org (Postfix) with ESMTPSA id D83177E4BC; Wed, 4 Jan 2023 06:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1672815008; bh=3aMZb7zAzmuEH0AQy2ftoeCEA1rUL5gikoxpNXF7DGo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MHYgFBbv+Q3s+6I6/FLgkzLU1FhSWbDnmtWNuDC4v4iOPgs6zf+b/3dkFAaY6ZDGw lejJ3zGKqKB08HVxEJFSl6lcO0K2coED82qb1lWzo09haKi0KZvttAyP24COQJfi91 9R41PFbuQxC2th9ft//Vc3zVwDkiWZ/4JxnyyAT7zb3g0wABJQx/9QZRpMKqwAxA89 KzS8XRs2MKvucvRZxg9qcTS5CZmgjJskFIg/R+U0AfyXg531A8oCmRAGp6jy04eIRu lL9snlGTTs7Qa5jo5me4Yrg3B1O9BFyWp/Cjjg2e/HM0u7TQCTem/4vK41KN/nNopn GQnSr9ylsfl1g== Message-ID: <07389669-afcc-0a92-079a-3b75df85b7f5@gnuweeb.org> Date: Wed, 4 Jan 2023 13:50:03 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v1 03/13] refactor(telegram)!: Ensure the Telegram bot has been started Content-Language: en-US To: Alviro Iskandar Setiawan Cc: Ammar Faizi , GNU/Weeb Mailing List References: <20230103063641.1680-1-kiizuha@gnuweeb.org> <20230103063641.1680-4-kiizuha@gnuweeb.org> <5fa120d7-32ab-b560-0c8f-0da64546cf0b@gnuweeb.org> From: Muhammad Rizki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 04/01/2023 13.39, Alviro Iskandar Setiawan wrote: > On Wed, Jan 4, 2023 at 1:31 PM Muhammad Rizki wrote: >> async def run(self): # this is Bot() class >> client.start() >> >> self.runner = self.sched.add_job( >> func=self.__run, >> misfire_grace_time=None, >> max_instances=1 >> ) >> >> self.sched.start() >> idle() >> client.stop() >> >> So, in the main file just call it `bot.run()`. What do you think? > > Looks saner to me. With `self.client.xxxx()`. Ah yes my bad, I'll refactor it with amend then. > > Acked-by: Alviro Iskandar Setiawan