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 mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by gnuweeb.org (Postfix) with ESMTPSA id 4BB5D7E4C1 for ; Wed, 4 Jan 2023 06:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1672814388; bh=+LKGGDU4fS/mAUOKN2aeFLCz2qyt48gwwSrsB3HHkZ8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WGMsXuKZDO9W91YXdrUi2tPDipWGXAn3Q42ccfz1xRKCTJsWhiq6xozi9eme/Euyd muYxUyoivVZAPWOGZ97S2K5afv4shTdIW997m4GRz/ouomKFjAkDQ8yZrl9B8TmXbE Jv90BIOMLu+3Pj2oZOJKpMUtXV1Rhh8HFbjLb+FucQWQo7oqCrzKN8q7nqaZnfWsqC NqRUE8P+EIZ/Rl++0+WLa5WB3OsTx7vDfd3k9rUC+5Li8eAqiIG3Ly9F8/wDaRcWn0 v4+dQrSvi8woFGcGOgKXrQSjT7y1bJDRnN2m6/uDKgiUlQfxRIHz9qw3xkHWh4VPrv NCaH012PNhyxw== Received: by mail-lf1-f45.google.com with SMTP id y25so49105157lfa.9 for ; Tue, 03 Jan 2023 22:39:48 -0800 (PST) X-Gm-Message-State: AFqh2kozaS1hUkQdur2BB7Rl3UzK0O2Fk8MTuCzSTzPRs6m26Rd2Zg1/ vL5PDtFFPgcWvEaKo5fvmOqDaoD9loNpeBPJEP0= X-Google-Smtp-Source: AMrXdXsP9Ga4mnd5InBMFaIh1rmEYrqZh/GkqQvcBs8qS6z/C1Sn39MC9rRRyNY9rw4x5V1GLDweqYHxOxLHmGEWLdg= X-Received: by 2002:a05:6512:2092:b0:4b5:a70f:8efb with SMTP id t18-20020a056512209200b004b5a70f8efbmr3228918lfr.678.1672814386447; Tue, 03 Jan 2023 22:39:46 -0800 (PST) MIME-Version: 1.0 References: <20230103063641.1680-1-kiizuha@gnuweeb.org> <20230103063641.1680-4-kiizuha@gnuweeb.org> <5fa120d7-32ab-b560-0c8f-0da64546cf0b@gnuweeb.org> In-Reply-To: From: Alviro Iskandar Setiawan Date: Wed, 4 Jan 2023 13:39:35 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 03/13] refactor(telegram)!: Ensure the Telegram bot has been started To: Muhammad Rizki Cc: Ammar Faizi , "GNU/Weeb Mailing List" Content-Type: text/plain; charset="UTF-8" List-Id: 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()`. Acked-by: Alviro Iskandar Setiawan