This commit is contained in:
yasirarism 2023-07-03 21:09:10 +07:00 committed by GitHub
parent 45eb99440f
commit 926caa9eb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import textwrap
import textwrap, logging
from asyncio import gather
from os import remove as hapus
@ -11,6 +11,7 @@ from misskaty.core.decorator.ratelimiter import ratelimiter
from misskaty.helper.localization import use_chat_lang
from misskaty.vars import COMMAND_HANDLER
LOGGER = logging.getLogger(__name__)
async def draw_meme_text(image_path, text):
img = Image.open(image_path)
@ -28,7 +29,7 @@ async def draw_meme_text(image_path, text):
current_h, pad = 10, 5
if upper_text:
for u_text in textwrap.wrap(upper_text, width=15):
low_test = draw.textlength(text=l_text, font=m_font)
low_test = draw.textlength(text=u_text, font=m_font)
LOGGER.info(low_test)
u_width, u_height = draw.textlength(text=u_text, font=m_font)
draw.text(

View file

@ -7,6 +7,16 @@ import dotenv
import requests
from git import Repo
logging.basicConfig(
level=INFO,
format="[%(asctime)s - %(levelname)s] - %(name)s.%(funcName)s - %(message)s",
datefmt="%d-%b-%y %H:%M:%S",
handlers=[
logging.handlers.RotatingFileHandler("MissKatyLogs.txt", mode="w+", maxBytes=1000000),
logging.StreamHandler(),
],
)
LOGGER = logging.getLogger(__name__)
ENV_URL = os.environ.get("ENV_URL")