@borg.on(admin_cmd(pattern='kangsticker ?(.*)'))
async def _(event):
    if event.fwd_from:
        return
    if (not event.is_reply):
        (await event.edit('Reply to a photo to add to my personal sticker pack.'))
        return
    reply_message = (await event.get_reply_message())
    sticker_emoji = '🔥'
    input_str = event.pattern_match.group(1)
    if input_str:
        sticker_emoji = input_str
    me = borg.me
    userid = event.from_id
    packname = f"{userid}'s @MC0917 Pack"
    packshortname = f'MC_0917_{userid}'
    is_a_s = is_it_animated_sticker(reply_message)
    file_ext_ns_ion = '@MC0917_Sticker.png'
    file = (await borg.download_file(reply_message.media))
    uploaded_sticker = None
    if is_a_s:
        file_ext_ns_ion = 'AnimatedSticker.tgs'
        uploaded_sticker = (await borg.upload_file(file, file_name=file_ext_ns_ion))
        packname = f"{userid}'s @AnimatedStickersGroup"
        packshortname = f'MC_0917_{userid}_as'
    elif (not is_message_image(reply_message)):
        (await event.edit('Invalid message type'))
        return
    else:
        with BytesIO(file) as mem_file, BytesIO() as sticker:
            resize_image(mem_file, sticker)
            sticker.seek(0)
            uploaded_sticker = (await borg.upload_file(sticker, file_name=file_ext_ns_ion))
    (await event.edit('Processing this sticker. Please Wait!'))
    async with borg.conversation('@Stickers') as bot_conv:
        now = datetime.datetime.now()
        dt = (now + datetime.timedelta(minutes=1))
        if (not (await stickerset_exists(bot_conv, packshortname))):
            (await silently_send_message(bot_conv, '/cancel'))
            if is_a_s:
                response = (await silently_send_message(bot_conv, '/newanimated'))
            else:
                response = (await silently_send_message(bot_conv, '/newpack'))
            if ('Yay!' not in response.text):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
            response = (await silently_send_message(bot_conv, packname))
            if (not response.text.startswith('Alright!')):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
            w = (await bot_conv.send_file(file=uploaded_sticker, allow_cache=False, force_document=True))
            response = (await bot_conv.get_response())
            if ('Sorry' in response.text):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
            (await silently_send_message(bot_conv, sticker_emoji))
            (await silently_send_message(bot_conv, '/publish'))
            response = (await silently_send_message(bot_conv, f'<{packname}>'))
            (await silently_send_message(bot_conv, '/skip'))
            response = (await silently_send_message(bot_conv, packshortname))
            if (response.text == 'Sorry, this short name is already taken.'):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
        else:
            (await silently_send_message(bot_conv, '/cancel'))
            (await silently_send_message(bot_conv, '/addsticker'))
            (await silently_send_message(bot_conv, packshortname))
            (await bot_conv.send_file(file=uploaded_sticker, allow_cache=False, force_document=True))
            response = (await bot_conv.get_response())
            if ('Sorry' in response.text):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
            (await silently_send_message(bot_conv, sticker_emoji))
            (await silently_send_message(bot_conv, '/done'))
    (await event.edit(f'sticker added! Your pack can be found [here](t.me/addstickers/{packshortname})'))
@borg.on(admin_cmd(pattern='kangsticker ?(.*)'))
async def _(event):
    if event.fwd_from:
        return
    if (not event.is_reply):
        (await event.edit('Reply to a photo to add to my personal sticker pack.'))
        return
    reply_message = (await event.get_reply_message())
    sticker_emoji = '🔥'
    input_str = event.pattern_match.group(1)
    if input_str:
        sticker_emoji = input_str
    me = borg.me
    userid = event.from_id
    packname = f"{userid}'s @MC0917 Pack"
    packshortname = f'MC_0917_{userid}'
    is_a_s = is_it_animated_sticker(reply_message)
    file_ext_ns_ion = '@MC0917_Sticker.png'
    file = (await borg.download_file(reply_message.media))
    uploaded_sticker = None
    if is_a_s:
        file_ext_ns_ion = 'AnimatedSticker.tgs'
        uploaded_sticker = (await borg.upload_file(file, file_name=file_ext_ns_ion))
        packname = f"{userid}'s @AnimatedStickersGroup"
        packshortname = f'MC_0917_{userid}_as'
    elif (not is_message_image(reply_message)):
        (await event.edit('Invalid message type'))
        return
    else:
        with BytesIO(file) as mem_file, BytesIO() as sticker:
            resize_image(mem_file, sticker)
            sticker.seek(0)
            uploaded_sticker = (await borg.upload_file(sticker, file_name=file_ext_ns_ion))
    (await event.edit('Processing this sticker. Please Wait!'))
    async with borg.conversation('@Stickers') as bot_conv:
        now = datetime.datetime.now()
        dt = (now + datetime.timedelta(minutes=1))
        if (not (await stickerset_exists(bot_conv, packshortname))):
            (await silently_send_message(bot_conv, '/cancel'))
            if is_a_s:
                response = (await silently_send_message(bot_conv, '/newanimated'))
            else:
                response = (await silently_send_message(bot_conv, '/newpack'))
            if ('Yay!' not in response.text):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
            response = (await silently_send_message(bot_conv, packname))
            if (not response.text.startswith('Alright!')):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
            w = (await bot_conv.send_file(file=uploaded_sticker, allow_cache=False, force_document=True))
            response = (await bot_conv.get_response())
            if ('Sorry' in response.text):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
            (await silently_send_message(bot_conv, sticker_emoji))
            (await silently_send_message(bot_conv, '/publish'))
            response = (await silently_send_message(bot_conv, f'<{packname}>'))
            (await silently_send_message(bot_conv, '/skip'))
            response = (await silently_send_message(bot_conv, packshortname))
            if (response.text == 'Sorry, this short name is already taken.'):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
        else:
            (await silently_send_message(bot_conv, '/cancel'))
            (await silently_send_message(bot_conv, '/addsticker'))
            (await silently_send_message(bot_conv, packshortname))
            (await bot_conv.send_file(file=uploaded_sticker, allow_cache=False, force_document=True))
            response = (await bot_conv.get_response())
            if ('Sorry' in response.text):
                (await event.edit(f'**FAILED**! @Stickers replied: {response.text}'))
                return
            (await silently_send_message(bot_conv, sticker_emoji))
            (await silently_send_message(bot_conv, '/done'))
    (await event.edit(f'sticker added! Your pack can be found [here](t.me/addstickers/{packshortname})'))