From cfee05f07e8fd85a29ee2820942e7d4e1e0428c3 Mon Sep 17 00:00:00 2001 From: Mahesh0253 Date: Sun, 6 Jun 2021 15:17:41 +0530 Subject: [PATCH] removed MAX_RESULTS from info.py --- README.md | 1 - app.json | 5 ----- info.py | 1 - plugins/inline.py | 4 ++-- sample_info.py | 1 - 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2be4467f2..8190f896e 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ Check [`sample_info.py`](sample_info.py) before editing [`info.py`](info.py) fil ### Optional Variables * `COLLECTION_NAME`: Name of the collections. Defaults to Telegram_files. If you going to use same database, then use different collection name for each bot -* `MAX_RESULTS`: Maximum limit for inline search results * `CACHE_TIME`: The maximum amount of time in seconds that the result of the inline query may be cached on the server * `USE_CAPTION_FILTER`: Whether bot should use captions to improve search results. (True/False) * `AUTH_USERS`: Username or ID of users to give access of inline search. Separate multiple users by space. Leave it empty if you don't want to restrict bot usage. diff --git a/app.json b/app.json index ea4aa4254..463f01572 100644 --- a/app.json +++ b/app.json @@ -73,11 +73,6 @@ "value": "Telegram_files", "required": false }, - "MAX_RESULTS": { - "description": "Maximum limit for inline search results", - "value": "10", - "required": false - }, "CACHE_TIME": { "description": "The maximum amount of time in seconds that the result of the inline query may be cached on the server", "value": "300", diff --git a/info.py b/info.py index 79f9ce0e1..846e46386 100644 --- a/info.py +++ b/info.py @@ -12,7 +12,6 @@ USERBOT_STRING_SESSION = environ.get('USERBOT_STRING_SESSION') # Bot settings -MAX_RESULTS = int(environ.get('MAX_RESULTS', 10)) CACHE_TIME = int(environ.get('CACHE_TIME', 300)) USE_CAPTION_FILTER = bool(environ.get('USE_CAPTION_FILTER', False)) diff --git a/plugins/inline.py b/plugins/inline.py index bdea77058..fa7387717 100644 --- a/plugins/inline.py +++ b/plugins/inline.py @@ -6,7 +6,7 @@ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, InlineQueryResultCachedDocument from utils import get_search_results -from info import MAX_RESULTS, CACHE_TIME, SHARE_BUTTON_TEXT, AUTH_USERS, AUTH_CHANNEL +from info import CACHE_TIME, SHARE_BUTTON_TEXT, AUTH_USERS, AUTH_CHANNEL logger = logging.getLogger(__name__) cache_time = 0 if AUTH_USERS or AUTH_CHANNEL else CACHE_TIME @@ -36,7 +36,7 @@ async def answer(bot, query): reply_markup = get_reply_markup(bot.username, query=string) files, next_offset = await get_search_results(string, file_type=file_type, - max_results=MAX_RESULTS, + max_results=10, offset=offset) for file in files: diff --git a/sample_info.py b/sample_info.py index 071bfc32f..5e4af6a32 100644 --- a/sample_info.py +++ b/sample_info.py @@ -7,7 +7,6 @@ USERBOT_STRING_SESSION = '' # Bot settings -MAX_RESULTS = 10 CACHE_TIME = 300 USE_CAPTION_FILTER = False