I am using pyautogui and pydirect, it's moving the cursor but not clicking, but after i move the mouse little bit it works
here is the code-
def close_chat():
time.sleep(1)
#pydirectinput.moveTo(139, 56)
#pydirectinput.click()
pydirectinput.keyDown('esc')
pydirectinput.keyUp('esc')
print("pressed esc")
time.sleep(1)
pydirectinput.click(139, 56)
time.sleep(1)
pydirectinput.click(139, 56)
time.sleep(1)
pydirectinput.click(139, 56)```