add common resolutions to screenshot

This commit is contained in:
Nexus 2024-04-02 02:38:20 +01:00
parent b15d0ad34c
commit 4f7d76d5d5

View file

@ -112,6 +112,18 @@ class ScreenshotCog(commands.Cog):
)
driver.set_page_load_timeout(load_timeout)
if resolution:
common = {
"8k": "7680x4320",
"4k": "3840x2160",
"1440p": "2560x1440",
"1080p": "1920x1080",
"720p": "1280x720",
"480p": "854x480",
"360p": "640x360",
"240p": "426x240",
"144p": "256x144"
}
resolution = common.get(resolution.lower(), resolution)
try:
width, height = map(int, resolution.split("x"))
driver.set_window_size(width, height)