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-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by gnuweeb.org (Postfix) with ESMTPSA id E478C7E443 for ; Tue, 3 Jan 2023 22:27:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1672784876; bh=PK9IFnq+hfDcoE/SRXfFIZbZROPRG4gYFB7XHvPF89I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=q4xISIlKjkK5Xxc1npmjUFOj6L6xTEA7f2I5iRdDv3xR1LSBHWO4+q837KcoMGi4o 3nY7maAputLUcvfv4w1bkbuA/QnFQv8t/InGjUeO7uWHQZDe/pjECgMJCrxRsMb5kB 0NcPzMH81ohOjqwBKyjWonCuuE6Acxbm1X9DHS6Ew0XfzMu8gk72ivWBnwVwoG1VHM kEMlGLj8+OipnUY4Kvn4qxF0b8bWcFJU8rlKRiWIruIVBv7B19r76t+FqXz6fsboZ7 7eAaqtG0wDi4oh6MvRyQ257a05hbF/YDHJgK1BR+Hh6qDTMKpmAjEgfAKZf4TfY2KP XyDMu0oPYXyVg== Received: by mail-lf1-f54.google.com with SMTP id j17so38194770lfr.3 for ; Tue, 03 Jan 2023 14:27:56 -0800 (PST) X-Gm-Message-State: AFqh2krLcm7v38KnhRGFNmHKuWBdjHPZaUR3ZQ/T1jRO4+cSUEps/K3w ImlcnBzsmfyTBTNnT7WrPGhTS0xYeAOXKzu0p8c= X-Google-Smtp-Source: AMrXdXudQEI9QN81yWcFpq4VbIKx2/ge2zOjgTuuQvc0EpeaZRpFGL2o+/G8Bf33bdfpkSEGO11UtnWL1WD8M164YuU= X-Received: by 2002:a05:6512:2092:b0:4b5:a70f:8efb with SMTP id t18-20020a056512209200b004b5a70f8efbmr3157989lfr.678.1672784874990; Tue, 03 Jan 2023 14:27:54 -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 05:27:43 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 03/13] refactor(telegram)!: Ensure the Telegram bot has been started To: Ammar Faizi Cc: Muhammad Rizki , "GNU/Weeb Mailing List" Content-Type: text/plain; charset="UTF-8" List-Id: On Wed, Jan 4, 2023 at 5:11 AM Ammar Faizi wrote: > On 1/3/23 7:17 PM, Muhammad Rizki wrote: > > No, we should use this method rather than `client.run()`. Why? because > > at the previous commit, we use `client.run()` after the `bot.run()` > > which is the `bot` here is running first before the Telegram bot is > > started/connect to the Telegram MTProto API, previous commit: > > > > sched.start() > > > > bot.run() <- we listen for new emails, if error may > > happen, the listener will send the log file > > which is require to interact with the Telegram > > API. > > > > client.run() <- The client is late to start/connect to the > > Telegram API. > > What does this call ordering have to do with 'idle()'? because the subsequent code calls client.stop(), what if you don't call client.stop()? but bot.run() # internally calls sched.start()