|
|
@@ -4,9 +4,11 @@ from wbb.utils.inlinefuncs import (
|
|
|
alive_function, webss, shortify, wall_func,
|
|
|
saavn_func, deezer_func, inline_help_func,
|
|
|
torrent_func, youtube_func, lyrics_func,
|
|
|
- paste_func, eval_func
|
|
|
+ paste_func, eval_func, github_user_func,
|
|
|
+ github_repo_func
|
|
|
)
|
|
|
from pyrogram import filters
|
|
|
+from pyrogram.errors.exceptions.bad_request_400 import QueryIdInvalid
|
|
|
|
|
|
__MODULE__ = "Inline"
|
|
|
__HELP__ = '''
|
|
|
@@ -24,6 +26,8 @@ __HELP__ = '''
|
|
|
- lyrics [QUERY] - Lyrics Search.
|
|
|
- eval [CODE] - Execute Python Code.
|
|
|
- paste [TEXT] - Paste Text On Pastebin. <=500
|
|
|
+- gh_user [USERNAME] - Search A Github User.
|
|
|
+- gh_repo [USERNAME/REPO] - Search A Github Repo.
|
|
|
'''
|
|
|
|
|
|
|
|
|
@@ -54,28 +58,28 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
elif text.split()[0] == "tr":
|
|
|
lang = text.split()[1]
|
|
|
- tex = text.split(None, 2)[2]
|
|
|
+ tex = text.split(None, 2)[2].strip()
|
|
|
answerss = await translate_func(answers, lang, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answerss,
|
|
|
)
|
|
|
elif text.split()[0] == "ud":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await urban_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answerss,
|
|
|
)
|
|
|
elif text.split()[0] == "google":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await google_search_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answerss,
|
|
|
)
|
|
|
elif text.split()[0] == "webss":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await webss(tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -83,7 +87,7 @@ async def inline_query_handler(client, query):
|
|
|
cache_time=2
|
|
|
)
|
|
|
elif text.split()[0] == "bitly":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await shortify(tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -92,7 +96,7 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
|
|
|
elif text.split()[0] == "wall":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await wall_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -100,7 +104,7 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
|
|
|
elif text.split()[0] == "saavn":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await saavn_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -108,7 +112,7 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
|
|
|
elif text.split()[0] == "deezer":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await deezer_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -116,7 +120,7 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
|
|
|
elif text.split()[0] == "torrent":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await torrent_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -124,7 +128,7 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
|
|
|
elif text.split()[0] == "yt":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await youtube_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -132,7 +136,7 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
|
|
|
elif text.split()[0] == "lyrics":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await lyrics_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -140,7 +144,7 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
|
|
|
elif text.split()[0] == "paste":
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await paste_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -150,7 +154,7 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "eval":
|
|
|
user_id = query.from_user.id
|
|
|
- tex = text.split(None, 1)[1]
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await eval_func(answers, tex, user_id)
|
|
|
await client.answer_inline_query(
|
|
|
query.id,
|
|
|
@@ -158,5 +162,23 @@ async def inline_query_handler(client, query):
|
|
|
cache_time=2
|
|
|
)
|
|
|
|
|
|
- except (IndexError, TypeError, KeyError, ValueError):
|
|
|
+ elif text.split()[0] == "gh_user":
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
+ answerss = await github_user_func(answers, tex)
|
|
|
+ await client.answer_inline_query(
|
|
|
+ query.id,
|
|
|
+ results=answerss,
|
|
|
+ cache_time=2
|
|
|
+ )
|
|
|
+
|
|
|
+ elif text.split()[0] == "gh_repo":
|
|
|
+ tex = text.split(None, 1)[1].strip()
|
|
|
+ answerss = await github_repo_func(answers, tex)
|
|
|
+ await client.answer_inline_query(
|
|
|
+ query.id,
|
|
|
+ results=answerss,
|
|
|
+ cache_time=2
|
|
|
+ )
|
|
|
+
|
|
|
+ except (IndexError, TypeError, KeyError, ValueError, QueryIdInvalid):
|
|
|
return
|