From c683a3ce9eb30afaf71e5be4d459ff3f00e0ce7a Mon Sep 17 00:00:00 2001 From: yasirarism Date: Sun, 24 Sep 2023 22:21:45 +0700 Subject: [PATCH] Minor fix (#286) --- README.id.md | 2 +- README.md | 2 +- misskaty/__init__.py | 2 +- .../core/misskaty_patch/utils/handler_error.py | 4 ++-- misskaty/helper/media_helper.py | 2 +- misskaty/plugins/dev.py | 4 ++-- misskaty/plugins/imdb_search.py | 6 +++--- misskaty/plugins/inline_search.py | 3 ++- misskaty/plugins/locks.py | 17 +++++++++++------ misskaty/plugins/ocr.py | 2 +- misskaty/plugins/start_help.py | 4 ++-- 11 files changed, 27 insertions(+), 21 deletions(-) diff --git a/README.id.md b/README.id.md index b3f04e83..d11a35cb 100644 --- a/README.id.md +++ b/README.id.md @@ -188,7 +188,7 @@ PERINGATAN: Menjual Kode Kepada Orang Lain Demi Uang *Dilarang Keras*. Tuhan sel [readme-ko-url]: README.md [kofi-url]: https://ko-fi.com/yasirarism [paypal-url]: https://paypal.me/yasirarism -[qris-url]: https://telegraph.yasirweb.eu.org/file/2acf7698f300ef3d9138f.jpg +[qris-url]: https://img.yasirweb.eu.org/file/2acf7698f300ef3d9138f.jpg [sociabuzz-url]: https://sociabuzz.com/yasirarism/tribe [saweria-url]: https://saweria.co/yasirarism [trakteer-url]: https://trakteer.id/yasir-aris-sp7cn \ No newline at end of file diff --git a/README.md b/README.md index deec35ab..e61c31d9 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ WARNING: Selling The Codes To Other People For Money Is *Strictly Prohibited*. G [readme-ko-url]: README.id.md [kofi-url]: https://ko-fi.com/yasirarism [paypal-url]: https://paypal.me/yasirarism -[qris-url]: https://telegraph.yasirweb.eu.org/file/9427d61d6968b8ee4fb2f.jpg +[qris-url]: https://img.yasirweb.eu.org/file/9427d61d6968b8ee4fb2f.jpg [sociabuzz-url]: https://sociabuzz.com/yasirarism/tribe [saweria-url]: https://saweria.co/yasirarism [trakteer-url]: https://trakteer.id/yasir-aris-sp7cn \ No newline at end of file diff --git a/misskaty/__init__.py b/misskaty/__init__.py index 257d0c28..b6214cdb 100644 --- a/misskaty/__init__.py +++ b/misskaty/__init__.py @@ -41,7 +41,7 @@ MOD_NOLOAD = ["subscene_dl"] HELPABLE = {} cleanmode = {} botStartTime = time.time() -misskaty_version = "v2.10.15 - Stable" +misskaty_version = "v2.11.1 - Stable" # Pyrogram Bot Client app = Client( diff --git a/misskaty/core/misskaty_patch/utils/handler_error.py b/misskaty/core/misskaty_patch/utils/handler_error.py index a1d10d76..3e4ae557 100644 --- a/misskaty/core/misskaty_patch/utils/handler_error.py +++ b/misskaty/core/misskaty_patch/utils/handler_error.py @@ -59,7 +59,7 @@ async def handle_error( with contextlib.suppress(Exception): try: await m.reply_photo( - "https://telegraph.yasirweb.eu.org/file/3c9162b242567ae25d5af.jpg", + "https://img.yasirweb.eu.org/file/3c9162b242567ae25d5af.jpg", caption="An Internal Error Occurred while Processing your Command, the Logs have been sent to the Owners of this Bot. Sorry for Inconvenience", ) except: @@ -76,7 +76,7 @@ async def handle_error( await m.message.delete() try: await m.reply_photo( - "https://telegraph.yasirweb.eu.org/file/3c9162b242567ae25d5af.jpg", + "https://img.yasirweb.eu.org/file/3c9162b242567ae25d5af.jpg", caption="An Internal Error Occurred while Processing your Command, the Logs have been sent to the Owners of this Bot. Sorry for Inconvenience", ) except: diff --git a/misskaty/helper/media_helper.py b/misskaty/helper/media_helper.py index a1921a10..d4d01fec 100644 --- a/misskaty/helper/media_helper.py +++ b/misskaty/helper/media_helper.py @@ -15,7 +15,7 @@ async def post_to_telegraph(is_media: bool, title=None, content=None, media=None if is_media: # Create a Telegram Post Foto/Video response = await telegraph.upload_file(media) - return f"https://telegraph.yasirweb.eu.org{response[0]['src']}" + return f"https://img.yasirweb.eu.org{response[0]['src']}" # Create a Telegram Post using HTML Content response = await telegraph.create_page( title, diff --git a/misskaty/plugins/dev.py b/misskaty/plugins/dev.py index 5a50013e..97dc3ace 100644 --- a/misskaty/plugins/dev.py +++ b/misskaty/plugins/dev.py @@ -130,8 +130,8 @@ async def log_file(_, ctx: Message, strings): @app.on_message(filters.command(["donate"], COMMAND_HANDLER)) async def donate(_, ctx: Message): await ctx.reply_photo( - "https://telegraph.yasirweb.eu.org/file/9427d61d6968b8ee4fb2f.jpg", - caption=f"Hai {ctx.from_user.mention}, jika kamu merasa bot ini berguna kamu bisa melakukan donasi dengan scan QR menggunakan merchant yang support QRIS ya. Karena server bot ini menggunakan VPS dan tidaklah gratis. Terimakasih..\n\nHi {ctx.from_user.mention}, if you feel this bot is useful, you can make a donation via Paypal for international payment : https://paypal.me/yasirarism. Because this bot server is hosted in VPS and not free. Thank you..", + "https://img.yasirweb.eu.org/file/9427d61d6968b8ee4fb2f.jpg", + caption=f"Hi {ctx.from_user.mention}, If you find this bot useful, you can make a donation to the account below. Because this bot server uses VPS and is not free. Thank You..\n\nIndonesian Payment:\nQRIS: https://img.yasirweb.eu.org/file/b1c86973ae4e55721983a.jpg (Yasir Store)\nMayar: https://yasirarism.mayar.link/payme\nBank Jago: 109641845083 (Yasir Aris M)\n\nFor international people can use PayPal to support me or via GitHub Sponsor:\nhttps://paypal.me/yasirarism\nhttps://github.com/sponsors/yasirarism\n\nSource: @BeriKopi", ) diff --git a/misskaty/plugins/imdb_search.py b/misskaty/plugins/imdb_search.py index c1f1e03a..5f268bf4 100644 --- a/misskaty/plugins/imdb_search.py +++ b/misskaty/plugins/imdb_search.py @@ -66,7 +66,7 @@ async def imdb_choose(_, ctx: Message): buttons.row(InlineButton("🚩 Set Default Language", f"imdbset#{ctx.from_user.id}")) buttons.row(InlineButton("❌ Close", f"close#{ctx.from_user.id}")) await ctx.reply_photo( - "https://telegraph.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg", + "https://img.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg", caption=f"Hi {ctx.from_user.mention}, Please select the language you want to use on IMDB Search. If you want use default lang for every user, click third button. So no need click select lang if use CMD.", reply_markup=buttons, quote=True, @@ -128,7 +128,7 @@ async def imdbsetlang(_, query: CallbackQuery): async def imdb_search_id(kueri, message): BTN = [] k = await message.reply_photo( - "https://telegraph.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg", + "https://img.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg", caption=f"πŸ”Ž Menelusuri {kueri} di database IMDb ...", quote=True, ) @@ -186,7 +186,7 @@ async def imdb_search_id(kueri, message): async def imdb_search_en(kueri, message): BTN = [] k = await message.reply_photo( - "https://telegraph.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg", + "https://img.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg", caption=f"πŸ”Ž Searching {kueri} in IMDb Database...", quote=True, ) diff --git a/misskaty/plugins/inline_search.py b/misskaty/plugins/inline_search.py index fc503b8b..ef173920 100644 --- a/misskaty/plugins/inline_search.py +++ b/misskaty/plugins/inline_search.py @@ -409,7 +409,8 @@ async def inline_menu(self, inline_query: InlineQuery): for result in item: title = result.get("full_name") link = result.get("html_url") - deskripsi = result.get("description")[:25] if len(result.get("description")) > 25 else result.get("description") + desc = result.get("description") if result.get("description") else "" + deskripsi = desc[:100] if len(desc) > 100 else desc lang = result.get("language") message_text = f"πŸ”—: {result.get('html_url')}\nβ”‚\nβ””β”€πŸ΄Forks: {result.get('forks')} ┃┃ 🌟Stars: {result.get('stargazers_count')}\n\n" message_text += f"Description: {deskripsi}\n" diff --git a/misskaty/plugins/locks.py b/misskaty/plugins/locks.py index 173e3ed7..1d14d8c7 100644 --- a/misskaty/plugins/locks.py +++ b/misskaty/plugins/locks.py @@ -84,10 +84,6 @@ async def current_chat_permissions(chat_id): except FloodWait as e: await asyncio.sleep(e.value) perm = (await app.get_chat(chat_id)).permissions - try: - perm.can_send_messages - except: - LOGGER.error(f"Got error in chat: {chat_id}, perm: {perm}") # For debug if perm.can_send_messages: perms.append("can_send_messages") if perm.can_send_media_messages: @@ -182,8 +178,17 @@ async def locks_func(_, message): chat_id, ChatPermissions( can_send_messages=True, + can_send_plain=True, can_send_media_messages=True, - can_send_other_messages=True, + can_send_docs=True, + can_send_inline=True, + can_send_photos=True, + can_send_videos=True, + can_send_roundvideos=True, + can_send_audios=True, + can_send_voices=True, + can_send_stickers=True, + can_send_gifs=True, can_add_web_page_previews=True, can_send_polls=True, can_change_info=False, @@ -210,7 +215,7 @@ async def locktypes(_, message): await message.reply_text(perms) -@app.on_message(filters.text & ~filters.private, group=69) +@app.on_message(filters.text & filters.group, group=69) async def url_detector(_, message): user = message.from_user or message.sender_chat chat_id = message.chat.id diff --git a/misskaty/plugins/ocr.py b/misskaty/plugins/ocr.py index 2b0b2854..c57d069a 100644 --- a/misskaty/plugins/ocr.py +++ b/misskaty/plugins/ocr.py @@ -43,7 +43,7 @@ async def ocr(_, ctx: Message, strings): f"ocr_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.id}.jpg" ) response = await Telegraph().upload_file(file_path) - url = f"https://telegraph.yasirweb.eu.org{response[0]['src']}" + url = f"https://img.yasirweb.eu.org{response[0]['src']}" req = ( await fetch.get( f"https://script.google.com/macros/s/AKfycbwURISN0wjazeJTMHTPAtxkrZTWTpsWIef5kxqVGoXqnrzdLdIQIfLO7jsR5OQ5GO16/exec?url={url}", diff --git a/misskaty/plugins/start_help.py b/misskaty/plugins/start_help.py index d89688be..fb93cdaa 100644 --- a/misskaty/plugins/start_help.py +++ b/misskaty/plugins/start_help.py @@ -74,7 +74,7 @@ async def start(_, ctx: Message, strings): nama = ctx.from_user.mention if ctx.from_user else ctx.sender_chat.title try: return await ctx.reply_photo( - photo="https://telegraph.yasirweb.eu.org/file/90e9a448bc2f8b055b762.jpg", + photo="https://img.yasirweb.eu.org/file/90e9a448bc2f8b055b762.jpg", caption=strings("start_msg").format(kamuh=nama), reply_markup=keyboard, ) @@ -97,7 +97,7 @@ async def start(_, ctx: Message, strings): ) else: await ctx.reply_photo( - photo="https://telegraph.yasirweb.eu.org/file/90e9a448bc2f8b055b762.jpg", + photo="https://img.yasirweb.eu.org/file/90e9a448bc2f8b055b762.jpg", caption=home_text_pm, reply_markup=home_keyboard_pm, )