Skip to content

Commit 6ebe353

Browse files
Update amogus.py
1 parent 59e5ab1 commit 6ebe353

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fun/amogus.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Original module author: t.me/KeyZenD
2-
# Adaptation for Moon-Userbot by t.me/AmokDev (github.com/AmokDev)
2+
# Adaptation for Dragon-Userbot by t.me/AmokDev (github.com/AmokDev)
3+
# Adaptation for Moon-Userbot by Abhi
34

45
from io import BytesIO
56
from random import randint
@@ -30,9 +31,11 @@ async def amogus(client: Client, message: Message):
3031
imposter = Image.open(BytesIO(get(f"{url}{clr}.png").content))
3132

3233
text_ = "\n".join(["\n".join(wrap(part, 30)) for part in text.split("\n")])
33-
w, h = ImageDraw.Draw(Image.new("RGB", (1, 1))).multiline_textsize(
34-
text_, font, stroke_width=2
34+
bbox = ImageDraw.Draw(Image.new("RGB", (1, 1))).multiline_textbbox(
35+
(0, 0), text_, font, stroke_width=2
3536
)
37+
# w, h = bbox[2] - bbox[0], bbox[3] - bbox[1]
38+
w, h = bbox[2], bbox[3]
3639
text = Image.new("RGBA", (w + 30, h + 30))
3740
ImageDraw.Draw(text).multiline_text(
3841
(15, 15), text_, "#FFF", font, stroke_width=2, stroke_fill="#000"

0 commit comments

Comments
 (0)