public inbox for [email protected]
 help / color / mirror / Atom feed
From: Muhammad Rizki <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: Muhammad Rizki <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	Alviro Iskandar Setiawan <[email protected]>
Subject: [PATCH v1 1/4] Add config.py.example
Date: Thu, 11 Aug 2022 15:26:53 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
---
 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


  reply	other threads:[~2022-08-11  8:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11  8:26 [PATCH v1 0/4] Add admin configuration Muhammad Rizki
2022-08-11  8:26 ` Muhammad Rizki [this message]
2022-08-11  8:26 ` [PATCH v1 2/4] Add config.py in .gitignore Muhammad Rizki
2022-08-11  8:26 ` [PATCH v1 3/4] Use created filter for admin-only Muhammad Rizki
2022-08-11  8:26 ` [PATCH v1 4/4] Remove unused codes in some files Muhammad Rizki
2022-08-11 22:29 ` [PATCH v1 0/4] Add admin configuration Ammar Faizi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox