From 3645f4c8d2248490d878cd10808a70b180437564 Mon Sep 17 00:00:00 2001 From: Izumi Tachibana <99785450+Yuu-456@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:19:16 +0530 Subject: [PATCH] Delete cricketscore.py --- Shikimori/modules/cricketscore.py | 74 ------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 Shikimori/modules/cricketscore.py diff --git a/Shikimori/modules/cricketscore.py b/Shikimori/modules/cricketscore.py deleted file mode 100644 index 125f7924..00000000 --- a/Shikimori/modules/cricketscore.py +++ /dev/null @@ -1,74 +0,0 @@ -""" -STATUS: Code is working. ✅ -""" - -""" -GNU General Public License v3.0 - -Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] - -Credits:- - I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -""" - -import urllib.request - -from bs4 import BeautifulSoup -from telethon import events -from Shikimori import telethn as tbot -from telethon.tl import functions, types -from telethon.tl.types import * - - -async def is_register_admin(chat, user): - if isinstance(chat, (types.InputPeerChannel, types.InputChannel)): - return isinstance( - ( - await tbot(functions.channels.GetParticipantRequest(chat, user)) - ).participant, - (types.ChannelParticipantAdmin, types.ChannelParticipantCreator), - ) - if isinstance(chat, types.InputPeerUser): - return True - - -@tbot.on(events.NewMessage(pattern="/(c|cs)$")) -async def _(event): - if event.fwd_from: - return - if event.is_group: - if not (await is_register_admin(event.input_chat, event.message.sender_id)): - await event.reply("🚨 Need Admin Pewer.. You can't use this command.. But you can use in my pm") - return - - score_page = "http://static.cricinfo.com/rss/livescores.xml" - page = urllib.request.urlopen(score_page) - soup = BeautifulSoup(page, "html.parser") - result = soup.find_all("description") - Sed = "" - for match in result: - Sed += match.get_text() + "\n\n" - await event.reply( - f"Match information gathered successful\n\n\n{Sed}", - parse_mode="HTML", - ) - -__mod_name__ = "Cricket Score 🏏" -__help__ = """ -*Cricket Score* - ❍ `/c` : To check live cricket score - ❍ `/cs` : To check live cricket score -"""