def handle_new_name(message): user_name = message.from_user.first_name chat_id = message.chat.id user_id = message.from_user.id bot.send_message(chat_id, f"{user_name}, ваше ім'я в рейтингу оновлено!") data.users_in_ass_game[chat_id][user_id][0] = user_name adf.save_stats_in_file(data.file_of_ass_stats, data.users_in_ass_game)
def handle_start(message): chat_id = message.chat.id msg = data.greetings bot.send_message(chat_id, msg)
def send_invalid_syntax(message): chat_id = message.chat.id msg = 'команда має структуру: /ddos_on (або off) [username] \n' \ 'у квадратних дужках вказується юзернейм того, кого (не) дудосити' bot.send_message(chat_id, msg)
def send_ddos_off(message): chat_id = message.chat.id username = get_username_from_text(message) msg = f'вимкнено ddos-режим на @{username}' bot.send_message(chat_id, msg)
def send_encrypt(message, content): chat_id = message.chat.id skip, _text, _from, _to = content encoded = encode(_text, _from, _to) msg = str_encrypted_msg(encoded) bot.send_message(chat_id, msg)
def send_encrypt_rules(message): chat_id = message.chat.id msg = str_encrypt_rules() bot.send_message(chat_id, msg)
def send_search_game(message): chat_id = message.chat.id user_name = message.from_user.first_name msg = str_search_game(user_name) bot.send_message(chat_id, msg)