File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,21 @@ def ultroid_cmd(
7878
7979 def decor (dec ):
8080 async def wrapp (ult ):
81+ if udB .get_key ("COMMAND_LOGGER" ):
82+ user_id = ult .sender_id
83+ chat_id = ult .chat_id
84+ command_name = pattern if pattern else ult .text .split ()[0 ].lstrip (HNDLR )
85+ chat_name = get_display_name (ult .chat )
86+ LOGS .info (f"Command '{ command_name } ' executed by user ID { user_id } in chat { chat_id } ({ chat_name } )" )
87+ log_channel = udB .get_key ("LOG_CHANNEL" )
88+ if log_channel :
89+ try :
90+ await asst .send_message (
91+ log_channel ,
92+ f"Command '{ command_name } ' executed by user ID { user_id } in chat { chat_id } ({ chat_name } )"
93+ )
94+ except Exception as e :
95+ LOGS .warning (f"Failed to send command log to log channel { log_channel } : { e } " )
8196 if not ult .out :
8297 if owner_only :
8398 return
You can’t perform that action at this time.
0 commit comments