taslim19 commited on
Commit ·
f62e994
1
Parent(s): d583fa4
fix: allow OWNER_ID to access stats and update command to /stats
Browse files
Devine/plugins/tools/stats.py
CHANGED
|
@@ -18,11 +18,11 @@ from Devine.utils.inline.stats import back_stats_buttons, stats_buttons
|
|
| 18 |
from config import BANNED_USERS
|
| 19 |
from pytgcalls.__version__ import __version__ as pytgver # Ensure this import is present
|
| 20 |
|
| 21 |
-
@app.on_message(filters.command(["
|
| 22 |
@language
|
| 23 |
async def stats_global(client, message: Message, _):
|
| 24 |
-
if message.from_user.id not in SUDOERS:
|
| 25 |
-
return # Ignore message if user is not in SUDOERS
|
| 26 |
upl = stats_buttons(_, True if message.from_user.id in SUDOERS else False)
|
| 27 |
await message.reply_text(
|
| 28 |
text=_["gstats_2"].format(app.mention),
|
|
|
|
| 18 |
from config import BANNED_USERS
|
| 19 |
from pytgcalls.__version__ import __version__ as pytgver # Ensure this import is present
|
| 20 |
|
| 21 |
+
@app.on_message(filters.command(["stats"]) & filters.group & ~BANNED_USERS)
|
| 22 |
@language
|
| 23 |
async def stats_global(client, message: Message, _):
|
| 24 |
+
if message.from_user.id not in SUDOERS and message.from_user.id != config.OWNER_ID:
|
| 25 |
+
return # Ignore message if user is not in SUDOERS or OWNER_ID
|
| 26 |
upl = stats_buttons(_, True if message.from_user.id in SUDOERS else False)
|
| 27 |
await message.reply_text(
|
| 28 |
text=_["gstats_2"].format(app.mention),
|