|
|
@@ -50,13 +50,12 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
elif text.split()[0] == "tr":
|
|
|
if len(text.split()) < 3:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Translator | tr [LANG] [TEXT]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
lang = text.split()[1]
|
|
|
tex = text.split(None, 2)[2].strip()
|
|
|
answerss = await translate_func(answers, lang, tex)
|
|
|
@@ -66,13 +65,12 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
elif text.split()[0] == "ud":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Urban Dictionary | ud [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await urban_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -81,13 +79,12 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
elif text.split()[0] == "google":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Google Search | google [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await google_search_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -96,13 +93,12 @@ async def inline_query_handler(client, query):
|
|
|
)
|
|
|
elif text.split()[0] == "bitly":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Link Shortener | bitly [LINK]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await shortify(tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -111,53 +107,49 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "wall":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
is_gallery=True,
|
|
|
switch_pm_text="Wallpapers Search | wall [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await wall_func(answers, tex)
|
|
|
await client.answer_inline_query(query.id, results=answerss)
|
|
|
|
|
|
elif text.split()[0] == "saavn":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="JioSaavn Search | saavn [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await saavn_func(answers, tex)
|
|
|
await client.answer_inline_query(query.id, results=answerss)
|
|
|
|
|
|
elif text.split()[0] == "deezer":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Deezer Search | deezer [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await deezer_func(answers, tex)
|
|
|
await client.answer_inline_query(query.id, results=answerss)
|
|
|
|
|
|
elif text.split()[0] == "torrent":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Torrent Search | torrent [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await torrent_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -167,39 +159,36 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "yt":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="YouTube Search | yt [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await youtube_func(answers, tex)
|
|
|
await client.answer_inline_query(query.id, results=answerss)
|
|
|
|
|
|
elif text.split()[0] == "lyrics":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Lyrics Search | lyrics [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await lyrics_func(answers, tex)
|
|
|
await client.answer_inline_query(query.id, results=answerss)
|
|
|
|
|
|
elif text.split()[0] == "gh_user":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Github User | gh_user [USERNAME/LINK]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await github_user_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -208,13 +197,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "gh_repo":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Github Repo Search | [LINK]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await github_repo_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -223,13 +211,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "search":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Global Message Search. | search [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
user_id = query.from_user.id
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await tg_search_func(answers, tex, user_id)
|
|
|
@@ -239,13 +226,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "music":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Music Search | music [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await music_inline_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -254,13 +240,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "wiki":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Wikipedia | wiki [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await wiki_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -269,42 +254,37 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "speedtest":
|
|
|
answerss = await speedtest_init(query)
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id, results=answerss, cache_time=2
|
|
|
)
|
|
|
- return
|
|
|
|
|
|
elif text.split()[0] == "paste":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Pastebin | paste [TG_MESSAGE_LINK]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
link = text.strip().split()[1]
|
|
|
answerss = await pastebin_func(answers, link)
|
|
|
await client.answer_inline_query(
|
|
|
query.id, results=answerss, cache_time=2
|
|
|
)
|
|
|
- return
|
|
|
|
|
|
elif text.split()[0] == "carbon":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Carbon | carbon [TG_MESSAGE_LINK]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
link = text.split()[1]
|
|
|
answerss = await carbon_inline_func(answers, link)
|
|
|
await client.answer_inline_query(
|
|
|
query.id, results=answerss, cache_time=2
|
|
|
)
|
|
|
- return
|
|
|
|
|
|
elif text.split()[0] == "pmpermit":
|
|
|
user_id = query.from_user.id
|
|
|
@@ -313,24 +293,21 @@ async def inline_query_handler(client, query):
|
|
|
await client.answer_inline_query(
|
|
|
query.id, results=answerss, cache_time=2
|
|
|
)
|
|
|
- return
|
|
|
|
|
|
elif text.split()[0] == "ping":
|
|
|
answerss = await ping_func(answers)
|
|
|
await client.answer_inline_query(
|
|
|
query.id, results=answerss, cache_time=2
|
|
|
)
|
|
|
- return
|
|
|
|
|
|
elif text.split()[0] == "nsfw_scan":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="NSFW Scan | nsfw_scan [url]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split(None, 1)[1].strip()
|
|
|
answerss = await nsfw_scan_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -339,13 +316,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "ytmusic":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="YT Music | ytmusic [url]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = query.query.split(None, 1)[1].strip()
|
|
|
answerss = await yt_music_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -354,13 +330,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "info":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="User Info | info [USERNAME|ID]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split()[1].strip()
|
|
|
answerss = await user_info_inline_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -369,13 +344,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "chat_info":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Chat Info | chat_info [USERNAME|ID]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split()[1].strip()
|
|
|
answerss = await chat_info_inline_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -385,13 +359,12 @@ async def inline_query_handler(client, query):
|
|
|
elif text.split()[0] == "tmdb":
|
|
|
if len(text.split()) < 2:
|
|
|
answerss = await tmdb_func(answers, "")
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answerss,
|
|
|
switch_pm_text="TMDB Search | tmdb [QUERY]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split()[1].strip()
|
|
|
answerss = await tmdb_func(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -400,13 +373,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "pypi":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Pypi Search | pypi [Package Name]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split()[1].strip()
|
|
|
answerss = await pypiSearchFunc(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -415,13 +387,12 @@ async def inline_query_handler(client, query):
|
|
|
|
|
|
elif text.split()[0] == "audio":
|
|
|
if len(text.split()) < 2:
|
|
|
- await client.answer_inline_query(
|
|
|
+ return await client.answer_inline_query(
|
|
|
query.id,
|
|
|
results=answers,
|
|
|
switch_pm_text="Random Audio Search | audio [Query]",
|
|
|
switch_pm_parameter="inline",
|
|
|
)
|
|
|
- return
|
|
|
tex = text.split()[1].strip()
|
|
|
answerss = await randomAudioFunc(answers, tex)
|
|
|
await client.answer_inline_query(
|
|
|
@@ -430,4 +401,3 @@ async def inline_query_handler(client, query):
|
|
|
except Exception as e:
|
|
|
e = traceback.format_exc()
|
|
|
print(e, " InLine")
|
|
|
- return
|