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.226]) by gnuweeb.org (Postfix) with ESMTPSA id CE607804D1; Thu, 11 Aug 2022 08:27:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660206457; bh=kmVFxYCr6jpWVWo6dLptaRwSxVDIVywwrknHZCtqFoo=; h=From:To:Cc:Subject:Date:From; b=Ph7VEEMjb+2jax9ilPOq9bcE85B/YD+u03F+DKHdv2RALwccBh2kP/YHdc9JWctQc MnSMY2kpoIvHmw7Tewzvor6Nyf2G006ILUTHXCX9nP27k9YpIvGjYlMxpE/b9rR1Pq n2ZfAKAlEvjDqnbfo7ziSqK2IH6xcN3ORhMDLc8nssv9nnMJZCnAgBbodw4beye0mq uwJVVLKMEy2uAv+3ZDi/ZL6ZxDXQeGk2cndu3qQnZM8NHEltS1E9VBgPaa4w5tEBfp XCn/zXu+FIm/eFigVS64Q6geUM/OK9k/t82i0SW+1oj1DeKwGkb/vM1r6/npCXqmGc +oX+8QnaTZAHw== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , GNU/Weeb Mailing List , Alviro Iskandar Setiawan Subject: [PATCH v1 0/4] Add admin configuration Date: Thu, 11 Aug 2022 15:26:52 +0700 Message-Id: <20220811082656.1420-1-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Afternoon sir, In this series, I create config.py for handling the bot commands and callbacks which is only admins who can use these. How to configure it? 1. Search any of Telegram bot who has User ID extractor 2. Copy your User ID 3. Then, paste it in the ADMINS list variable in config.py file There are 4 patches in this series: - Patch 1 is to add config.py.example so other devs know what to do - Patch 2 is to add config.py into the .gitignore - Patch 3 is to use config.admin_only into the commands and callbacks - Patch 4 is just remove some unused codes. Tested and works as I expected, please give it a test too if there is any errors, bugs, or unexpected results. Signed-off-by: Muhammad Rizki --- Muhammad Rizki (4): Add config.py.example Add config.py in .gitignore Use created filter for admin-only Remove unused codes in some files .gitignore | 3 +++ daemon/config.py.example | 11 +++++++++++ daemon/packages/plugins/callbacks/del_atom.py | 3 ++- daemon/packages/plugins/callbacks/del_chat.py | 3 ++- daemon/packages/plugins/commands/debugger.py | 4 +++- daemon/packages/plugins/commands/manage_atom.py | 8 +++++--- daemon/packages/plugins/commands/manage_broadcast.py | 5 +++-- daemon/packages/plugins/commands/scrape.py | 3 ++- daemon/scraper/db.py | 1 - 9 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 daemon/config.py.example base-commit: a6280937ce9623e961bb66a76fad2c2f5cd10244 -- Muhammad Rizki