├── Procfile ├── requirements.txt ├── README.md ├── LICENSE └── main.py /Procfile: -------------------------------------------------------------------------------- 1 | worker: python main.py 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pyrogram 2 | tgcrypto 3 | play-scraper 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Play Store Bot 2 | A telegram play store search bot 3 | 4 | --- 5 | 6 | ## Variables 7 | 8 | - `API_HASH` Your API Hash from my.telegram.org 9 | - `API_ID` Your API ID from my.telegram.org 10 | - `BOT_TOKEN` Your bot token from @BotFather 11 | 12 | --- 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Fayas Noushad 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import play_scraper 3 | from pyrogram import Client, filters 4 | from pyrogram.types import * 5 | 6 | 7 | Bot = Client( 8 | "Play-Store-Bot", 9 | bot_token = os.environ["BOT_TOKEN"], 10 | api_id = int(os.environ["API_ID"]), 11 | api_hash = os.environ["API_HASH"] 12 | ) 13 | 14 | 15 | @Bot.on_message(filters.private & filters.all) 16 | async def filter_all(bot, update): 17 | text = "Search play store apps using below buttons.\n\nMade by @FayasNoushad" 18 | reply_markup = InlineKeyboardMarkup( 19 | [ 20 | [InlineKeyboardButton(text="Search here", switch_inline_query_current_chat="")], 21 | [InlineKeyboardButton(text="Search in another chat", switch_inline_query="")] 22 | ] 23 | ) 24 | await update.reply_text( 25 | text=text, 26 | reply_markup=reply_markup, 27 | disable_web_page_preview=True, 28 | quote=True 29 | ) 30 | 31 | 32 | @Bot.on_inline_query() 33 | async def search(bot, update): 34 | results = play_scraper.search(update.query) 35 | answers = [] 36 | for result in results: 37 | details = "**Title:** `{}`".format(result["title"]) + "\n" \ 38 | "**Description:** `{}`".format(result["description"]) + "\n" \ 39 | "**App ID:** `{}`".format(result["app_id"]) + "\n" \ 40 | "**Developer:** `{}`".format(result["developer"]) + "\n" \ 41 | "**Developer ID:** `{}`".format(result["developer_id"]) + "\n" \ 42 | "**Score:** `{}`".format(result["score"]) + "\n" \ 43 | "**Price:** `{}`".format(result["price"]) + "\n" \ 44 | "**Full Price:** `{}`".format(result["full_price"]) + "\n" \ 45 | "**Free:** `{}`".format(result["free"]) + "\n" \ 46 | "\n" + "Made by @FayasNoushad" 47 | reply_markup = InlineKeyboardMarkup( 48 | [[InlineKeyboardButton(text="Play Store", url="https://play.google.com"+result["url"])]] 49 | ) 50 | try: 51 | answers.append( 52 | InlineQueryResultArticle( 53 | title=result["title"], 54 | description=result.get("description", None), 55 | thumb_url=result.get("icon", None), 56 | input_message_content=InputTextMessageContent( 57 | message_text=details, disable_web_page_preview=True 58 | ), 59 | reply_markup=reply_markup 60 | ) 61 | ) 62 | except Exception as error: 63 | print(error) 64 | await update.answer(answers) 65 | 66 | 67 | Bot.run() 68 | --------------------------------------------------------------------------------