Co-authored-by: Danish <danish@ultroid.tech> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com> Co-authored-by: sppidy <sppidy@users.noreply.github.com> Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com> Co-authored-by: divkix <divkix@users.noreply.github.com> Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com> Co-authored-by: Programming Error <error@notavailable.live>
60 lines
1.5 KiB
Python
60 lines
1.5 KiB
Python
# Ultroid - UserBot
|
|
# Copyright (C) 2021 TeamUltroid
|
|
#
|
|
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
|
# PLease read the GNU Affero General Public License in
|
|
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
|
"""
|
|
✘ Commands Available -
|
|
|
|
• `{i}github <username>`
|
|
Get full information of the users github profile.
|
|
"""
|
|
import requests
|
|
|
|
from . import *
|
|
|
|
|
|
@ultroid_cmd(
|
|
pattern="github (.*)",
|
|
)
|
|
async def gitsearch(event):
|
|
xx = await eor(event, get_string("com_2"))
|
|
try:
|
|
usrname = event.pattern_match.group(1)
|
|
except BaseException:
|
|
return await xx.edit("`Search for whom? Give me a user name!!`")
|
|
url = f"https://api.github.com/users/{usrname}"
|
|
ult = requests.get(url).json()
|
|
try:
|
|
uname = ult["login"]
|
|
uid = ult["id"]
|
|
upic = f"https://avatars.githubusercontent.com/u/{uid}"
|
|
ulink = ult["html_url"]
|
|
uacc = ult["name"]
|
|
ucomp = ult["company"]
|
|
ublog = ult["blog"]
|
|
ulocation = ult["location"]
|
|
ubio = ult["bio"]
|
|
urepos = ult["public_repos"]
|
|
ufollowers = ult["followers"]
|
|
ufollowing = ult["following"]
|
|
except BaseException:
|
|
return await xx.edit("`No such user found...`")
|
|
fullusr = f"""
|
|
**[GITHUB]({ulink})**
|
|
|
|
**Name** - {uacc}
|
|
**UserName** - {uname}
|
|
**ID** - {uid}
|
|
**Company** - {ucomp}
|
|
**Blog** - {ublog}
|
|
**Location** - {ulocation}
|
|
**Bio** - {ubio}
|
|
**Repos** - {urepos}
|
|
**Followers** - {ufollowers}
|
|
**Following** - {ufollowing}
|
|
"""
|
|
await xx.delete()
|
|
await event.reply(fullusr, file=upic)
|