This commit is contained in:
kr0sh512
2024-09-01 00:52:33 +03:00
parent 681c3eee64
commit ee3b23ad59
4 changed files with 211 additions and 141 deletions
+16 -8
View File
@@ -1,12 +1,15 @@
import schedules as bot
admin_id = '856850518'
admin_id = "856850518"
def admin_command(func):
def wrapper(*args, **kwargs):
message = args[0]
if str(message.from_user.id) != admin_id:
bot.send_message(message.from_user.id, 'Команда доступна только администратору')
bot.send_message(
message.from_user.id, "Команда доступна только администратору"
)
return
func(*args, **kwargs)
@@ -14,15 +17,20 @@ def admin_command(func):
return wrapper
def is_admin(message):
if str(message.from_user.id) == admin_id and message.from_user.id == message.chat.id:
if (
str(message.from_user.id) == admin_id
and message.from_user.id == message.chat.id
):
return True
return False
def send_admin_message(text):
bot.send_message(admin_id, '🛑 ' + text)
bot.send_message(admin_id, "🛑 " + text)
def send_admin_document(file):
bot.send_document(admin_id, file, '🛑 Admin file')
bot.send_document(admin_id, file, "🛑 Admin file")