diff --git a/misskaty/plugins/admin.py b/misskaty/plugins/admin.py index e48e09d2..c3fae308 100644 --- a/misskaty/plugins/admin.py +++ b/misskaty/plugins/admin.py @@ -762,9 +762,9 @@ async def check_warns(_, message, strings): @capture_err @use_chat_lang() async def report_user(_, ctx: Message, strings) -> "Message": - if not ctx.reply_to_message: + if len(ctx.text.split()) <= 1 and not ctx.reply_to_message: return await ctx.reply_msg(strings("report_no_reply")) - reply = ctx.reply_to_message + reply = ctx.reply_to_message if ctx.reply_to_message else ctx reply_id = reply.from_user.id if reply.from_user else reply.sender_chat.id user_id = ctx.from_user.id if ctx.from_user else ctx.sender_chat.id if reply_id == user_id: @@ -796,7 +796,7 @@ async def report_user(_, ctx: Message, strings) -> "Message": # return bots or deleted admins continue text += f"\u2063" - await ctx.reply_msg(text, reply_to_message_id=ctx.reply_to_message.id) + await reply.reply_msg(text) @app.on_cmd("set_chat_title", self_admin=True, group_only=True) diff --git a/misskaty/plugins/grup_tools.py b/misskaty/plugins/grup_tools.py index 2bedb300..7401d352 100644 --- a/misskaty/plugins/grup_tools.py +++ b/misskaty/plugins/grup_tools.py @@ -5,7 +5,7 @@ from datetime import datetime, timedelta from logging import getLogger from PIL import Image, ImageChops, ImageDraw, ImageFont -from pyrogram import enums, filters +from pyrogram import Client, enums, filters from pyrogram.enums import ChatMemberStatus as CMS from pyrogram.errors import ( ChatAdminRequired, @@ -95,7 +95,7 @@ def welcomepic(pic, user, chat, id, strings): filters.group & filters.chat([-1001128045651, -1001777794636]), group=6 ) @use_chat_lang() -async def member_has_joined(c: app, member: ChatMemberUpdated, strings): +async def member_has_joined(c: Client, member: ChatMemberUpdated, strings): if not ( member.new_chat_member and member.new_chat_member.status not in {CMS.BANNED} diff --git a/misskaty/plugins/notes.py b/misskaty/plugins/notes.py index b1561dd3..b53dd64b 100644 --- a/misskaty/plugins/notes.py +++ b/misskaty/plugins/notes.py @@ -116,7 +116,7 @@ async def save_notee(_, message): if replied_message.voice: _type = "voice" file_id = replied_message.voice.file_id - if replied_message.reply_markup and "~" not in data: + if replied_message.reply_markup and not findall(r"\[.+\,.+\]", data): if urls := extract_urls(replied_message.reply_markup): response = "\n".join( [f"{name}=[{text}, {url}]" for name, text, url in urls]