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 6E50C80952; Thu, 11 Aug 2022 08:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660206460; bh=MznooWHVkDEjVOqThvvBfn0zlb3Y2nw6NWYV2oxqU6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a7gSpCSpC0B0FjbffZ5Mz3SCHnXpwbZJdyXqrRT3DMsDidkwMR3MV5hENbrEqhwbb +RyvtNMn48ZijSCD/WtAjrjo72MytVebELuhViDYLug3KpjroQ00RUJI8FTWJg5hHb imk+R+PCHnJT3u6LDuQCR5Wil1pyt7hh8QdOGLwDCzH8QMJzvLIBTMlrsBhhyCAS81 gBjsme6/IIMj8huMHcJo4aTfjiXnAXH9chRLoLGgWUwluLzYNTuKp7TNOespr+s3UG d0s8CD7B/ylGlflSjIYYThMXfSHftJQM6VW3p1WepGu2scWIo7UP47/l63ZRFkCnDY eDvG5X1VmPUnQ== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , GNU/Weeb Mailing List , Alviro Iskandar Setiawan Subject: [PATCH v1 1/4] Add config.py.example Date: Thu, 11 Aug 2022 15:26:53 +0700 Message-Id: <20220811082656.1420-2-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220811082656.1420-1-kiizuha@gnuweeb.org> References: <20220811082656.1420-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I want to filter specific command with admin-only access, which will be add to add_atom and add_bc commands and callbacks. Signed-off-by: Muhammad Rizki --- daemon/config.py.example | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 daemon/config.py.example diff --git a/daemon/config.py.example b/daemon/config.py.example new file mode 100644 index 0000000..3818d27 --- /dev/null +++ b/daemon/config.py.example @@ -0,0 +1,11 @@ +from pyrogram import filters +from pyrogram.types import Message + +# Insert Telegram admin id in the list below +ADMINS = [] + + +async def adm_flt(_, __, m: Message): + return m.from_user.id in ADMINS + +admin_only = filters.create(adm_flt) -- Muhammad Rizki