def balance_to_user(message): try: if (':' in message.text): data = message.text.split(':') telegram_id = database.user_telegram_id(data[0]) user_code = database.user_invite_code(telegram_id) worker_code = database.worker_code(message.chat.id) if (user_code == worker_code) or (message.chat.id == support) or (message.chat.id == admin): value = float(data[1]) call = database.user_set_balance(telegram_id, value) if (call == 1): bot.send_message( message.chat.id, f'💁🏻♀️ Баланс был *изменен*\nНовый баланс: {database.user_balance(telegram_id)} ₽', parse_mode="Markdown") else: bot.send_message(message.chat.id, '⚠️ Данный пользователь записан *не за Вас*!', parse_mode="Markdown") except: pass
def info_mamont(message, classes): try: if (message.text.isdigit()) and (classes == '1'): num = database.user_num(message.text) balance = database.user_balance(message.text) status = database.user_status(message.text) invite_code = database.user_invite_code(message.text) bot.send_message( message.chat.id, f'(ID) - баланс - инвайт код - статус\n\n({num}) - {invite_code} - {balance} ₽ - {status}', parse_mode="Markdown") elif (message.text.isdigit()) and (classes == '0'): telegram_id = database.user_telegram_id(message.text) username = database.user_username(telegram_id) balance = database.user_balance(telegram_id) status = database.user_status(telegram_id) invite_code = database.user_invite_code(telegram_id) bot.send_message( message.chat.id, f'(ID) - баланс - @username - инвайт код - статус\n\n({message.text}) - @{str(username)} - {invite_code} - {balance} ₽ - {status}', parse_mode="Markdown") except: pass
def message_to_users(message): try: if (':' in message.text): data = message.text.split(':') telegram_id = database.user_telegram_id(data[0]) user_code = database.user_invite_code(telegram_id) worker_code = database.worker_code(message.chat.id) if (user_code == worker_code) or (message.chat.id == support_id): bot.send_message(telegram_id, data[1], parse_mode="Markdown") Thread = threading.Thread(target=checking_username, args=(telegram_id, responce.text)) Thread.start() return True else: return False else: return False except: pass
def del_mamont_num(message): try: if (message.text.isdigit()): telegram_id = database.user_telegram_id(message.text) database.user_update_invite_code(telegram_id, '0') bot.send_message(message.chat.id, '💁🏻♀️ Мамонт был *удален*', parse_mode='Markdown') except: pass
def status_to_user(message): try: if (':' in message.text): data = message.text.split(':') telegram_id = database.user_telegram_id(data[0]) worker_code = database.worker_code(telegram_id) if (worker_code == worker_code) or (message.chat.id == support): call = database.user_update_status(telegram_id, data[1]) if (call == 1): bot.send_message(message.chat.id, f'💁🏻♀️ Статус *изменен*\nНовый статус: {database.user_status(telegram_id)}', parse_mode="Markdown") else: bot.send_message(message.chat.id, '⚠️ Данный пользователь записан *не за Вас*!', parse_mode="Markdown") except: pass