|
@@ -21,62 +21,82 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
SOFTWARE.
|
|
SOFTWARE.
|
|
|
"""
|
|
"""
|
|
|
-import aiohttp
|
|
|
|
|
-import aiofiles
|
|
|
|
|
|
|
+import asyncio
|
|
|
import json
|
|
import json
|
|
|
-import sys
|
|
|
|
|
import os
|
|
import os
|
|
|
-import asyncio
|
|
|
|
|
-from pyrogram.types import (
|
|
|
|
|
- InlineQueryResultArticle,
|
|
|
|
|
- InputTextMessageContent,
|
|
|
|
|
- InlineKeyboardButton,
|
|
|
|
|
- InlineQueryResultPhoto,
|
|
|
|
|
-)
|
|
|
|
|
-from pyrogram.raw.functions import Ping
|
|
|
|
|
-from googletrans import Translator
|
|
|
|
|
-from search_engine_parser import GoogleSearch
|
|
|
|
|
-from pykeyboard import InlineKeyboard
|
|
|
|
|
|
|
+import sys
|
|
|
|
|
+from random import randint
|
|
|
from sys import version as pyver
|
|
from sys import version as pyver
|
|
|
|
|
+from time import ctime, time
|
|
|
|
|
+
|
|
|
|
|
+import aiofiles
|
|
|
|
|
+import aiohttp
|
|
|
|
|
+from googletrans import Translator
|
|
|
from motor import version as mongover
|
|
from motor import version as mongover
|
|
|
-from pyrogram import __version__ as pyrover, filters
|
|
|
|
|
-from time import time, ctime
|
|
|
|
|
-from random import randint
|
|
|
|
|
-from wbb.utils.fetch import fetch
|
|
|
|
|
-from wbb.modules.info import get_user_info, get_chat_info
|
|
|
|
|
|
|
+from pykeyboard import InlineKeyboard
|
|
|
|
|
+from pyrogram import __version__ as pyrover
|
|
|
|
|
+from pyrogram import filters
|
|
|
|
|
+from pyrogram.raw.functions import Ping
|
|
|
|
|
+from pyrogram.types import (InlineKeyboardButton, InlineQueryResultArticle,
|
|
|
|
|
+ InlineQueryResultPhoto, InputTextMessageContent)
|
|
|
|
|
+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.core.types import InlineQueryResultCachedDocument
|
|
|
|
|
+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
|
|
|
-from wbb.utils.functions import test_speedtest, get_http_status_code, make_carbon
|
|
|
|
|
|
|
+from wbb.utils.fetch import fetch
|
|
|
from wbb.utils.formatter import convert_seconds_to_minutes as time_convert
|
|
from wbb.utils.formatter import convert_seconds_to_minutes as time_convert
|
|
|
|
|
+from wbb.utils.functions import (get_http_status_code, make_carbon,
|
|
|
|
|
+ test_speedtest)
|
|
|
from wbb.utils.pastebin import paste
|
|
from wbb.utils.pastebin import paste
|
|
|
-from wbb.core.types import InlineQueryResultCachedDocument
|
|
|
|
|
-from wbb import (
|
|
|
|
|
- arq, app, app2, USERBOT_USERNAME,
|
|
|
|
|
- BOT_USERNAME, USERBOT_ID,
|
|
|
|
|
- SUDOERS, USERBOT_NAME, MESSAGE_DUMP_CHAT
|
|
|
|
|
-)
|
|
|
|
|
|
|
|
|
|
keywords_list = [
|
|
keywords_list = [
|
|
|
- "alive", "ping", "tr", "ud", "google", "bitly",
|
|
|
|
|
- "wall", "yt", "torrent", "lyrics", "wiki",
|
|
|
|
|
- "speedtest", "music", "saavn", "deezer",
|
|
|
|
|
- "gh_repo", "gh_user", "search", "paste",
|
|
|
|
|
- "nsfw_scan", "ytmusic", "carbon", "info",
|
|
|
|
|
- "chat_info"
|
|
|
|
|
|
|
+ "alive",
|
|
|
|
|
+ "ping",
|
|
|
|
|
+ "tr",
|
|
|
|
|
+ "ud",
|
|
|
|
|
+ "google",
|
|
|
|
|
+ "bitly",
|
|
|
|
|
+ "wall",
|
|
|
|
|
+ "yt",
|
|
|
|
|
+ "torrent",
|
|
|
|
|
+ "lyrics",
|
|
|
|
|
+ "wiki",
|
|
|
|
|
+ "speedtest",
|
|
|
|
|
+ "music",
|
|
|
|
|
+ "saavn",
|
|
|
|
|
+ "deezer",
|
|
|
|
|
+ "gh_repo",
|
|
|
|
|
+ "gh_user",
|
|
|
|
|
+ "search",
|
|
|
|
|
+ "paste",
|
|
|
|
|
+ "nsfw_scan",
|
|
|
|
|
+ "ytmusic",
|
|
|
|
|
+ "carbon",
|
|
|
|
|
+ "info",
|
|
|
|
|
+ "chat_info",
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
async def inline_help_func(__HELP__):
|
|
async def inline_help_func(__HELP__):
|
|
|
- buttons = InlineKeyboard(row_width=3)
|
|
|
|
|
- buttons.add(*[(InlineKeyboardButton(
|
|
|
|
|
- text=i, switch_inline_query_current_chat=i)) for i in keywords_list])
|
|
|
|
|
|
|
+ buttons = InlineKeyboard(row_width=4)
|
|
|
|
|
+ buttons.add(
|
|
|
|
|
+ *[
|
|
|
|
|
+ (InlineKeyboardButton(text=i, switch_inline_query_current_chat=i))
|
|
|
|
|
+ for i in keywords_list
|
|
|
|
|
+ ]
|
|
|
|
|
+ )
|
|
|
answerss = [
|
|
answerss = [
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="Inline Commands",
|
|
title="Inline Commands",
|
|
|
description="Help Related To Inline Usage.",
|
|
description="Help Related To Inline Usage.",
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- "Click A Button To Get Started."),
|
|
|
|
|
|
|
+ "Click A Button To Get Started."
|
|
|
|
|
+ ),
|
|
|
thumb_url="https://hamker.me/cy00x5x.png",
|
|
thumb_url="https://hamker.me/cy00x5x.png",
|
|
|
- reply_markup=buttons
|
|
|
|
|
|
|
+ reply_markup=buttons,
|
|
|
),
|
|
),
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="Github Repo",
|
|
title="Github Repo",
|
|
@@ -84,8 +104,8 @@ async def inline_help_func(__HELP__):
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
"https://github.com/thehamkercat/WilliamButcherBot"
|
|
"https://github.com/thehamkercat/WilliamButcherBot"
|
|
|
),
|
|
),
|
|
|
- thumb_url="https://hamker.me/gjc9fo3.png"
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ thumb_url="https://hamker.me/gjc9fo3.png",
|
|
|
|
|
+ ),
|
|
|
]
|
|
]
|
|
|
answerss = await alive_function(answerss)
|
|
answerss = await alive_function(answerss)
|
|
|
return answerss
|
|
return answerss
|
|
@@ -93,17 +113,11 @@ async def inline_help_func(__HELP__):
|
|
|
|
|
|
|
|
async def alive_function(answers):
|
|
async def alive_function(answers):
|
|
|
buttons = InlineKeyboard(row_width=2)
|
|
buttons = InlineKeyboard(row_width=2)
|
|
|
- bot_state = 'Dead' if not await app.get_me() else 'Alive'
|
|
|
|
|
- ubot_state = 'Dead' if not await app2.get_me() else 'Alive'
|
|
|
|
|
|
|
+ bot_state = "Dead" if not await app.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(
|
|
|
|
|
- "Go Inline!",
|
|
|
|
|
- switch_inline_query_current_chat=""
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ InlineKeyboardButton("Stats", callback_data="stats_callback"),
|
|
|
|
|
+ InlineKeyboardButton("Go Inline!", switch_inline_query_current_chat=""),
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
msg = f"""
|
|
msg = f"""
|
|
@@ -118,12 +132,11 @@ async def alive_function(answers):
|
|
|
"""
|
|
"""
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
- title='Alive',
|
|
|
|
|
|
|
+ title="Alive",
|
|
|
description="Check Bot's Stats",
|
|
description="Check Bot's Stats",
|
|
|
thumb_url="https://static2.aniimg.com/upload/20170515/414/c/d/7/cd7EEF.jpg",
|
|
thumb_url="https://static2.aniimg.com/upload/20170515/414/c/d/7/cd7EEF.jpg",
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- msg,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
|
|
+ msg, disable_web_page_preview=True
|
|
|
),
|
|
),
|
|
|
reply_markup=buttons,
|
|
reply_markup=buttons,
|
|
|
)
|
|
)
|
|
@@ -144,14 +157,13 @@ __**Translated from {i.src} to {lang}**__
|
|
|
answers.extend(
|
|
answers.extend(
|
|
|
[
|
|
[
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
- title=f'Translated from {i.src} to {lang}.',
|
|
|
|
|
|
|
+ title=f"Translated from {i.src} to {lang}.",
|
|
|
description=i.text,
|
|
description=i.text,
|
|
|
- input_message_content=InputTextMessageContent(msg)
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(msg),
|
|
|
),
|
|
),
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
- title=i.text,
|
|
|
|
|
- input_message_content=InputTextMessageContent(i.text)
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ title=i.text, input_message_content=InputTextMessageContent(i.text)
|
|
|
|
|
+ ),
|
|
|
]
|
|
]
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -176,8 +188,9 @@ async def urban_func(answers, text):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title=results[i].word,
|
|
title=results[i].word,
|
|
|
description=results[i].definition,
|
|
description=results[i].definition,
|
|
|
- input_message_content=InputTextMessageContent(msg)
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(msg),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
except KeyError:
|
|
except KeyError:
|
|
|
pass
|
|
pass
|
|
|
return answers
|
|
return answers
|
|
@@ -198,13 +211,13 @@ async def google_search_func(answers, text):
|
|
|
|
|
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
- title=i['titles'],
|
|
|
|
|
- description=i['descriptions'],
|
|
|
|
|
|
|
+ title=i["titles"],
|
|
|
|
|
+ description=i["descriptions"],
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- msg,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
- )
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ msg, disable_web_page_preview=True
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
except KeyError:
|
|
except KeyError:
|
|
|
pass
|
|
pass
|
|
|
return answers
|
|
return answers
|
|
@@ -222,8 +235,9 @@ async def wall_func(answers, text):
|
|
|
InlineQueryResultPhoto(
|
|
InlineQueryResultPhoto(
|
|
|
photo_url=results[i].url_image,
|
|
photo_url=results[i].url_image,
|
|
|
thumb_url=results[i].url_thumb,
|
|
thumb_url=results[i].url_thumb,
|
|
|
- caption=f"[Source]({results[i].url_image})"
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ caption=f"[Source]({results[i].url_image})",
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
except KeyError:
|
|
except KeyError:
|
|
|
pass
|
|
pass
|
|
|
return answers
|
|
return answers
|
|
@@ -234,12 +248,7 @@ async def saavn_func(answers, text):
|
|
|
results = await arq.saavn(text)
|
|
results = await arq.saavn(text)
|
|
|
for i in results:
|
|
for i in results:
|
|
|
buttons = InlineKeyboard(row_width=1)
|
|
buttons = InlineKeyboard(row_width=1)
|
|
|
- buttons.add(
|
|
|
|
|
- InlineKeyboardButton(
|
|
|
|
|
- 'Download | Play',
|
|
|
|
|
- url=results[i].media_url
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ buttons.add(InlineKeyboardButton("Download | Play", url=results[i].media_url))
|
|
|
buttons_list.append(buttons)
|
|
buttons_list.append(buttons)
|
|
|
duration = await time_convert(results[i].duration)
|
|
duration = await time_convert(results[i].duration)
|
|
|
caption = f"""
|
|
caption = f"""
|
|
@@ -248,20 +257,22 @@ async def saavn_func(answers, text):
|
|
|
**Duration:** {duration}
|
|
**Duration:** {duration}
|
|
|
**Release:** {results[i].year}
|
|
**Release:** {results[i].year}
|
|
|
**Singers:** {results[i].singers}"""
|
|
**Singers:** {results[i].singers}"""
|
|
|
- description = f"{results[i].album} | {duration} " \
|
|
|
|
|
|
|
+ description = (
|
|
|
|
|
+ f"{results[i].album} | {duration} "
|
|
|
+ f"| {results[i].singers} ({results[i].year})"
|
|
+ f"| {results[i].singers} ({results[i].year})"
|
|
|
|
|
+ )
|
|
|
try:
|
|
try:
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title=results[i].song,
|
|
title=results[i].song,
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- caption,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
|
|
+ caption, disable_web_page_preview=True
|
|
|
),
|
|
),
|
|
|
description=description,
|
|
description=description,
|
|
|
thumb_url=results[i].image,
|
|
thumb_url=results[i].image,
|
|
|
- reply_markup=buttons_list[i]
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ reply_markup=buttons_list[i],
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
except (KeyError, ValueError):
|
|
except (KeyError, ValueError):
|
|
|
pass
|
|
pass
|
|
|
return answers
|
|
return answers
|
|
@@ -272,12 +283,7 @@ async def deezer_func(answers, text):
|
|
|
results = await arq.deezer(text, 5)
|
|
results = await arq.deezer(text, 5)
|
|
|
for i in results:
|
|
for i in results:
|
|
|
buttons = InlineKeyboard(row_width=1)
|
|
buttons = InlineKeyboard(row_width=1)
|
|
|
- buttons.add(
|
|
|
|
|
- InlineKeyboardButton(
|
|
|
|
|
- 'Download | Play',
|
|
|
|
|
- url=results[i].url
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ buttons.add(InlineKeyboardButton("Download | Play", url=results[i].url))
|
|
|
buttons_list.append(buttons)
|
|
buttons_list.append(buttons)
|
|
|
duration = await time_convert(results[i].duration)
|
|
duration = await time_convert(results[i].duration)
|
|
|
caption = f"""
|
|
caption = f"""
|
|
@@ -293,11 +299,11 @@ async def deezer_func(answers, text):
|
|
|
thumb_url=results[i].thumbnail,
|
|
thumb_url=results[i].thumbnail,
|
|
|
description=description,
|
|
description=description,
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- caption,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
|
|
+ caption, disable_web_page_preview=True
|
|
|
),
|
|
),
|
|
|
- reply_markup=buttons_list[i]
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ reply_markup=buttons_list[i],
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
except (KeyError, ValueError):
|
|
except (KeyError, ValueError):
|
|
|
pass
|
|
pass
|
|
|
return answers
|
|
return answers
|
|
@@ -309,22 +315,23 @@ async def shortify(url):
|
|
|
return
|
|
return
|
|
|
header = {
|
|
header = {
|
|
|
"Authorization": "Bearer ad39983fa42d0b19e4534f33671629a4940298dc",
|
|
"Authorization": "Bearer ad39983fa42d0b19e4534f33671629a4940298dc",
|
|
|
- 'Content-Type': 'application/json'
|
|
|
|
|
- }
|
|
|
|
|
- payload = {
|
|
|
|
|
- "long_url": f"{url}"
|
|
|
|
|
|
|
+ "Content-Type": "application/json",
|
|
|
}
|
|
}
|
|
|
|
|
+ payload = {"long_url": f"{url}"}
|
|
|
payload = json.dumps(payload)
|
|
payload = json.dumps(payload)
|
|
|
async with aiohttp.ClientSession() as session:
|
|
async with aiohttp.ClientSession() as session:
|
|
|
- async with session.post("https://api-ssl.bitly.com/v4/shorten", headers=header, data=payload) as resp:
|
|
|
|
|
|
|
+ async with session.post(
|
|
|
|
|
+ "https://api-ssl.bitly.com/v4/shorten", headers=header, data=payload
|
|
|
|
|
+ ) as resp:
|
|
|
data = await resp.json()
|
|
data = await resp.json()
|
|
|
- msg = data['link']
|
|
|
|
|
|
|
+ msg = data["link"]
|
|
|
a = []
|
|
a = []
|
|
|
b = InlineQueryResultArticle(
|
|
b = InlineQueryResultArticle(
|
|
|
title="Link Shortened!",
|
|
title="Link Shortened!",
|
|
|
- description=data['link'],
|
|
|
|
|
|
|
+ description=data["link"],
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- msg, disable_web_page_preview=True)
|
|
|
|
|
|
|
+ msg, disable_web_page_preview=True
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
a.append(b)
|
|
a.append(b)
|
|
|
return a
|
|
return a
|
|
@@ -357,9 +364,8 @@ async def torrent_func(answers, text):
|
|
|
title=title,
|
|
title=title,
|
|
|
description=description,
|
|
description=description,
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- caption,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ caption, disable_web_page_preview=True
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
limit += 1
|
|
limit += 1
|
|
@@ -377,12 +383,7 @@ async def youtube_func(answers, text):
|
|
|
limit += 1
|
|
limit += 1
|
|
|
buttons = InlineKeyboard(row_width=1)
|
|
buttons = InlineKeyboard(row_width=1)
|
|
|
video_url = f"https://youtube.com{results[i].url_suffix}"
|
|
video_url = f"https://youtube.com{results[i].url_suffix}"
|
|
|
- buttons.add(
|
|
|
|
|
- InlineKeyboardButton(
|
|
|
|
|
- 'Watch',
|
|
|
|
|
- url=video_url
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ buttons.add(InlineKeyboardButton("Watch", url=video_url))
|
|
|
caption = f"""
|
|
caption = f"""
|
|
|
**Title:** {results[i].title}
|
|
**Title:** {results[i].title}
|
|
|
**Views:** {results[i].views}
|
|
**Views:** {results[i].views}
|
|
@@ -390,8 +391,10 @@ async def youtube_func(answers, text):
|
|
|
**Duration:** {results[i].duration}
|
|
**Duration:** {results[i].duration}
|
|
|
**Uploaded:** {results[i].publish_time}
|
|
**Uploaded:** {results[i].publish_time}
|
|
|
**Description:** {results[i].long_desc}"""
|
|
**Description:** {results[i].long_desc}"""
|
|
|
- description = f"{results[i].views} | {results[i].channel} | " \
|
|
|
|
|
|
|
+ description = (
|
|
|
|
|
+ f"{results[i].views} | {results[i].channel} | "
|
|
|
+ f"{results[i].duration} | {results[i].publish_time}"
|
|
+ f"{results[i].duration} | {results[i].publish_time}"
|
|
|
|
|
+ )
|
|
|
try:
|
|
try:
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
@@ -399,11 +402,11 @@ async def youtube_func(answers, text):
|
|
|
thumb_url=results[i].thumbnails[0],
|
|
thumb_url=results[i].thumbnails[0],
|
|
|
description=description,
|
|
description=description,
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- caption,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
|
|
+ caption, disable_web_page_preview=True
|
|
|
),
|
|
),
|
|
|
- reply_markup=buttons
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ reply_markup=buttons,
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
except (KeyError, ValueError):
|
|
except (KeyError, ValueError):
|
|
|
pass
|
|
pass
|
|
|
return answers
|
|
return answers
|
|
@@ -425,8 +428,9 @@ async def lyrics_func(answers, text):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title=song_name,
|
|
title=song_name,
|
|
|
description=artist,
|
|
description=artist,
|
|
|
- input_message_content=InputTextMessageContent(msg)
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(msg),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
return answers
|
|
return answers
|
|
|
|
|
|
|
|
|
|
|
|
@@ -434,10 +438,9 @@ async def github_user_func(answers, text):
|
|
|
URL = f"https://api.github.com/users/{text}"
|
|
URL = f"https://api.github.com/users/{text}"
|
|
|
result = await fetch(URL)
|
|
result = await fetch(URL)
|
|
|
buttons = InlineKeyboard(row_width=1)
|
|
buttons = InlineKeyboard(row_width=1)
|
|
|
- buttons.add(InlineKeyboardButton(
|
|
|
|
|
- text="Open On Github",
|
|
|
|
|
- url=f"https://github.com/{text}"
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ buttons.add(
|
|
|
|
|
+ InlineKeyboardButton(text="Open On Github", url=f"https://github.com/{text}")
|
|
|
|
|
+ )
|
|
|
caption = f"""
|
|
caption = f"""
|
|
|
**Info Of {result['name']}**
|
|
**Info Of {result['name']}**
|
|
|
**Username:** `{text}`
|
|
**Username:** `{text}`
|
|
@@ -452,10 +455,9 @@ async def github_user_func(answers, text):
|
|
|
**Following:** `{result['following']}`"""
|
|
**Following:** `{result['following']}`"""
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultPhoto(
|
|
InlineQueryResultPhoto(
|
|
|
- photo_url=result['avatar_url'],
|
|
|
|
|
- caption=caption,
|
|
|
|
|
- reply_markup=buttons
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ photo_url=result["avatar_url"], caption=caption, reply_markup=buttons
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
return answers
|
|
return answers
|
|
|
|
|
|
|
|
|
|
|
|
@@ -471,13 +473,10 @@ async def github_repo_func(answers, text):
|
|
|
r1 = results[1]
|
|
r1 = results[1]
|
|
|
commits = 0
|
|
commits = 0
|
|
|
for developer in r1:
|
|
for developer in r1:
|
|
|
- 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']}**
|
|
@@ -499,10 +498,10 @@ async def github_repo_func(answers, text):
|
|
|
description=text,
|
|
description=text,
|
|
|
reply_markup=buttons,
|
|
reply_markup=buttons,
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- caption,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
- )
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ caption, disable_web_page_preview=True
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
return answers
|
|
return answers
|
|
|
|
|
|
|
|
|
|
|
|
@@ -513,8 +512,9 @@ async def tg_search_func(answers, text, user_id):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="ERROR",
|
|
title="ERROR",
|
|
|
description="THIS FEATURE IS ONLY FOR SUDO USERS",
|
|
description="THIS FEATURE IS ONLY FOR SUDO USERS",
|
|
|
- input_message_content=InputTextMessageContent(msg)
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(msg),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
return answers
|
|
return answers
|
|
|
if str(text)[-1] != ":":
|
|
if str(text)[-1] != ":":
|
|
|
msg = "**ERROR**\n__Put A ':' After The Text To Search__"
|
|
msg = "**ERROR**\n__Put A ':' After The Text To Search__"
|
|
@@ -522,8 +522,9 @@ async def tg_search_func(answers, text, user_id):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="ERROR",
|
|
title="ERROR",
|
|
|
description="Put A ':' After The Text To Search",
|
|
description="Put A ':' After The Text To Search",
|
|
|
- input_message_content=InputTextMessageContent(msg)
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(msg),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
return answers
|
|
return answers
|
|
|
text = text[0:-1]
|
|
text = text[0:-1]
|
|
@@ -532,14 +533,15 @@ async def tg_search_func(answers, text, user_id):
|
|
|
buttons.add(
|
|
buttons.add(
|
|
|
InlineKeyboardButton(
|
|
InlineKeyboardButton(
|
|
|
text="Origin",
|
|
text="Origin",
|
|
|
- url=message.link if message.link else "https://t.me/telegram"
|
|
|
|
|
|
|
+ url=message.link if message.link else "https://t.me/telegram",
|
|
|
),
|
|
),
|
|
|
InlineKeyboardButton(
|
|
InlineKeyboardButton(
|
|
|
- text="Search again",
|
|
|
|
|
- switch_inline_query_current_chat="search"
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ text="Search again", switch_inline_query_current_chat="search"
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ name = (
|
|
|
|
|
+ message.from_user.first_name if message.from_user.first_name else "NO NAME"
|
|
|
)
|
|
)
|
|
|
- name = message.from_user.first_name if message.from_user.first_name else "NO NAME"
|
|
|
|
|
caption = f"""
|
|
caption = f"""
|
|
|
**Query:** {text}
|
|
**Query:** {text}
|
|
|
**Name:** {str(name)} [`{message.from_user.id}`]
|
|
**Name:** {str(name)} [`{message.from_user.id}`]
|
|
@@ -554,9 +556,8 @@ async def tg_search_func(answers, text, user_id):
|
|
|
description=message.text if message.text else "[NO_TEXT]",
|
|
description=message.text if message.text else "[NO_TEXT]",
|
|
|
reply_markup=buttons,
|
|
reply_markup=buttons,
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- caption,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ caption, disable_web_page_preview=True
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
answers.append(result)
|
|
answers.append(result)
|
|
|
return answers
|
|
return answers
|
|
@@ -566,7 +567,12 @@ async def music_inline_func(answers, query):
|
|
|
chat_id = -1001445180719
|
|
chat_id = -1001445180719
|
|
|
group_invite = "https://t.me/joinchat/vSDE2DuGK4Y4Nzll"
|
|
group_invite = "https://t.me/joinchat/vSDE2DuGK4Y4Nzll"
|
|
|
try:
|
|
try:
|
|
|
- messages = [m async for m in app2.search_messages(chat_id, query, filter="audio", limit=199)]
|
|
|
|
|
|
|
+ messages = [
|
|
|
|
|
+ m
|
|
|
|
|
+ async for m in app2.search_messages(
|
|
|
|
|
+ chat_id, query, filter="audio", limit=199
|
|
|
|
|
+ )
|
|
|
|
|
+ ]
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
print(e)
|
|
print(e)
|
|
|
msg = f"You Need To Join Here With Your Bot And Userbot To Get Cached Music.\n{group_invite}"
|
|
msg = f"You Need To Join Here With Your Bot And Userbot To Get Cached Music.\n{group_invite}"
|
|
@@ -575,29 +581,28 @@ async def music_inline_func(answers, query):
|
|
|
title="ERROR",
|
|
title="ERROR",
|
|
|
description="Click Here To Know More.",
|
|
description="Click Here To Know More.",
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- msg,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ msg, disable_web_page_preview=True
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
|
messages_ids_and_duration = []
|
|
messages_ids_and_duration = []
|
|
|
for f_ in messages:
|
|
for f_ in messages:
|
|
|
messages_ids_and_duration.append(
|
|
messages_ids_and_duration.append(
|
|
|
- {"message_id": f_.message_id,
|
|
|
|
|
- "duration": f_.audio.duration if f_.audio.duration else 0}
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ "message_id": f_.message_id,
|
|
|
|
|
+ "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"])
|
|
|
messages = await app.get_messages(chat_id, messages_ids[0:48])
|
|
messages = await app.get_messages(chat_id, messages_ids[0:48])
|
|
|
for message_ in messages:
|
|
for message_ in messages:
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultCachedDocument(
|
|
InlineQueryResultCachedDocument(
|
|
|
- file_id=message_.audio.file_id,
|
|
|
|
|
- title=message_.audio.title
|
|
|
|
|
|
|
+ file_id=message_.audio.file_id, title=message_.audio.title
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -613,9 +618,9 @@ async def wiki_func(answers, text):
|
|
|
__{data['answer']}__"""
|
|
__{data['answer']}__"""
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
- title=data['title'],
|
|
|
|
|
- description=data['answer'],
|
|
|
|
|
- input_message_content=InputTextMessageContent(msg)
|
|
|
|
|
|
|
+ title=data["title"],
|
|
|
|
|
+ description=data["answer"],
|
|
|
|
|
+ input_message_content=InputTextMessageContent(msg),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -630,22 +635,23 @@ async def speedtest_init(query):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="ERROR",
|
|
title="ERROR",
|
|
|
description="THIS FEATURE IS ONLY FOR SUDO USERS",
|
|
description="THIS FEATURE IS ONLY FOR SUDO USERS",
|
|
|
- input_message_content=InputTextMessageContent(msg)
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(msg),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
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",
|
|
|
input_message_content=InputTextMessageContent(msg),
|
|
input_message_content=InputTextMessageContent(msg),
|
|
|
- reply_markup=button
|
|
|
|
|
|
|
+ reply_markup=button,
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
|
|
|
|
|
|
|
|
+
|
|
|
""" callback query for the function above """
|
|
""" callback query for the function above """
|
|
|
|
|
|
|
|
|
|
|
|
@@ -655,10 +661,7 @@ async def test_speedtest_cq(_, cq):
|
|
|
await cq.answer("This Isn't For You!")
|
|
await cq.answer("This Isn't For You!")
|
|
|
return
|
|
return
|
|
|
inline_message_id = cq.inline_message_id
|
|
inline_message_id = cq.inline_message_id
|
|
|
- await app.edit_inline_text(
|
|
|
|
|
- inline_message_id,
|
|
|
|
|
- "**Testing**"
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ await app.edit_inline_text(inline_message_id, "**Testing**")
|
|
|
download, upload, info = await test_speedtest()
|
|
download, upload, info = await test_speedtest()
|
|
|
msg = f"""
|
|
msg = f"""
|
|
|
**Download:** `{download}`
|
|
**Download:** `{download}`
|
|
@@ -668,10 +671,7 @@ async def test_speedtest_cq(_, cq):
|
|
|
**Latitude:** `{info['lat']}`
|
|
**Latitude:** `{info['lat']}`
|
|
|
**Longitude:** `{info['lon']}`
|
|
**Longitude:** `{info['lon']}`
|
|
|
"""
|
|
"""
|
|
|
- await app.edit_inline_text(
|
|
|
|
|
- inline_message_id,
|
|
|
|
|
- msg
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ await app.edit_inline_text(inline_message_id, msg)
|
|
|
|
|
|
|
|
|
|
|
|
|
async def pastebin_func(answers, link):
|
|
async def pastebin_func(answers, link):
|
|
@@ -691,9 +691,7 @@ 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
|
|
@@ -714,12 +712,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
@@ -730,27 +723,21 @@ async def pmpermit_func(answers, user_id, victim):
|
|
|
buttons = InlineKeyboard(row_width=2)
|
|
buttons = InlineKeyboard(row_width=2)
|
|
|
buttons.add(
|
|
buttons.add(
|
|
|
InlineKeyboardButton(
|
|
InlineKeyboardButton(
|
|
|
- text="To Scam You",
|
|
|
|
|
- callback_data="pmpermit to_scam_you a"
|
|
|
|
|
|
|
+ text="To Scam You", callback_data="pmpermit to_scam_you a"
|
|
|
),
|
|
),
|
|
|
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(
|
|
InlineKeyboardButton(
|
|
|
- text="Approve me",
|
|
|
|
|
- callback_data="pmpermit approve_me a"
|
|
|
|
|
|
|
+ text="Approve", callback_data=f"pmpermit approve {victim}"
|
|
|
),
|
|
),
|
|
|
- InlineKeyboardButton(
|
|
|
|
|
- text="Approve",
|
|
|
|
|
- callback_data=f"pmpermit approve {victim}"
|
|
|
|
|
- )
|
|
|
|
|
)
|
|
)
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="do_not_click_here",
|
|
title="do_not_click_here",
|
|
|
reply_markup=buttons,
|
|
reply_markup=buttons,
|
|
|
- input_message_content=InputTextMessageContent(caption)
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(caption),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -764,9 +751,7 @@ async def ping_func(answers):
|
|
|
ping = f"{str(round((t2 - t1), 6)) * 100} ms"
|
|
ping = f"{str(round((t2 - t1), 6)) * 100} ms"
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
- title=ping,
|
|
|
|
|
- input_message_content=InputTextMessageContent(
|
|
|
|
|
- f"__**{ping}**__")
|
|
|
|
|
|
|
+ title=ping, input_message_content=InputTextMessageContent(f"__**{ping}**__")
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -776,7 +761,7 @@ async def nsfw_scan_func(answers, url: str):
|
|
|
t1 = time()
|
|
t1 = time()
|
|
|
data = (await arq.nsfw_scan(url)).data
|
|
data = (await arq.nsfw_scan(url)).data
|
|
|
t2 = time()
|
|
t2 = time()
|
|
|
- tt = round(t2-t1, 4)
|
|
|
|
|
|
|
+ tt = round(t2 - t1, 4)
|
|
|
content = f"""
|
|
content = f"""
|
|
|
**Scanned [Image]({url}) In {tt} Seconds.**
|
|
**Scanned [Image]({url}) In {tt} Seconds.**
|
|
|
|
|
|
|
@@ -790,7 +775,7 @@ async def nsfw_scan_func(answers, url: str):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="Scanned",
|
|
title="Scanned",
|
|
|
description=f"Took {tt} Seconds.",
|
|
description=f"Took {tt} Seconds.",
|
|
|
- input_message_content=InputTextMessageContent(content)
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(content),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -803,8 +788,9 @@ async def yt_music_func(answers, url, user_id):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="ERROR",
|
|
title="ERROR",
|
|
|
description="THIS FEATURE IS ONLY FOR SUDO USERS",
|
|
description="THIS FEATURE IS ONLY FOR SUDO USERS",
|
|
|
- input_message_content=InputTextMessageContent(msg)
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ input_message_content=InputTextMessageContent(msg),
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
return answers
|
|
return answers
|
|
|
if "http" not in url:
|
|
if "http" not in url:
|
|
|
url = (await arq.youtube(url))[0]
|
|
url = (await arq.youtube(url))[0]
|
|
@@ -816,15 +802,12 @@ async def yt_music_func(answers, url, user_id):
|
|
|
title=title,
|
|
title=title,
|
|
|
duration=duration,
|
|
duration=duration,
|
|
|
performer=performer,
|
|
performer=performer,
|
|
|
- thumb=thumbnail
|
|
|
|
|
|
|
+ thumb=thumbnail,
|
|
|
)
|
|
)
|
|
|
os.remove(audio)
|
|
os.remove(audio)
|
|
|
os.remove(thumbnail)
|
|
os.remove(thumbnail)
|
|
|
answers.append(
|
|
answers.append(
|
|
|
- InlineQueryResultCachedDocument(
|
|
|
|
|
- title=title,
|
|
|
|
|
- file_id=m.audio.file_id
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ InlineQueryResultCachedDocument(title=title, file_id=m.audio.file_id)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
|
|
|
|
|
@@ -846,9 +829,7 @@ 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
|
|
@@ -865,9 +846,7 @@ async def carbon_inline_func(answers, link):
|
|
|
buttons.add(InlineKeyboardButton(text="Paste Link", url=link))
|
|
buttons.add(InlineKeyboardButton(text="Paste Link", url=link))
|
|
|
answers.append(
|
|
answers.append(
|
|
|
InlineQueryResultCachedDocument(
|
|
InlineQueryResultCachedDocument(
|
|
|
- file_id=carbon.document.file_id,
|
|
|
|
|
- title="Carbon",
|
|
|
|
|
- reply_markup=buttons
|
|
|
|
|
|
|
+ file_id=carbon.document.file_id, title="Carbon", reply_markup=buttons
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -879,9 +858,8 @@ async def user_info_inline_func(answers, user):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="Found User.",
|
|
title="Found User.",
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- caption,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ caption, disable_web_page_preview=True
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|
|
@@ -893,9 +871,8 @@ async def chat_info_inline_func(answers, chat):
|
|
|
InlineQueryResultArticle(
|
|
InlineQueryResultArticle(
|
|
|
title="Found Chat.",
|
|
title="Found Chat.",
|
|
|
input_message_content=InputTextMessageContent(
|
|
input_message_content=InputTextMessageContent(
|
|
|
- caption,
|
|
|
|
|
- disable_web_page_preview=True
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ caption, disable_web_page_preview=True
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
return answers
|
|
return answers
|