staticmethod def send_for_moder copy_leak try moder_chat privateId mai

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@staticmethod
def send_for_moder(copy_leak):
try:
moder_chat = privateId.main_premoder_chat_id
#main_info = coreInfo.get_full_info(chat_id,1,1)
main_info = "".join(copy_leak.get_parse_information(1))
hash_id_list = [[],[],[]]
#msg_with_cont = coreInfo.get_some_info(chat_id,2,1)
msg_with_cont = copy_leak.get_field(2)
for index, info in enumerate(msg_with_cont):
#hash_id_list[index] = coreInfo.get_list_of_value_from_map(chat_id,msg_with_cont[index],1)
hash_id_list[index] = [copy_leak.msg_hash_map.get(key) for key in msg_with_cont[index]]
photo_hash = [hash_id_list[0][i:i+10] for i in range(0,len(hash_id_list[0]),10)]
documents = msg_with_cont[1]
video_hash = [hash_id_list[2][i:i+10] for i in range(0,len(hash_id_list[2]),10)]
sep = "=^"*20+"="
#user_name = coreInfo.get_user_name(chat_id,1)
user_name = copy_leak.user_name
b_msg_id = bot.send_message(moder_chat, sep).message_id
bot.send_message(moder_chat, "Слив от "+user_name)
bot.send_message(moder_chat, main_info, parse_mode="HTML")
#user_id = coreInfo.get_user_id(chat_id,1)
user_id = copy_leak.user_id
#user_ans_for_leak = coreInfo.get_some_info(chat_id,9,1)
user_ans_for_leak = copy_leak.get_field(9)
# def send_group(group):
# return bot.send_media_group(moder_chat, group)
def send_doc():
for doc in documents:
try:
bot.forward_message(moder_chat,int(user_id),doc)
except BotError:
bot.send_message(moder_chat, "Сообщение с документом было удалено пользователем")
if(len(msg_with_cont[0])):
bot.send_message(moder_chat, "\nФото\n")
for group in photo_hash:
bot.send_media_group(moder_chat, group)
# sending = Thread(target=send_group,args=[group])
# sending.start()
# sending.join()
if (len(msg_with_cont[1])):
bot.send_message(moder_chat, "\nДокументы\n")
send_doc()
# sending = Thread(target=send_doc)
# sending.start()
# sending.join()
if (len(msg_with_cont[2])):
bot.send_message(moder_chat, "\nВидео\n")
for group in video_hash:
bot.send_media_group(moder_chat, group)
# sending = Thread(target=send_group,args=[group])
# sending.start()
# sending.join()
mkeyboard = types.InlineKeyboardMarkup()
if user_ans_for_leak:
msg = "Оценка слива: "
spec_rating_keyboard = types.InlineKeyboardMarkup()
keys = []
for star in range(1,6):
keys.append(types.InlineKeyboardButton(
text=emojiT.take_emoji_number(star), callback_data=str(user_id)+" add_star "+str(star)
))
spec_rating_keyboard.row(*keys)
spec_rating_keyboard.row(types.InlineKeyboardButton(
text="Не оценивать слив (дроп)",callback_data=str(user_id)+ " drop"
))
bot.send_message(moder_chat, text=msg, reply_markup= spec_rating_keyboard)
f_msg_id = bot.send_message(moder_chat, "Слив от " + user_name).message_id
bot.delete_message(moder_chat, f_msg_id)
mkeyboard.row(types.InlineKeyboardButton(text="Удалить текущий слив", callback_data=
str(user_id)+" del "+"s"+str(b_msg_id)+
"f"+str(f_msg_id)))
mkeyboard.row(types.InlineKeyboardButton(text="Забанить пользователя", callback_data=
str(user_id) + " ban "+ "s"+str(b_msg_id)+
"f"+str(f_msg_id)))
bot.send_message(moder_chat, text= "Список действий c пользователем {}:"
.format(user_name), reply_markup = mkeyboard)
# coreInfo.q_counter-=1
# coreInfo.del_copy(chat_id)
del copy_leak
except Exception as e:
print(e)
# coreInfo.q_counter-=1
# coreInfo.del_copy(chat_id)
bot.send_message(privateId.main_premoder_chat_id,"Произошла ошибка при парсинге инфы {} - {}, "
"загляни в бэкапы"
.format(copy_leak.user_id,copy_leak.user_name))
del copy_leak
#Generator.reset_and_back_to_main(chat_id)