diff --git a/pagermaid/modules/fun.py b/pagermaid/modules/fun.py index 668f7e9..0e6a906 100644 --- a/pagermaid/modules/fun.py +++ b/pagermaid/modules/fun.py @@ -194,9 +194,12 @@ async def ship(context): else: await context.edit(lang('arg_error')) return - await context.edit(f"**{lang('ship_hint')}(((**\n" - f"[{target_1.first_name}](tg://user?id={target_1.id}) + " - f"[{target_2.first_name}](tg://user?id={target_2.id}) = ❤️") + try: + await context.edit(f"**{lang('ship_hint')}(((**\n" + f"[{target_1.first_name}](tg://user?id={target_1.id}) + " + f"[{target_2.first_name}](tg://user?id={target_2.id}) = ❤️") + except AttributeError: + await context.edit(lang('ship_BaseException')) @listener(is_plugin=False, outgoing=True, command=alias_command("rng"), diff --git a/pagermaid/modules/sb.py b/pagermaid/modules/sb.py index 6e2b70d..24799a1 100644 --- a/pagermaid/modules/sb.py +++ b/pagermaid/modules/sb.py @@ -5,7 +5,7 @@ from struct import error as StructError from telethon.tl.functions.messages import GetCommonChatsRequest from telethon.tl.functions.users import GetFullUserRequest from telethon.tl.functions.channels import DeleteUserHistoryRequest -from telethon.tl.types import MessageEntityMentionName, ChannelParticipantsAdmins, MessageEntityPhone +from telethon.tl.types import MessageEntityMentionName, ChannelParticipantsAdmins, MessageEntityPhone, PeerChannel from telethon.errors.rpcerrorlist import UserAdminInvalidError, ChatAdminRequiredError, FloodWaitError from asyncio import sleep from random import uniform @@ -48,12 +48,18 @@ async def span_ban(context): else: await context.edit(lang('arg_error')) return + if isinstance(user, PeerChannel): + return await context.edit(lang('arg_error')) + elif not user: + return await context.edit(lang('arg_error')) target_user = await context.client(GetFullUserRequest(user)) else: if len(context.parameter) == 1: user = context.parameter[0] if user.isnumeric(): user = int(user) + if user < 0: + return await context.edit(lang('arg_error')) else: await context.edit(lang('arg_error')) return