taslim19 commited on
Commit
56b2d03
·
1 Parent(s): ab9e43d

fix: Allow owner to use invitelink command and add debug logging

Browse files
DragMusic/plugins/tools/invitelink.py CHANGED
@@ -6,6 +6,7 @@ import os
6
  import json
7
  from pyrogram.types import Message
8
  from DragMusic.misc import SUDOERS
 
9
 
10
 
11
 
@@ -18,8 +19,12 @@ async def give_link_command(client, message):
18
  await message.reply_text(f"Here's the invite link for this chat:\n{link}")
19
 
20
 
21
- @app.on_message(filters.command(["link", "invitelink"], prefixes=["/", "!", "%", ",", "", ".", "@", "#"]) & SUDOERS)
22
  async def link_command_handler(client: Client, message: Message):
 
 
 
 
23
  if len(message.command) != 2:
24
  await message.reply("Invalid usage. Correct format: /link group_id")
25
  return
 
6
  import json
7
  from pyrogram.types import Message
8
  from DragMusic.misc import SUDOERS
9
+ from config import OWNER_ID
10
 
11
 
12
 
 
19
  await message.reply_text(f"Here's the invite link for this chat:\n{link}")
20
 
21
 
22
+ @app.on_message(filters.command(["link", "invitelink"], prefixes=["/", "!", "%", ",", "", ".", "@", "#"]) & (SUDOERS | filters.user(OWNER_ID)))
23
  async def link_command_handler(client: Client, message: Message):
24
+ print(f"Link command triggered by user {message.from_user.id}")
25
+ print(f"User is in SUDOERS: {message.from_user.id in SUDOERS}")
26
+ print(f"User is OWNER_ID: {message.from_user.id == OWNER_ID}")
27
+
28
  if len(message.command) != 2:
29
  await message.reply("Invalid usage. Correct format: /link group_id")
30
  return