# This is a troll indeed ffs *facepalm*
import asyncio
from telethon import events
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import ChannelParticipantsAdmins
from userbot.utils import admin_cmd


@borg.on(admin_cmd("gbun"))
async def gbun(event):
    if event.fwd_from:
        return
    gbunVar = event.text
    gbunVar = gbunVar[6:]
    mentions = "`Warning!! User ğ�™‚ğ�˜½ğ�˜¼ğ�™‰ğ�™‰ğ�™€ğ�˜¿ By Admin...\n`"
    no_reason = "__Reason: Not given __"
    await event.edit("**Summoning out le Gungnir â�—ï¸�âšœï¸�â˜ ï¸�**")
    asyncio.sleep(3.5)
    chat = await event.get_input_chat()
    async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
        mentions += f""
    reply_message = None
    if event.reply_to_msg_id:
        reply_message = await event.get_reply_message()
        replied_user = await event.client(GetFullUserRequest(reply_message.from_id))
        firstname = replied_user.user.first_name
        usname = replied_user.user.username
        idd = reply_message.from_id
        # make meself invulnerable cuz why not xD
        if idd == 948408212:
            await reply_message.reply("`Wait a second, This is my master!`\n**How dare you threaten to ban my master nigger!**\n\n__Your account has been hacked! Pay 69$ to my master__ [Jayu](tg://user?id=948408212) __to release your account__ğŸ˜�")
        else:
            jnl=("`Warning!! `"
                  "[{}](tg://user?id={})"
                  "` ğ�™‚ğ�˜½ğ�˜¼ğ�™‰ğ�™‰ğ�™€ğ�˜¿ By Admin...\n\n`"
                  "**Person's Name: ** __{}__\n"
                  "**ID : ** `{}`\n"
                ).format(firstname, idd, firstname, idd)
            if usname == None:
                jnl += "**Victim Nigga's username: ** `Doesn't own a username!`\n"
            elif usname != "None":
                jnl += "**Victim Nigga's username** : @{}\n".format(usname)
            if len(gbunVar) > 0:
                gbunm = "`{}`".format(gbunVar)
                gbunr = "**Reason: **"+gbunm
                jnl += gbunr
            else:
                jnl += no_reason
            await reply_message.reply(jnl)
    else:
        mention = "`Warning!! User ğ�™‚ğ�˜½ğ�˜¼ğ�™‰ğ�™‰ğ�™€ğ�˜¿ By Admin...\nReason: Not Given `"
        await event.reply(mention)
    await event.delete()
