Fix memify for pillow v10 and minor fix (#129)

* Update ban_user_or_chat.py

* Update ban_user_or_chat.py

* Update ban_user_or_chat.py

* Update ban_user_or_chat.py

* Update ban_user_or_chat.py

* Update ban_user_or_chat.py

* Update ban_user_or_chat.py

* Fix memify for pillow v10
This commit is contained in:
yasirarism 2023-07-03 17:25:12 +07:00 committed by GitHub
parent e335d36c5d
commit 9adf448701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 14 deletions

View file

@ -8,11 +8,10 @@ from misskaty.helper.localization import use_chat_lang
from misskaty.vars import COMMAND_HANDLER, LOG_CHANNEL, SUDO, SUPPORT_CHAT
@app.on_message(filters.incoming, group=-1)
@app.on_message(filters.incoming, group=-5)
async def ban_reply(self: Client, ctx: Message):
if not ctx.from_user:
return
try:
ban = await db.get_ban_status(ctx.from_user.id)
if (ban.get("is_banned") and ctx.chat.type.value == "private") or (
ban.get("is_banned") and ctx.chat.type.value == "supergroup" and ctx.command
@ -21,8 +20,6 @@ async def ban_reply(self: Client, ctx: Message):
f'I am sorry, You are banned to use Me. \nBan Reason: {ban["ban_reason"]}'
)
await ctx.stop_propagation()
except:
await ctx.continue_propagation()
@app.on_message(filters.group & filters.incoming, group=-2)

View file

@ -28,7 +28,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):
u_width, u_height = draw.textsize(u_text, font=m_font)
u_width, u_height = draw.getbbox(u_text, font=m_font)
draw.text(
xy=(((i_width - u_width) / 2) - 1, int((current_h / 640) * i_width)),
@ -72,7 +72,7 @@ async def draw_meme_text(image_path, text):
current_h += u_height + pad
if lower_text:
for l_text in textwrap.wrap(lower_text, width=15):
u_width, u_height = draw.textsize(l_text, font=m_font)
u_width, u_height = draw.getbbox(l_text, font=m_font)
draw.text(
xy=(