Skip to content

Commit b0c2e3f

Browse files
FIX: Adjusting region parameter in screenshot method
1 parent 2588aba commit b0c2e3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

botcity/core/bot.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,12 @@ def screenshot(self, filepath=None, region=None):
508508
Returns:
509509
Image: The screenshot Image object
510510
"""
511+
if region:
512+
x, y, width, height = region
513+
width = x + width
514+
height = y + height
515+
region = (x, y, width, height)
516+
511517
img = ImageGrab.grab(bbox=region)
512518
if filepath:
513519
img.save(filepath)

0 commit comments

Comments
 (0)