|
@@ -36,25 +36,12 @@ from pykeyboard import InlineKeyboard
|
|
|
from pyrogram import __version__ as pyrover
|
|
from pyrogram import __version__ as pyrover
|
|
|
from pyrogram import filters
|
|
from pyrogram import filters
|
|
|
from pyrogram.raw.functions import Ping
|
|
from pyrogram.raw.functions import Ping
|
|
|
-from pyrogram.types import (
|
|
|
|
|
- InlineKeyboardButton,
|
|
|
|
|
- InlineQueryResultArticle,
|
|
|
|
|
- InlineQueryResultPhoto,
|
|
|
|
|
- InputTextMessageContent,
|
|
|
|
|
-)
|
|
|
|
|
|
|
+from pyrogram.types import (InlineKeyboardButton, InlineQueryResultArticle,
|
|
|
|
|
+ InlineQueryResultPhoto, InputTextMessageContent)
|
|
|
from search_engine_parser import GoogleSearch
|
|
from search_engine_parser import GoogleSearch
|
|
|
|
|
|
|
|
-from wbb import (
|
|
|
|
|
- BOT_USERNAME,
|
|
|
|
|
- MESSAGE_DUMP_CHAT,
|
|
|
|
|
- SUDOERS,
|
|
|
|
|
- USERBOT_ID,
|
|
|
|
|
- USERBOT_NAME,
|
|
|
|
|
- USERBOT_USERNAME,
|
|
|
|
|
- app,
|
|
|
|
|
- app2,
|
|
|
|
|
- arq,
|
|
|
|
|
-)
|
|
|
|
|
|
|
+from wbb import (BOT_USERNAME, MESSAGE_DUMP_CHAT, SUDOERS, USERBOT_ID,
|
|
|
|
|
+ USERBOT_NAME, USERBOT_USERNAME, app, app2, arq)
|
|
|
from wbb.core.types import InlineQueryResultCachedDocument
|
|
from wbb.core.types import InlineQueryResultCachedDocument
|
|
|
from wbb.modules.info import get_chat_info, get_user_info
|
|
from wbb.modules.info import get_chat_info, get_user_info
|
|
|
from wbb.modules.music import download_youtube_audio
|
|
from wbb.modules.music import download_youtube_audio
|
|
@@ -131,7 +118,9 @@ async def alive_function(answers):
|
|
|
ubot_state = "Dead" if not await app2.get_me() else "Alive"
|
|
ubot_state = "Dead" if not await app2.get_me() else "Alive"
|
|
|
buttons.add(
|
|
buttons.add(
|
|
|
InlineKeyboardButton("Stats", callback_data="stats_callback"),
|
|
InlineKeyboardButton("Stats", callback_data="stats_callback"),
|
|
|
- InlineKeyboardButton("Go Inline!", switch_inline_query_current_chat=""),
|
|
|
|
|
|
|
+ InlineKeyboardButton(
|
|
|
|
|
+ "Go Inline!", switch_inline_query_current_chat=""
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
msg = f"""
|
|
msg = f"""
|
|
@@ -187,7 +176,9 @@ __**Translated from {result.src} to {result.dest}**__
|
|
|
),
|
|
),
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title=result.translatedText,
|
|
title=result.translatedText,
|
|
|
- input_message_content=InputTextMessageContent(result.translatedText),
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(
|
|
|
|
|
+ result.translatedText
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
]
|
|
]
|
|
|
)
|
|
)
|
|
@@ -445,7 +436,9 @@ async def youtube_func(answers, text):
|
|
|
**Duration:** {i.duration}
|
|
**Duration:** {i.duration}
|
|
|
**Uploaded:** {i.publish_time}
|
|
**Uploaded:** {i.publish_time}
|
|
|
**Description:** {i.long_desc}"""
|
|
**Description:** {i.long_desc}"""
|
|
|
- description = f"{i.views} | {i.channel} | {i.duration} | {i.publish_time}"
|
|
|
|
|
|
|
+ description = (
|
|
|
|
|
+ f"{i.views} | {i.channel} | {i.duration} | {i.publish_time}"
|
|
|
|
|
+ )
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title=i.title,
|
|
title=i.title,
|
|
@@ -496,7 +489,9 @@ async def github_user_func(answers, text):
|
|
|
result = await fetch(URL)
|
|
result = await fetch(URL)
|
|
|
buttons = InlineKeyboard(row_width=1)
|
|
buttons = InlineKeyboard(row_width=1)
|
|
|
buttons.add(
|
|
buttons.add(
|
|
|
- InlineKeyboardButton(text="Open On Github", url=f"https://github.com/{text}")
|
|
|
|
|
|
|
+ InlineKeyboardButton(
|
|
|
|
|
+ text="Open On Github", url=f"https://github.com/{text}"
|
|
|
|
|
+ )
|
|
|
)
|
|
)
|
|
|
caption = f"""
|
|
caption = f"""
|
|
|
**Info Of {result['name']}**
|
|
**Info Of {result['name']}**
|
|
@@ -535,7 +530,9 @@ async def github_repo_func(answers, text):
|
|
|
commits += developer["contributions"]
|
|
commits += developer["contributions"]
|
|
|
buttons = InlineKeyboard(row_width=1)
|
|
buttons = InlineKeyboard(row_width=1)
|
|
|
buttons.add(
|
|
buttons.add(
|
|
|
- InlineKeyboardButton("Open On Github", url=f"https://github.com/{text}")
|
|
|
|
|
|
|
+ InlineKeyboardButton(
|
|
|
|
|
+ "Open On Github", url=f"https://github.com/{text}"
|
|
|
|
|
+ )
|
|
|
)
|
|
)
|
|
|
caption = f"""
|
|
caption = f"""
|
|
|
**Info Of {r['full_name']}**
|
|
**Info Of {r['full_name']}**
|
|
@@ -599,7 +596,9 @@ async def tg_search_func(answers, text, user_id):
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
name = (
|
|
name = (
|
|
|
- message.from_user.first_name if message.from_user.first_name else "NO NAME"
|
|
|
|
|
|
|
+ message.from_user.first_name
|
|
|
|
|
+ if message.from_user.first_name
|
|
|
|
|
+ else "NO NAME"
|
|
|
)
|
|
)
|
|
|
caption = f"""
|
|
caption = f"""
|
|
|
**Query:** {text}
|
|
**Query:** {text}
|
|
@@ -653,7 +652,9 @@ async def music_inline_func(answers, query):
|
|
|
"duration": f_.audio.duration if f_.audio.duration else 0,
|
|
"duration": f_.audio.duration if f_.audio.duration else 0,
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
- messages = list({v["duration"]: v for v in messages_ids_and_duration}.values())
|
|
|
|
|
|
|
+ messages = list(
|
|
|
|
|
+ {v["duration"]: v for v in messages_ids_and_duration}.values()
|
|
|
|
|
+ )
|
|
|
messages_ids = []
|
|
messages_ids = []
|
|
|
for ff_ in messages:
|
|
for ff_ in messages:
|
|
|
messages_ids.append(ff_["message_id"])
|
|
messages_ids.append(ff_["message_id"])
|
|
@@ -710,7 +711,9 @@ async def speedtest_init(query):
|
|
|
return answers
|
|
return answers
|
|
|
msg = "**Click The Button Below To Perform A Speedtest**"
|
|
msg = "**Click The Button Below To Perform A Speedtest**"
|
|
|
button = InlineKeyboard(row_width=1)
|
|
button = InlineKeyboard(row_width=1)
|
|
|
- button.add(InlineKeyboardButton(text="Test", callback_data="test_speedtest"))
|
|
|
|
|
|
|
+ button.add(
|
|
|
|
|
+ InlineKeyboardButton(text="Test", callback_data="test_speedtest")
|
|
|
|
|
+ )
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="Click Here",
|
|
title="Click Here",
|
|
@@ -761,7 +764,9 @@ async def pastebin_func(answers, link):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="DOCUMENT TOO BIG",
|
|
title="DOCUMENT TOO BIG",
|
|
|
description="Maximum supported size is 1MB",
|
|
description="Maximum supported size is 1MB",
|
|
|
- input_message_content=InputTextMessageContent("DOCUMENT TOO BIG"),
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(
|
|
|
|
|
+ "DOCUMENT TOO BIG"
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -776,7 +781,9 @@ async def pastebin_func(answers, link):
|
|
|
await app.send_photo(MESSAGE_DUMP_CHAT, preview) # To Pre-cache the media
|
|
await app.send_photo(MESSAGE_DUMP_CHAT, preview) # To Pre-cache the media
|
|
|
buttons = InlineKeyboard(row_width=1)
|
|
buttons = InlineKeyboard(row_width=1)
|
|
|
buttons.add(InlineKeyboardButton(text="Paste Link", url=link))
|
|
buttons.add(InlineKeyboardButton(text="Paste Link", url=link))
|
|
|
- answers.append(InlineQueryResultPhoto(photo_url=preview, reply_markup=buttons))
|
|
|
|
|
|
|
+ answers.append(
|
|
|
|
|
+ InlineQueryResultPhoto(photo_url=preview, reply_markup=buttons)
|
|
|
|
|
+ )
|
|
|
return answers
|
|
return answers
|
|
|
|
|
|
|
|
|
|
|
|
@@ -792,7 +799,9 @@ async def pmpermit_func(answers, user_id, victim):
|
|
|
InlineKeyboardButton(
|
|
InlineKeyboardButton(
|
|
|
text="For promotion", callback_data="pmpermit to_scam_you a"
|
|
text="For promotion", callback_data="pmpermit to_scam_you a"
|
|
|
),
|
|
),
|
|
|
- InlineKeyboardButton(text="Approve me", callback_data="pmpermit approve_me a"),
|
|
|
|
|
|
|
+ InlineKeyboardButton(
|
|
|
|
|
+ text="Approve me", callback_data="pmpermit approve_me a"
|
|
|
|
|
+ ),
|
|
|
InlineKeyboardButton(
|
|
InlineKeyboardButton(
|
|
|
text="Approve", callback_data=f"pmpermit approve {victim}"
|
|
text="Approve", callback_data=f"pmpermit approve {victim}"
|
|
|
),
|
|
),
|
|
@@ -912,7 +921,9 @@ async def carbon_inline_func(answers, link):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="DOCUMENT TOO BIG",
|
|
title="DOCUMENT TOO BIG",
|
|
|
description="Maximum supported size is 1MB",
|
|
description="Maximum supported size is 1MB",
|
|
|
- input_message_content=InputTextMessageContent("DOCUMENT TOO BIG"),
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(
|
|
|
|
|
+ "DOCUMENT TOO BIG"
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -999,7 +1010,9 @@ async def tmdb_func(answers, query):
|
|
|
)
|
|
)
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultPhoto(
|
|
InlineQueryResultPhoto(
|
|
|
- photo_url=result.backdrop if result.backdrop else result.poster,
|
|
|
|
|
|
|
+ photo_url=result.backdrop
|
|
|
|
|
+ if result.backdrop
|
|
|
|
|
+ else result.poster,
|
|
|
caption=caption,
|
|
caption=caption,
|
|
|
title=result.title,
|
|
title=result.title,
|
|
|
description=f"{genre} • {result.releaseDate} • {result.rating} • {description}",
|
|
description=f"{genre} • {result.releaseDate} • {result.rating} • {description}",
|
|
@@ -1021,7 +1034,9 @@ async def pypiSearchFunc(answers: list, query: str) -> list:
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
|
result = result.result
|
|
result = result.result
|
|
|
- pURLS = [f"**{key}**: {value}" for key, value in result.projectURLS.items()]
|
|
|
|
|
|
|
+ pURLS = [
|
|
|
|
|
+ f"**{key}**: {value}" for key, value in result.projectURLS.items()
|
|
|
|
|
+ ]
|
|
|
pURLS = ("\n" + "\n".join(pURLS)) if pURLS else None
|
|
pURLS = ("\n" + "\n".join(pURLS)) if pURLS else None
|
|
|
caption = f"""
|
|
caption = f"""
|
|
|
**Name:** {result.name}
|
|
**Name:** {result.name}
|