mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
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:
parent
e335d36c5d
commit
9adf448701
2 changed files with 11 additions and 14 deletions
|
|
@ -8,21 +8,18 @@ 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
|
||||
):
|
||||
await ctx.reply_msg(
|
||||
f'I am sorry, You are banned to use Me. \nBan Reason: {ban["ban_reason"]}'
|
||||
)
|
||||
await ctx.stop_propagation()
|
||||
except:
|
||||
await ctx.continue_propagation()
|
||||
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
|
||||
):
|
||||
await ctx.reply_msg(
|
||||
f'I am sorry, You are banned to use Me. \nBan Reason: {ban["ban_reason"]}'
|
||||
)
|
||||
await ctx.stop_propagation()
|
||||
|
||||
|
||||
@app.on_message(filters.group & filters.incoming, group=-2)
|
||||
|
|
|
|||
|
|
@ -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=(
|
||||
|
|
|
|||
Loading…
Reference in a new issue