deleteFlag = True
def delete1(bot, update):
admins = [admin.user.id for admin in bot.get_chat_administrators(chat_id=update.message.chat_id)]
if update.message.from_user.id in admins:
bot.send_message(update.message.chat_id, "Режим включен")
while True:
deleteFlag = True
elif update.message.from_user.id not in admins:
bot.send_message(update.message.chat_id, "У тебя нет прав")
def delete2(bot, update):
admins = [admin.user.id for admin in bot.get_chat_administrators(chat_id=update.message.chat_id)]
if update.message.from_user.id in admins:
bot.send_message(update.message.chat_id, "Режим выключен")
while True:
deleteFlag = False
elif update.message.from_user.id not in admins:
bot.send_message(update.message.chat_id, "У тебя нет прав")
def delete(bot, update):
global deleteFlag
if deleteFlag:
while True:
admins = [admin.user.id for admin in bot.get_chat_administrators(chat_id=update.message.chat_id)]
if update.message.from_user.id not in admins:
bot.delete_message(chat_id=update.message.chat_id, message_id=update.message.message_id)
def delete1(bot, update):
admins = [admin.user.id for admin in bot.get_chat_administrators(chat_id=update.message.chat_id)]
if update.message.from_user.id in admins:
bot.send_message(update.message.chat_id, "Режим включен")
while True:
deleteFlag = True
elif update.message.from_user.id not in admins:
bot.send_message(update.message.chat_id, "У тебя нет прав")
def delete2(bot, update):
admins = [admin.user.id for admin in bot.get_chat_administrators(chat_id=update.message.chat_id)]
if update.message.from_user.id in admins:
bot.send_message(update.message.chat_id, "Режим выключен")
while True:
deleteFlag = False
elif update.message.from_user.id not in admins:
bot.send_message(update.message.chat_id, "У тебя нет прав")
def delete(bot, update):
global deleteFlag
if deleteFlag:
while True:
admins = [admin.user.id for admin in bot.get_chat_administrators(chat_id=update.message.chat_id)]
if update.message.from_user.id not in admins:
bot.delete_message(chat_id=update.message.chat_id, message_id=update.message.message_id)
вот я попробовал но ничего не происходит.