When sending a telegram picture to the bot from the camera, the light on the webcam does not turn off, if you run the code without the bot, the light turns off.
def cam(message): cap = cv2.VideoCapture(0) cap.set(3,1980) cap.set(4,1080) for i in range(5): cap.read() ret, frame = cap.read() cv2.imwrite('cam.png', frame) cap.release()