├── Shikimori ├── logopom │ ├── y │ ├── DIGIT.ttf │ ├── Dark.ttf │ ├── Garda.ttf │ ├── elric.TTF │ ├── font.otf │ ├── fontx.ttf │ ├── CROWNT.TTF │ ├── Chopsic.otf │ ├── Damages.ttf │ ├── GRAMES.ttf │ ├── Geizer.otf │ ├── Maghrib.ttf │ ├── digital.ttf │ ├── Big Space.otf │ ├── Damages3D.ttf │ ├── Dark Seed.otf │ ├── Dash-Dermo.ttf │ ├── Dreamscar.ttf │ ├── EVILDEAD.TTF │ ├── Europhonic.otf │ ├── FontRemix.ttf │ ├── FontRemix2.ttf │ ├── Georgent.otf │ ├── Georgent.ttf │ ├── TruenoRg.otf │ ├── TruenoRgIt.otf │ ├── Vendetta.otf │ ├── hawkmoon.ttf │ ├── Damar Kurung.otf │ ├── Damar Kurung.ttf │ ├── DragonForcE.ttf │ ├── Dramaga Demo.otf │ ├── Dramaga Demo.ttf │ ├── Friend Head.otf │ ├── Gang Wolfik.ttf │ ├── TruenoBlkOl.otf │ ├── TruenoSBdIt.otf │ ├── Damages-Italic.ttf │ ├── Damages3DFilled.ttf │ ├── Dark Ministry.ttf │ ├── Dead Revolution.otf │ ├── DezertDemoDash.ttf │ ├── Fucking Hostile.ttf │ ├── Hallowed Grad.otf │ ├── Harker Italic.otf │ ├── Roboto-Italic.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-Regular.ttf │ ├── Damages3D-Italic.ttf │ ├── DezertDemoItalic.ttf │ ├── DezertDemoOutline.ttf │ ├── DezertDemoRegular.ttf │ ├── Exorcista_-Jed_40.ttf │ ├── Fire Flight FREE.otf │ ├── Fire Flight FREE.ttf │ ├── CRAWLER-RegularDEMO.ttf │ ├── Crozzoe-Personal-Use.otf │ ├── DezertDemoItalicDash.ttf │ ├── Frostbite Boss Fight.otf │ ├── Garreng-Personal-Use.otf │ ├── Harker Bold Italic.otf │ ├── RealFast Alfi Stefa.ttf │ ├── Damages3DFilled-Italic.ttf │ ├── DezertDemoOutlineDash.ttf │ ├── DisposableDroidBB_bld.ttf │ ├── ObelixProB-cyr Alfi Stefa.ttf │ ├── monumentextended-regular.otf │ ├── AVENGEANCE HEROIC AVENGER AT.otf │ ├── AVENGEANCE HEROIC AVENGER AT.ttf │ └── AVENGEANCE HEROIC AVENGER BI.otf ├── resources │ ├── a │ ├── fonts │ │ ├── a │ │ ├── 0.ttf │ │ ├── 1.ttf │ │ ├── 11.otf │ │ ├── 12.otf │ │ ├── 2.ttf │ │ ├── 3.ttf │ │ ├── 4.ttf │ │ ├── 5.ttf │ │ ├── 6.ttf │ │ ├── 7.ttf │ │ ├── 9.ttf │ │ └── default.ttf │ ├── ken.png │ ├── Facon.ttf │ ├── hero.png │ ├── Bombing.ttf │ ├── Chopsic.otf │ ├── Maghrib.ttf │ ├── blackbg.jpg │ ├── default.ttf │ ├── images.jpeg │ ├── x-cross.png │ ├── AceRecords.ttf │ ├── Streamster.ttf │ ├── Streetwear.ttf │ ├── waltgraph.ttf │ ├── AllCrackedOut.ttf │ ├── BERNIER Shade.ttf │ ├── DragonForcE.ttf │ ├── StephenType.ttf │ ├── Thunderstorm.ttf │ ├── Vampire Wars.otf │ └── RothenburgDecorative.ttf ├── core │ ├── index.php │ ├── types │ │ └── __init__.py │ ├── decorators │ │ ├── misc.py │ │ └── errors.py │ ├── sections.py │ ├── keyboard.py │ └── filters.py ├── modules │ ├── helper_funcs │ │ ├── telethn │ │ │ ├── a │ │ │ └── __init__.py │ │ ├── regex_helper.py │ │ ├── readable_time.py │ │ ├── alternate.py │ │ ├── filters.py │ │ └── admin_status.py │ ├── GIFS_mod.py │ ├── redis │ │ ├── __init__.py │ │ └── afk_redis.py │ ├── mongo │ │ ├── karma_mongo.py │ │ ├── nsfw_mongo.py │ │ ├── nsfw_watch_mongo.py │ │ ├── antiservice_mongo.py │ │ ├── chatbot_mongo.py │ │ └── antichannel_mongo.py │ ├── sql_2 │ │ ├── __init__.py │ │ ├── rules_sql.py │ │ └── approve_sql.py │ ├── sql │ │ ├── __init__.py │ │ ├── forceSubscribe_sql.py │ │ └── blacklistusers_sql.py │ ├── send.py │ ├── sections.py │ ├── anime_schedule.py │ ├── antichannel.py │ ├── carbon.py │ ├── wish.py │ ├── animelinks.py │ ├── apod.py │ ├── encrypt.py │ ├── watchorder.py │ ├── urbandictionary.py │ ├── animals.py │ ├── wallpaper.py │ ├── snipe.py │ ├── games.py │ ├── reddit.py │ ├── __init__.py │ ├── fakeit.py │ ├── ann.py │ ├── truth_and_dare.py │ ├── covid.py │ ├── plet.py │ ├── cricketscore.py │ ├── shell.py │ ├── crypto.py │ ├── TTS.py │ ├── tagall.py │ ├── uchiha.py │ ├── debug.py │ ├── get_common_chats.py │ ├── waifu.py │ ├── json.py │ └── pfp.py ├── imports │ ├── hmfull │ │ ├── src │ │ │ ├── hmfull.egg-info │ │ │ │ ├── top_level.txt │ │ │ │ ├── dependency_links.txt │ │ │ │ ├── requires.txt │ │ │ │ └── SOURCES.txt │ │ │ ├── test.py │ │ │ ├── hmfullpy.zip │ │ │ ├── __pycache__ │ │ │ │ ├── hmtai.cpython-310.pyc │ │ │ │ ├── hmfull.cpython-310.pyc │ │ │ │ └── fetchAPI.cpython-310.pyc │ │ │ ├── fetchAPI.py │ │ │ └── images │ │ │ │ ├── slap.json │ │ │ │ ├── jahy.json │ │ │ │ ├── nsfwMobileWallpaper.json │ │ │ │ ├── lick.json │ │ │ │ └── depression.json │ │ ├── setup.cfg │ │ ├── dist │ │ │ ├── hmfull-1.0.tar.gz │ │ │ ├── hmfull-1.0.1.tar.gz │ │ │ ├── hmfull-1.0.2.tar.gz │ │ │ └── hmfull-1.0.3.tar.gz │ │ ├── __pycache__ │ │ │ ├── hmfull.cpython-310.pyc │ │ │ ├── hmtai.cpython-310.pyc │ │ │ └── fetchAPI.cpython-310.pyc │ │ └── setup.py │ ├── animedev │ │ ├── exceptions.py │ │ └── __init__.py │ ├── emoji_pip │ │ ├── unicode_codes │ │ │ └── __init__.py │ │ └── __init__.py │ └── youtube_search │ │ └── __init__.py ├── elevated_users.json ├── utils │ ├── markup.py │ ├── filter_groups.py │ ├── paste.py │ ├── captcha_mongo.py │ ├── logger.py │ ├── pastebin.py │ ├── adminperms.py │ ├── errors.py │ └── http.py ├── strings │ ├── waifu_string.py │ └── animequotes_string.py ├── mongo.py └── Extras │ └── errors.py ├── runtime.txt ├── Procfile ├── heroku.yml ├── start.bat ├── restart.bat ├── Setup venv.bat ├── SetupVirtualEnv_run_once.bat ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── SECURITY.md ├── Dockerfile ├── start_service.bat ├── requirements.txt ├── CONTRIBUTING.md └── CODE_OF_CONDUCT.md /Shikimori/logopom/y: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Shikimori/resources/a: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Shikimori/core/index.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Shikimori/resources/fonts/a: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.5 2 | -------------------------------------------------------------------------------- /Shikimori/modules/helper_funcs/telethn/a: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/hmfull.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker: python3 -m Shikimori 2 | ps:scale worker=1 3 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/hmfull.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/hmfull.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file=README.md -------------------------------------------------------------------------------- /Shikimori/imports/animedev/exceptions.py: -------------------------------------------------------------------------------- 1 | class NotFound(Exception): 2 | pass -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/test.py: -------------------------------------------------------------------------------- 1 | import hmfull 2 | 3 | print(hmfull.HM.Nekos.sfw.foxgirl()) -------------------------------------------------------------------------------- /Shikimori/logopom/DIGIT.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DIGIT.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Dark.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Dark.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Garda.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Garda.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/elric.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/elric.TTF -------------------------------------------------------------------------------- /Shikimori/logopom/font.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/font.otf -------------------------------------------------------------------------------- /Shikimori/logopom/fontx.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/fontx.ttf -------------------------------------------------------------------------------- /Shikimori/resources/ken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/ken.png -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | worker: Dockerfile 4 | run: 5 | worker: python3 -m Shikimori 6 | -------------------------------------------------------------------------------- /Shikimori/logopom/CROWNT.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/CROWNT.TTF -------------------------------------------------------------------------------- /Shikimori/logopom/Chopsic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Chopsic.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Damages.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Damages.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/GRAMES.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/GRAMES.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Geizer.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Geizer.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Maghrib.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Maghrib.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/digital.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/digital.ttf -------------------------------------------------------------------------------- /Shikimori/resources/Facon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/Facon.ttf -------------------------------------------------------------------------------- /Shikimori/resources/hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/hero.png -------------------------------------------------------------------------------- /Shikimori/logopom/Big Space.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Big Space.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Damages3D.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Damages3D.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Dark Seed.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Dark Seed.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Dash-Dermo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Dash-Dermo.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Dreamscar.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Dreamscar.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/EVILDEAD.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/EVILDEAD.TTF -------------------------------------------------------------------------------- /Shikimori/logopom/Europhonic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Europhonic.otf -------------------------------------------------------------------------------- /Shikimori/logopom/FontRemix.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/FontRemix.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/FontRemix2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/FontRemix2.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Georgent.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Georgent.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Georgent.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Georgent.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/TruenoRg.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/TruenoRg.otf -------------------------------------------------------------------------------- /Shikimori/logopom/TruenoRgIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/TruenoRgIt.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Vendetta.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Vendetta.otf -------------------------------------------------------------------------------- /Shikimori/logopom/hawkmoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/hawkmoon.ttf -------------------------------------------------------------------------------- /Shikimori/resources/Bombing.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/Bombing.ttf -------------------------------------------------------------------------------- /Shikimori/resources/Chopsic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/Chopsic.otf -------------------------------------------------------------------------------- /Shikimori/resources/Maghrib.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/Maghrib.ttf -------------------------------------------------------------------------------- /Shikimori/resources/blackbg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/blackbg.jpg -------------------------------------------------------------------------------- /Shikimori/resources/default.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/default.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/0.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/1.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/11.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/11.otf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/12.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/12.otf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/2.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/3.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/3.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/4.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/4.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/5.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/5.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/6.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/6.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/7.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/7.ttf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/9.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/9.ttf -------------------------------------------------------------------------------- /Shikimori/resources/images.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/images.jpeg -------------------------------------------------------------------------------- /Shikimori/resources/x-cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/x-cross.png -------------------------------------------------------------------------------- /Shikimori/logopom/Damar Kurung.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Damar Kurung.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Damar Kurung.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Damar Kurung.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/DragonForcE.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DragonForcE.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Dramaga Demo.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Dramaga Demo.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Dramaga Demo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Dramaga Demo.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Friend Head.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Friend Head.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Gang Wolfik.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Gang Wolfik.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/TruenoBlkOl.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/TruenoBlkOl.otf -------------------------------------------------------------------------------- /Shikimori/logopom/TruenoSBdIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/TruenoSBdIt.otf -------------------------------------------------------------------------------- /Shikimori/resources/AceRecords.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/AceRecords.ttf -------------------------------------------------------------------------------- /Shikimori/resources/Streamster.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/Streamster.ttf -------------------------------------------------------------------------------- /Shikimori/resources/Streetwear.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/Streetwear.ttf -------------------------------------------------------------------------------- /Shikimori/resources/waltgraph.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/waltgraph.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Damages-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Damages-Italic.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Damages3DFilled.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Damages3DFilled.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Dark Ministry.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Dark Ministry.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Dead Revolution.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Dead Revolution.otf -------------------------------------------------------------------------------- /Shikimori/logopom/DezertDemoDash.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DezertDemoDash.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Fucking Hostile.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Fucking Hostile.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Hallowed Grad.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Hallowed Grad.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Harker Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Harker Italic.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Roboto-Italic.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Roboto-Medium.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Roboto-Regular.ttf -------------------------------------------------------------------------------- /Shikimori/resources/AllCrackedOut.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/AllCrackedOut.ttf -------------------------------------------------------------------------------- /Shikimori/resources/BERNIER Shade.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/BERNIER Shade.ttf -------------------------------------------------------------------------------- /Shikimori/resources/DragonForcE.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/DragonForcE.ttf -------------------------------------------------------------------------------- /Shikimori/resources/StephenType.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/StephenType.ttf -------------------------------------------------------------------------------- /Shikimori/resources/Thunderstorm.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/Thunderstorm.ttf -------------------------------------------------------------------------------- /Shikimori/resources/Vampire Wars.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/Vampire Wars.otf -------------------------------------------------------------------------------- /Shikimori/resources/fonts/default.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/fonts/default.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Damages3D-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Damages3D-Italic.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/DezertDemoItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DezertDemoItalic.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/DezertDemoOutline.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DezertDemoOutline.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/DezertDemoRegular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DezertDemoRegular.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Exorcista_-Jed_40.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Exorcista_-Jed_40.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Fire Flight FREE.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Fire Flight FREE.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Fire Flight FREE.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Fire Flight FREE.ttf -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/hmfullpy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/src/hmfullpy.zip -------------------------------------------------------------------------------- /Shikimori/logopom/CRAWLER-RegularDEMO.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/CRAWLER-RegularDEMO.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Crozzoe-Personal-Use.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Crozzoe-Personal-Use.otf -------------------------------------------------------------------------------- /Shikimori/logopom/DezertDemoItalicDash.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DezertDemoItalicDash.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Frostbite Boss Fight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Frostbite Boss Fight.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Garreng-Personal-Use.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Garreng-Personal-Use.otf -------------------------------------------------------------------------------- /Shikimori/logopom/Harker Bold Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Harker Bold Italic.otf -------------------------------------------------------------------------------- /Shikimori/logopom/RealFast Alfi Stefa.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/RealFast Alfi Stefa.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/Damages3DFilled-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/Damages3DFilled-Italic.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/DezertDemoOutlineDash.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DezertDemoOutlineDash.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/DisposableDroidBB_bld.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/DisposableDroidBB_bld.ttf -------------------------------------------------------------------------------- /Shikimori/resources/RothenburgDecorative.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/resources/RothenburgDecorative.ttf -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/dist/hmfull-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/dist/hmfull-1.0.tar.gz -------------------------------------------------------------------------------- /Shikimori/logopom/ObelixProB-cyr Alfi Stefa.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/ObelixProB-cyr Alfi Stefa.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/monumentextended-regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/monumentextended-regular.otf -------------------------------------------------------------------------------- /start.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | TITLE Shikimori 3 | :: Enables virtual env mode and then starts Shikimori 4 | env\scripts\activate.bat && py -m Shikimori 5 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/dist/hmfull-1.0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/dist/hmfull-1.0.1.tar.gz -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/dist/hmfull-1.0.2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/dist/hmfull-1.0.2.tar.gz -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/dist/hmfull-1.0.3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/dist/hmfull-1.0.3.tar.gz -------------------------------------------------------------------------------- /Shikimori/logopom/AVENGEANCE HEROIC AVENGER AT.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/AVENGEANCE HEROIC AVENGER AT.otf -------------------------------------------------------------------------------- /Shikimori/logopom/AVENGEANCE HEROIC AVENGER AT.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/AVENGEANCE HEROIC AVENGER AT.ttf -------------------------------------------------------------------------------- /Shikimori/logopom/AVENGEANCE HEROIC AVENGER BI.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/logopom/AVENGEANCE HEROIC AVENGER BI.otf -------------------------------------------------------------------------------- /restart.bat: -------------------------------------------------------------------------------- 1 | :: starts a cmd to silently start the bat file, just another dirty way of getting things done for my env on windows 2 | start cmd.exe /c start_service.batu 3 | -------------------------------------------------------------------------------- /Shikimori/core/types/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | from .InlineQueryResult import ( 4 | InlineQueryResultAudio, 5 | InlineQueryResultCachedDocument, 6 | ) 7 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/__pycache__/hmfull.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/__pycache__/hmfull.cpython-310.pyc -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/__pycache__/hmtai.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/__pycache__/hmtai.cpython-310.pyc -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/__pycache__/fetchAPI.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/__pycache__/fetchAPI.cpython-310.pyc -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/__pycache__/hmtai.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/src/__pycache__/hmtai.cpython-310.pyc -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/__pycache__/hmfull.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/src/__pycache__/hmfull.cpython-310.pyc -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/__pycache__/fetchAPI.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SOME-1HING/ShikimoriBot/HEAD/Shikimori/imports/hmfull/src/__pycache__/fetchAPI.cpython-310.pyc -------------------------------------------------------------------------------- /Setup venv.bat: -------------------------------------------------------------------------------- 1 | TITLE Setting up virtual env 2 | :: Running it once is fine, this just sets up virtual env >> install all modules there 3 | py -m venv env && env\scripts\activate.bat && pip install -r requirements.txt 4 | -------------------------------------------------------------------------------- /Shikimori/modules/GIFS_mod.py: -------------------------------------------------------------------------------- 1 | __mod_name__ = "GIFs" 2 | 3 | __help__ = """ 4 | > `/pat` *:* Pat someone. 5 | > `/hug` *:* Hug someone. 6 | > `/slap` *:* Slap someone. 7 | > `/source` *:* Get the source of life. 8 | """ 9 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/hmfull.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | README.rst 2 | setup.cfg 3 | setup.py 4 | src/hmfull.egg-info/PKG-INFO 5 | src/hmfull.egg-info/SOURCES.txt 6 | src/hmfull.egg-info/dependency_links.txt 7 | src/hmfull.egg-info/requires.txt 8 | src/hmfull.egg-info/top_level.txt -------------------------------------------------------------------------------- /Shikimori/elevated_users.json: -------------------------------------------------------------------------------- 1 | { 2 | "devs": [], 3 | "supports": [], 4 | "whitelists": [], 5 | "spammers": [], 6 | "dragons": [], 7 | "demons": [], 8 | "wolfes": [], 9 | "heroes": [], 10 | "tigers": [], 11 | "sudos": [] 12 | } 13 | -------------------------------------------------------------------------------- /Shikimori/modules/helper_funcs/telethn/__init__.py: -------------------------------------------------------------------------------- 1 | from Shikimori import DEV_USERS, DRAGONS, DEMONS, TIGERS, WOLVES 2 | 3 | IMMUNE_USERS = DRAGONS + WOLVES + DEMONS + TIGERS + DEV_USERS 4 | 5 | IMMUNE_USERS = ( 6 | list(DRAGONS) + list(WOLVES) + list(DEMONS) + list(TIGERS) + list(DEV_USERS) 7 | ) 8 | -------------------------------------------------------------------------------- /Shikimori/utils/markup.py: -------------------------------------------------------------------------------- 1 | def MakeCaptchaMarkup(markup, _number, sign): 2 | __markup = markup 3 | for i in markup: 4 | for k in i: 5 | if k["text"] == _number: 6 | k["text"] = f"{sign}" 7 | k["callback_data"] = "done_" 8 | return __markup 9 | -------------------------------------------------------------------------------- /Shikimori/utils/filter_groups.py: -------------------------------------------------------------------------------- 1 | chat_filters_group = 1 2 | chatbot_group = 2 3 | karma_positive_group = 3 4 | karma_negative_group = 4 5 | regex_group = 5 6 | welcome_captcha_group = 6 7 | antiflood_group = 7 8 | nsfw_detect_group = 8 9 | blacklist_filters_group = 9 10 | pipes_group = 10 11 | taglog_group = 11 12 | chat_watcher_group = 12 13 | -------------------------------------------------------------------------------- /Shikimori/modules/redis/__init__.py: -------------------------------------------------------------------------------- 1 | from redis import StrictRedis 2 | from Shikimori.vars import REDIS_URL 3 | from Shikimori import LOGGER 4 | 5 | REDIS = StrictRedis.from_url(REDIS_URL,decode_responses=True) 6 | try: 7 | REDIS.ping() 8 | LOGGER.info("Your redis server is now alive!") 9 | except BaseException: 10 | raise Exception("Your redis server is not alive, please check again.") 11 | 12 | finally: 13 | REDIS.ping() 14 | LOGGER.info("Your redis server is now alive!") -------------------------------------------------------------------------------- /SetupVirtualEnv_run_once.bat: -------------------------------------------------------------------------------- 1 | TITLE Setting up virtual env 2 | :: Running it once is fine, this just sets up virtual env >> install all modules there 3 | py -m venv env && env\scripts\activate.bat && pip install -r requirements.txt 4 | 5 | :: Note to rerun the requirements.txt in case you ever add a mdoule. 6 | :: Running this multiple time will not make a mess of your setup, dont worry about that bit. 7 | 8 | © 2022 GitHub, Inc. 9 | 10 | Terms 11 | Privacy 12 | Security 13 | Status 14 | Docs 15 | Contact 16 | -------------------------------------------------------------------------------- /Shikimori/imports/animedev/__init__.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | from . import exceptions 4 | 5 | base_url = 'https://9anime.dev' 6 | 7 | class client: 8 | def __init__(): 9 | pass 10 | 11 | def search(anime_name): 12 | r = requests.get(base_url + '/anime?search=' + anime_name) 13 | if r.status_code == 404: 14 | raise exceptions.NotFound('Not Found.') 15 | elif r.status_code != 200: 16 | raise Exception(r.content) 17 | return json.loads(json.dumps(r.json(), indent=4)) 18 | 19 | __version__ = '1.0.0' -------------------------------------------------------------------------------- /Shikimori/modules/mongo/karma_mongo.py: -------------------------------------------------------------------------------- 1 | from Shikimori.mongo import db 2 | 3 | karma_statusdb = db.karma_status 4 | 5 | def is_karma(chat_id): 6 | karma = karma_statusdb.find_one({"chat_id": chat_id}) 7 | if not karma: 8 | return False 9 | else: 10 | return True 11 | 12 | def set_karma(chat_id): 13 | karma = is_karma(chat_id) 14 | if karma: 15 | return 16 | else: 17 | return karma_statusdb.insert_one({"chat_id": chat_id}) 18 | 19 | def rem_karma(chat_id): 20 | karma = is_karma(chat_id) 21 | if not karma: 22 | return 23 | else: 24 | return karma_statusdb.delete_one({"chat_id": chat_id}) -------------------------------------------------------------------------------- /Shikimori/modules/mongo/nsfw_mongo.py: -------------------------------------------------------------------------------- 1 | from Shikimori.mongo import db 2 | 3 | nsfwchatsdb = db.nsfwchats 4 | 5 | def is_nsfw(chat_id): 6 | nsfwchat = nsfwchatsdb.find_one({"chat_id": chat_id}) 7 | if not nsfwchat: 8 | return False 9 | else: 10 | return True 11 | 12 | def set_nsfw(chat_id): 13 | nsfwchat = is_nsfw(chat_id) 14 | if nsfwchat: 15 | return 16 | else: 17 | return nsfwchatsdb.insert_one({"chat_id": chat_id}) 18 | 19 | def rem_nsfw(chat_id): 20 | nsfwchat = is_nsfw(chat_id) 21 | if not nsfwchat: 22 | return 23 | else: 24 | return nsfwchatsdb.delete_one({"chat_id": chat_id}) -------------------------------------------------------------------------------- /Shikimori/modules/mongo/nsfw_watch_mongo.py: -------------------------------------------------------------------------------- 1 | from Shikimori.mongo import db 2 | 3 | Nsfwatchdb = db.Nsfwatch 4 | 5 | def is_nsfwatch_indb(chat_id): 6 | nsfwm = Nsfwatchdb.find_one({"chat_id": chat_id}) 7 | if not nsfwm: 8 | return False 9 | else: 10 | return True 11 | 12 | def add_nsfwm(chat_id): 13 | nsfwm = is_nsfwatch_indb(chat_id) 14 | if nsfwm: 15 | return 16 | else: 17 | return Nsfwatchdb.insert_one({"chat_id": chat_id}) 18 | 19 | def rm_nsfwm(chat_id): 20 | nsfwm = is_nsfwatch_indb(chat_id) 21 | if not nsfwm: 22 | return 23 | else: 24 | return Nsfwatchdb.delete_one({"chat_id": chat_id}) -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:11 2 | FROM python:3.10.5-buster 3 | FROM nikolaik/python-nodejs:python3.9-nodejs18 4 | 5 | WORKDIR /Shikimori/ 6 | 7 | RUN /usr/local/bin/python -m pip install --upgrade pip 8 | RUN pip3 install --upgrade pip setuptools 9 | RUN apt-get -y install git 10 | RUN apt-get update -y && apt-get upgrade -y \ 11 | && apt-get install -y --no-install-recommends ffmpeg \ 12 | && apt-get clean \ 13 | && rm -rf /var/lib/apt/lists/* 14 | RUN apt-get install libxml2-dev libxslt-dev python 15 | 16 | 17 | COPY requirements.txt . 18 | 19 | RUN pip3 install wheel 20 | RUN pip3 install --no-cache-dir -U -r requirements.txt 21 | COPY . . 22 | CMD ["python3", "-m", "Shikimori"] 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | # read the contents of your README file 4 | from pathlib import Path 5 | this_directory = Path(__file__).parent 6 | long_description = (this_directory / "README.rst").read_text("utf-8") 7 | 8 | setup( 9 | name='hmfull', 10 | version='1.0.3', 11 | license='ISC', 12 | author="Alice Addison", 13 | author_email='alice@alicesworld.tech', 14 | packages=find_packages('src'), 15 | package_dir={'': 'src'}, 16 | url='https://github.com/ProgrammerIn-wonderland/hmfullpy', 17 | keywords= ["anime", "hentai", "nsfw", "sfw", "images", "gifs", "wallpaper", "discord", "ahegao", "ass", "neko", "kitsune", "yuri", "panties", "thighs", "foot", "overwatch", "dva", "erotic", "lewdkemo", "lewdneko", "lewdkitsune", "holo", "bj", "spank", "ero", "kawaii", "cute", "waifu", "hmtai", "zettaiRyouiki", "18+", "REST", "API", "Mikun"], 18 | long_description=long_description, 19 | long_description_content_type='text/x-rst', 20 | install_requires=[ 21 | 'requests', 22 | ], 23 | 24 | ) -------------------------------------------------------------------------------- /start_service.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: This runs the batch file as an admin - required UAC to be off 3 | :: This is just an asty hack in to get job done cause we host it on windows dedi. 4 | :: BatchGotAdmin 5 | :------------------------------------- 6 | REM --> Check for permissions 7 | >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" 8 | 9 | REM --> If error flag set, we do not have admin. 10 | if '%errorlevel%' NEQ '0' ( 11 | echo Requesting administrative privileges... 12 | goto UACPrompt 13 | ) else ( goto gotAdmin ) 14 | 15 | :UACPrompt 16 | echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" 17 | set params = %*:"="" 18 | echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" 19 | 20 | "%temp%\getadmin.vbs" 21 | del "%temp%\getadmin.vbs" 22 | exit /B 23 | 24 | :gotAdmin 25 | pushd "%CD%" 26 | CD /D "%~dp0" 27 | :-------------------------------------- 28 | :: your commands begin from this point. 29 | :: stops the service and then starts it 30 | net stop Senku 31 | net start Senku 32 | -------------------------------------------------------------------------------- /Shikimori/modules/mongo/antiservice_mongo.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | from Shikimori.mongo import db 25 | 26 | aservice = db.aservice 27 | 28 | def is_aservice(chat_id: int) -> bool: 29 | chat = aservice.find_one({"chat_id": chat_id}) 30 | if chat: 31 | return True 32 | return False 33 | 34 | def set_aservice(chat_id): 35 | aservice = aservice(chat_id) 36 | if aservice: 37 | return 38 | return aservice.insert_one({"chat_id": chat_id}) 39 | 40 | def rem_aservice(chat_id): 41 | aservice = aservice(chat_id) 42 | if not aservice: 43 | return 44 | return aservice.delete_one({"chat_id": chat_id}) -------------------------------------------------------------------------------- /Shikimori/modules/mongo/chatbot_mongo.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | from Shikimori.mongo import db 25 | 26 | chatbotdb = db.chatbot 27 | 28 | def is_chatbot(chat_id): 29 | chatbot = chatbotdb.find_one({"chat_id": chat_id}) 30 | if not chatbot: 31 | return False 32 | else: 33 | return True 34 | 35 | def add_chatbot(chat_id): 36 | chatbot = is_chatbot(chat_id) 37 | if chatbot: 38 | return 39 | else: 40 | return chatbotdb.insert_one({"chat_id": chat_id}) 41 | 42 | def rm_chatbot(chat_id): 43 | chatbot = is_chatbot(chat_id) 44 | if not chatbot: 45 | return 46 | else: 47 | return chatbotdb.delete_one({"chat_id": chat_id}) 48 | -------------------------------------------------------------------------------- /Shikimori/modules/sql_2/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori.vars import FUNC_DB_URL 28 | from sqlalchemy import create_engine 29 | from sqlalchemy.ext.declarative import declarative_base 30 | from sqlalchemy.orm import scoped_session, sessionmaker 31 | 32 | 33 | def start() -> scoped_session: 34 | engine = create_engine(FUNC_DB_URL, client_encoding="utf8") 35 | BASE.metadata.bind = engine 36 | BASE.metadata.create_all(engine) 37 | return scoped_session(sessionmaker(bind=engine, autoflush=True)) 38 | 39 | 40 | BASE = declarative_base() 41 | SESSION = start() 42 | -------------------------------------------------------------------------------- /Shikimori/strings/waifu_string.py: -------------------------------------------------------------------------------- 1 | WAIFUS = ( 2 | "https://telegra.ph/file/78f76ef5470532311b38d.jpg", 3 | "https://telegra.ph/file/b696743144ef674fe5a22.jpg", 4 | "https://telegra.ph/file/4634f084799a612435a93.jpg", 5 | "https://telegra.ph/file/5ed3565b9980c560badcb.jpg", 6 | "https://telegra.ph/file/2f3c25492308cebf019ba.jpg", 7 | "https://telegra.ph/file/9d49c5b637f2a0badf965.jpg", 8 | "https://telegra.ph/file/3bf46c095d9596887abc1.jpg", 9 | "https://telegra.ph/file/3bf46c095d9596887abc1.jpg", 10 | "https://telegra.ph/file/1ebadc9f20560a674dbee.jpg", 11 | "https://telegra.ph/file/5378bbfe99b8085f6b8f3.jpg", 12 | "https://telegra.ph/file/33f4c3a307d44b9ab3d20.jpg", 13 | "https://telegra.ph/file/af0dfd4c829c8d10e95d7.jpg", 14 | "https://telegra.ph/file/29892221ccf7ed5a58c9f.jpg", 15 | "https://telegra.ph/file/64447e148ba720331fc0a.jpg", 16 | "https://telegra.ph/file/96c0a88ed2e1cb5087da1.jpg", 17 | "https://telegra.ph/file/4d3ca180500c210a204a4.jpg", 18 | "https://telegra.ph/file/3a974ac299242236a61aa.jpg", 19 | "https://telegra.ph/file/7622aa583ec5068e9d762.jpg", 20 | "https://telegra.ph/file/1ac1e8f0cfc548b693246.jpg", 21 | "https://telegra.ph/file/636e21706b563ca92b2f8.jpg", 22 | "https://telegra.ph/file/161c24ca87b47bc31f947.jpg", 23 | "https://telegra.ph/file/31689b7f9c042b383c342.jpg", 24 | "https://telegra.ph/file/06eae4e7f8a2b7ce55d3a.jpg", 25 | "https://telegra.ph/file/99473f1422d051feed25b.jpg", 26 | "https://telegra.ph/file/2517d810ea112d5b4c42f.jpg", 27 | ) -------------------------------------------------------------------------------- /Shikimori/modules/sql/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori.vars import DB_URL 28 | from sqlalchemy import create_engine 29 | from sqlalchemy.ext.declarative import declarative_base 30 | from sqlalchemy.orm import scoped_session, sessionmaker 31 | 32 | 33 | def start() -> scoped_session: 34 | engine = create_engine(DB_URL, client_encoding="utf8") 35 | BASE.metadata.bind = engine 36 | BASE.metadata.create_all(engine) 37 | return scoped_session(sessionmaker(bind=engine, autoflush=True)) 38 | 39 | 40 | BASE = declarative_base() 41 | SESSION = start() 42 | -------------------------------------------------------------------------------- /Shikimori/modules/redis/afk_redis.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori.modules.redis import REDIS 28 | 29 | # AFK 30 | def is_user_afk(userid): 31 | rget = REDIS.get(f'is_afk_{userid}') 32 | return bool(rget) 33 | 34 | 35 | def start_afk(userid, reason): 36 | REDIS.set(f'is_afk_{userid}', reason) 37 | 38 | def afk_reason(userid): 39 | return strb(REDIS.get(f'is_afk_{userid}')) 40 | 41 | def end_afk(userid): 42 | REDIS.delete(f'is_afk_{userid}') 43 | return True 44 | 45 | # Helpers 46 | def strb(redis_string): 47 | return str(redis_string) 48 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | lxml 2 | wget 3 | gtts 4 | beautifulsoup4 5 | requests 6 | python-telegram-bot==13.9.0 7 | SQLAlchemy==1.4.28 8 | psycopg2-binary 9 | feedparser 10 | faker 11 | hachoir 12 | pykeyboard 13 | pynewtonmath 14 | aiofiles 15 | ffmpeg-python 16 | spongemock 17 | zalgo-text 18 | geopy 19 | nltk 20 | psutil 21 | aiohttp 22 | Pillow>=9.0 23 | CurrencyConverter 24 | googletrans 25 | google-trans-new 26 | speedtest-cli 27 | coffeehouse 28 | regex 29 | bleach 30 | wikipedia 31 | markdown2 32 | telethon 33 | telegraph 34 | heroku3 35 | spamwatch 36 | alphabet_detector 37 | pyrate-limiter 38 | cachetools 39 | ujson 40 | pretty_errors 41 | pygithub 42 | TgCrypto 43 | Pyrogram 44 | PyDictionary 45 | git+https://github.com/Sorrybabe/downloader 46 | youtube_search_python 47 | lyrics_extractor 48 | asyncio 49 | cloudscraper 50 | dateparser 51 | pymongo 52 | dnspython 53 | secureme 54 | apscheduler 55 | emoji-country-flag 56 | countryinfo 57 | html2text 58 | bs4 59 | redis 60 | janda 61 | pySmartDL 62 | bing_image_downloader 63 | search_engine_parser 64 | pytz 65 | jikanpy 66 | tswift 67 | python-arq 68 | envparse 69 | #profanity (Credits to Julia) 70 | better_profanity 71 | textblob 72 | nudepy 73 | nekos.py 74 | motor 75 | gpytranslate 76 | fontTools 77 | opencv-python-headless 78 | odmantic 79 | tzlocal 80 | pendulum 81 | fuzzysearch 82 | img2pdf 83 | multicolorcaptcha 84 | git+https://github.com/python-telegram-bot/ptbcontrib.git 85 | PyYAML>5.0 86 | loguru 87 | aiofiles 88 | pytube 89 | yt_dlp 90 | pytimeparse 91 | youtube_dl 92 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are very welcome! Here are some guidelines on how the project is designed. 4 | 5 | ### CodeStyle 6 | 7 | - Adhere to PEP8 as much as possible. 8 | 9 | - Line lengths should be under 120 characters, use list comprehensions over map/filter, don't leave trailing whitespace. 10 | 11 | - More complex pieces of code should be commented for future reference. 12 | 13 | ### Structure 14 | 15 | There are a few self-imposed rules on the project structure, to keep the project as tidy as possible. 16 | - All modules should go into the `modules/` directory. 17 | - Any database accesses should be done in `modules/sql/` - no instances of SESSION should be imported anywhere else. 18 | - Make sure your database sessions are properly scoped! Always close them properly. 19 | - When creating a new module, there should be as few changes to other files as possible required to incorporate it. 20 | Removing the module file should result in a bot which is still in perfect working condition. 21 | - If a module is dependent on multiple other files, which might not be loaded, then create a list of at module 22 | load time, in `__main__`, by looking at attributes. This is how migration, /help, /stats, /info, and many other things 23 | are based off of. It allows the bot to work fine with the LOAD and NO_LOAD configurations. 24 | - Keep in mind that some things might clash; eg a regex handler could clash with a command handler - in this case, you 25 | should put them in different dispatcher groups. 26 | 27 | Might seem complicated, but it'll make sense when you get into it. Feel free to ask us in issue requests if you ever need to! 28 | -------------------------------------------------------------------------------- /Shikimori/modules/send.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | from Shikimori import dispatcher 25 | from Shikimori.modules.disable import DisableAbleCommandHandler 26 | 27 | from Shikimori.modules.helper_funcs.alternate import send_message 28 | 29 | 30 | def send(update, context): 31 | args = update.effective_message.text.split(None, 1) 32 | creply = args[1] 33 | send_message(update.effective_message, creply) 34 | 35 | __help__ = """The Send Module Allows you to send a custom message to users in a chat 36 | `/snd` :Send the given message 37 | Note - /snd Hi will send the message hi to the chat""" 38 | 39 | __mod_name__ = "Send" 40 | 41 | 42 | ADD_CCHAT_HANDLER = DisableAbleCommandHandler("snd", send, run_async = True) 43 | dispatcher.add_handler(ADD_CCHAT_HANDLER) 44 | __command_list__ = ["snd"] 45 | __handlers__ = [ 46 | ADD_CCHAT_HANDLER 47 | ] 48 | -------------------------------------------------------------------------------- /Shikimori/core/decorators/misc.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | 4 | Copyright (c) 2021 TheHamkerCat 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | """ 24 | from functools import wraps 25 | from time import time 26 | 27 | 28 | def exec_time(func): 29 | @wraps(func) 30 | async def _time_it(*args, **kwargs): 31 | t1 = time() 32 | try: 33 | return await func(*args, **kwargs) 34 | finally: 35 | t2 = time() 36 | total = t2 - t1 37 | total = round(total, 3) 38 | print(f"{func.__name__} Took: {total} Seconds") 39 | 40 | return _time_it 41 | -------------------------------------------------------------------------------- /Shikimori/utils/paste.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import socket 28 | from asyncio import get_running_loop 29 | from functools import partial 30 | 31 | 32 | def _netcat(host, port, content): 33 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 34 | s.connect((host, port)) 35 | s.sendall(content.encode()) 36 | s.shutdown(socket.SHUT_WR) 37 | while True: 38 | data = s.recv(4096).decode("utf-8").strip("\n\x00") 39 | if not data: 40 | break 41 | return data 42 | s.close() 43 | 44 | 45 | async def paste(content): 46 | loop = get_running_loop() 47 | link = await loop.run_in_executor(None, partial(_netcat, "ezup.dev", 9999, content)) 48 | return link 49 | -------------------------------------------------------------------------------- /Shikimori/modules/mongo/antichannel_mongo.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori.mongo import db 28 | 29 | antichanneldb = db.antichannel 30 | 31 | def antichannel_status(chat_id): 32 | is_achannel = antichanneldb.find_one({"chat_id": chat_id}) 33 | if not is_achannel: 34 | return False 35 | else: 36 | return True 37 | 38 | def enable_antichannel(chat_id): 39 | is_achannel = antichannel_status(chat_id) 40 | if is_achannel: 41 | return 42 | else: 43 | return antichanneldb.insert_one({"chat_id": chat_id}) 44 | 45 | def disable_antichannel(chat_id): 46 | is_achannel = antichannel_status(chat_id) 47 | if not is_achannel: 48 | return 49 | else: 50 | return antichanneldb.delete_one({"chat_id": chat_id}) -------------------------------------------------------------------------------- /Shikimori/utils/captcha_mongo.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from pymongo import MongoClient 28 | 29 | from Shikimori.vars import MONGO_DB_URI 30 | 31 | 32 | class manage_db: 33 | def __init__(self): 34 | self.db = MongoClient(MONGO_DB_URI)["captcha"] 35 | self.chats = self.db["Chats"] 36 | 37 | def chat_in_db(self, chat_id): 38 | chat = self.chats.find_one({"chat_id": chat_id}) 39 | return chat 40 | 41 | def add_chat(self, chat_id, captcha): 42 | if self.chat_in_db(chat_id): 43 | return 404 44 | self.chats.insert_one({"chat_id": chat_id, "captcha": captcha}) 45 | return 200 46 | 47 | def delete_chat(self, chat_id): 48 | self.chats.delete_many({"chat_id": chat_id}) 49 | return True 50 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/fetchAPI.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | class HMrequest: 4 | def nekosGet(name): 5 | blacklist = ['https://cdn.nekos.life/blowjob/blowjob31.jpg', 'https://cdn.nekos.life/blowjob/blowjob32.jpg', 'https://cdn.nekos.life/lewdkemo/lewd_neko_v2_132.jpg', 'https://cdn.nekos.life/Random_hentai_gif/Random_hentai_gifNB_1039.gif'] 6 | json = requests.get(f"https://nekos.life/api/v2/img/{name}").json() 7 | if json["url"] in blacklist: 8 | return HMrequest.nekosGet(name) 9 | return json 10 | 11 | def nekoloveGet(name): 12 | return requests.get(f"https://nekos.life/api/v2/img/{name}").json() 13 | 14 | def nekobotGet(name): 15 | blacklist = ['https://i0.nekobot.xyz/0/2/9/1b50d3f619f1bafdf114a530a2570.jpg', 'https://cdn.nekobot.xyz/9/3/9/448bb2ff69b3457a82f32ecd31c06.jpg', 'https://i0.nekobot.xyz/4/9/3/3b6ccf0c081db887fbe38038af996.jpg', 'https://i0.nekobot.xyz/8/6/9/ee21a6ac7d06aabf0b71691e6dfb5.jpg', 'https://cdn.nekobot.xyz/b/4/d/c1fdf4234fbfba326fb282de9ef8c.jpg', 'https://cdn.nekobot.xyz/b/4/d/c1fdf4234fbfba326fb282de9ef8c.jpg'] 16 | req = requests.get(f"https://nekobot.xyz/api/image?type={name}") 17 | if not req.status_code == 200: 18 | return print('This endpoint don\'t work, or you got a Rate Limit') 19 | if req.json()["message"] in blacklist: 20 | return HMrequest.nekobotGet(name) 21 | return {"url": req.json()["message"]} 22 | 23 | def freakerGet(name): 24 | headers = { 25 | "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" 26 | } 27 | return requests.get(f"https://api.computerfreaker.cf/v2/{name}", headers=headers).json() 28 | 29 | -------------------------------------------------------------------------------- /Shikimori/modules/helper_funcs/regex_helper.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import regex 28 | 29 | def regex_searcher(regex_string, string): 30 | try: 31 | search = regex.search(regex_string, string, timeout=6) 32 | except TimeoutError: 33 | return False 34 | except Exception: 35 | return False 36 | return search 37 | 38 | 39 | def infinite_loop_check(regex_string): 40 | loop_matches = [ 41 | r"\((.{1,}[\+\*]){1,}\)[\+\*].", 42 | r"[\(\[].{1,}\{\d(,)?\}[\)\]]\{\d(,)?\}", 43 | r"\(.{1,}\)\{.{1,}(,)?\}\(.*\)(\+|\* |\{.*\})", 44 | ] 45 | for match in loop_matches: 46 | match_1 = regex.search(match, regex_string) 47 | if match_1: 48 | return True 49 | return False 50 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/images/slap.json: -------------------------------------------------------------------------------- 1 | [ 2 | "https: //cdn.discordapp.com/attachments/707201738255368194/847553281852702770/tenor_1.gif", 3 | "https://cdn.discordapp.com/attachments/707201738255368194/847553382339182642/tenor_2.gif", 4 | "https://cdn.discordapp.com/attachments/707201738255368194/847553413319098418/tenor_3.gif", 5 | "https://cdn.discordapp.com/attachments/707201738255368194/847553484949553202/tenor_4.gif", 6 | "https://cdn.discordapp.com/attachments/707201738255368194/847553521683529758/tenor_5.gif", 7 | "https://cdn.discordapp.com/attachments/707201738255368194/847553545632612443/tenor_6.gif", 8 | "https://cdn.discordapp.com/attachments/707201738255368194/847553662780047421/tenor_12.gif", 9 | "https://cdn.discordapp.com/attachments/707201738255368194/847553704320303124/tenor_13.gif", 10 | "https://cdn.discordapp.com/attachments/707201738255368194/847553781281062983/tenor_17.gif", 11 | "https://cdn.discordapp.com/attachments/707201738255368194/847553787615117342/tenor_14.gif", 12 | "https://cdn.discordapp.com/attachments/707201738255368194/847553837190479912/tenor_18.gif", 13 | "https://cdn.discordapp.com/attachments/707201738255368194/847553904606707752/tenor_19.gif", 14 | "https://cdn.discordapp.com/attachments/707201738255368194/847553934326759464/tenor_20.gif", 15 | "https://cdn.discordapp.com/attachments/707201738255368194/847554091256512542/tenor_26.gif", 16 | "https://cdn.discordapp.com/attachments/707201738255368194/847554139943731250/tenor_23.gif", 17 | "https://cdn.discordapp.com/attachments/707201738255368194/847554187612782692/tenor_22.gif", 18 | "https://cdn.discordapp.com/attachments/707201738255368194/847554219648352266/tenor_24.gif", 19 | "https://cdn.discordapp.com/attachments/707201738255368194/847554216645492755/tenor_25.gif" 20 | ] -------------------------------------------------------------------------------- /Shikimori/core/sections.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | 4 | Copyright (c) 2021 TheHamkerCat 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | """ 24 | 25 | n = "\n" 26 | w = " " 27 | 28 | bold = lambda x: f"**{x}:** " 29 | bold_ul = lambda x: f"**--{x}:**-- " 30 | 31 | mono = lambda x: f"`{x}`{n}" 32 | 33 | 34 | def section( 35 | title: str, 36 | body: dict, 37 | indent: int = 2, 38 | underline: bool = False, 39 | ) -> str: 40 | text = (bold_ul(title) + n) if underline else bold(title) + n 41 | 42 | for key, value in body.items(): 43 | text += ( 44 | indent * w 45 | + bold(key) 46 | + ((value[0] + n) if isinstance(value, list) else mono(value)) 47 | ) 48 | return text 49 | -------------------------------------------------------------------------------- /Shikimori/utils/logger.py: -------------------------------------------------------------------------------- 1 | # This file is part of Daisy (Telegram Bot) 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public License 14 | # along with this program. If not, see . 15 | 16 | import logging 17 | 18 | from loguru import logger 19 | 20 | 21 | class InterceptHandler(logging.Handler): 22 | LEVELS_MAP = { 23 | logging.CRITICAL: "CRITICAL", 24 | logging.ERROR: "ERROR", 25 | logging.WARNING: "WARNING", 26 | logging.INFO: "INFO", 27 | logging.DEBUG: "DEBUG", 28 | } 29 | 30 | def _get_level(self, record): 31 | return self.LEVELS_MAP.get(record.levelno, record.levelno) 32 | 33 | def emit(self, record): 34 | logger_opt = logger.opt( 35 | depth=6, exception=record.exc_info, ansi=True, lazy=True 36 | ) 37 | logger_opt.log(self._get_level(record), record.getMessage()) 38 | 39 | 40 | logging.basicConfig(handlers=[InterceptHandler()], level=logging.INFO) 41 | log = logging.getLogger(__name__) 42 | logger.add( 43 | "logs/bot.log", 44 | rotation="1 d", 45 | compression="tar.xz", 46 | backtrace=True, 47 | diagnose=True, 48 | level="INFO", 49 | ) 50 | log.info("Enabled logging intro bot_logs.txt file.") 51 | -------------------------------------------------------------------------------- /Shikimori/modules/sections.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | 4 | Copyright (c) 2021 TheHamkerCat 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | """ 24 | 25 | n = "\n" 26 | w = " " 27 | 28 | bold = lambda x: f"**{x}:** " 29 | bold_ul = lambda x: f"**--{x}:**-- " 30 | 31 | mono = lambda x: f"`{x}`{n}" 32 | 33 | 34 | def section( 35 | title: str, 36 | body: dict, 37 | indent: int = 2, 38 | underline: bool = False, 39 | ) -> str: 40 | text = (bold_ul(title) + n) if underline else bold(title) + n 41 | 42 | for key, value in body.items(): 43 | text += ( 44 | indent * w 45 | + bold(key) 46 | + ((value[0] + n) if isinstance(value, list) else mono(value)) 47 | ) 48 | return text 49 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/images/jahy.json: -------------------------------------------------------------------------------- 1 | [ 2 | "https://cdn.discordapp.com/attachments/707201738255368194/771368472752029696/jahy_jahy_sama_wa_kujikenai_drawn_by_konbu_wakame__eb4df739bfe1edaaf865228922f56a6b.jpg", 3 | "https://cdn.discordapp.com/attachments/707201738255368194/771368473904676925/jahy_jahy_sama_wa_kujikenai_drawn_by_konbu_wakame__ee7cce76258c028105c26761b4843a63.jpg", 4 | "https://cdn.discordapp.com/attachments/707201738255368194/771368476828762152/0002.jpg", 5 | "https://cdn.discordapp.com/attachments/707201738255368194/771368478896422942/0012.jpg", 6 | "https://cdn.discordapp.com/attachments/707201738255368194/771368479612993606/jahy_jahy_sama_wa_kujikenai_drawn_by_konbu_wakame__fcd38f5dd297b4b0c412014f12fc6570.jpg", 7 | "https://cdn.discordapp.com/attachments/707201738255368194/771368482616639538/EVN_1_hU8AUiZAh.jpg", 8 | "https://cdn.discordapp.com/attachments/707201738255368194/771368480821608478/33ffb315ccc5.jpg", 9 | "https://cdn.discordapp.com/attachments/707201738255368194/771368482872098886/Anime-Paint-Anime-Art-Anime-Konbu-Wakame-4111984.png", 10 | "https://cdn.discordapp.com/attachments/707201738255368194/771368484780113960/jahy-sama-wa-kujikenai-Jahy-Konbu-Wakame-Anime-Ero-4739457.jpeg", 11 | "https://cdn.discordapp.com/attachments/707201738255368194/771368524001837066/yande.re_523639_animal_ears_bikini_top_cleavage_jahy_jahy-sama_wa_kujikenai_konbu_wakame_swimsuits.jpg", 12 | "https://cdn.discordapp.com/attachments/707201738255368194/771369268801306634/jlYrWJH.jpg", 13 | "https://cdn.discordapp.com/attachments/707201738255368194/771369982926913556/XQkDWwNpCqc.jpg", 14 | "https://cdn.discordapp.com/attachments/707201738255368194/771369987704750111/Manga_Serialization_Announcement_Illustration.png", 15 | "https://cdn.discordapp.com/attachments/707201738255368194/772559222084730930/16f6a933241d87f1e2228f7424fe8e94.jpg" 16 | ] -------------------------------------------------------------------------------- /Shikimori/utils/pastebin.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | Copyright (c) 2021 TheHamkerCat 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | SOFTWARE. 19 | """ 20 | import socket 21 | from asyncio import get_running_loop 22 | from functools import partial 23 | 24 | 25 | def _netcat(host, port, content): 26 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 27 | s.connect((host, port)) 28 | s.sendall(content.encode()) 29 | s.shutdown(socket.SHUT_WR) 30 | while True: 31 | data = s.recv(4096).decode("utf-8").strip("\n\x00") 32 | if not data: 33 | break 34 | return data 35 | s.close() 36 | 37 | 38 | async def paste(content): 39 | loop = get_running_loop() 40 | link = await loop.run_in_executor( 41 | None, partial(_netcat, "ezup.dev", 9999, content) 42 | ) 43 | return link 44 | -------------------------------------------------------------------------------- /Shikimori/mongo.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import asyncio 28 | import sys 29 | 30 | from motor import motor_asyncio 31 | from Shikimori.vars import MONGO_DB_URI 32 | from pymongo import MongoClient 33 | from pymongo.errors import ServerSelectionTimeoutError 34 | from Shikimori.confing import get_int_key, get_str_key 35 | from Shikimori.utils.logger import log 36 | 37 | 38 | MONGO_PORT = get_int_key("27017") 39 | MONGO_DB_URI = get_str_key("MONGO_DB_URI") 40 | MONGO_DB = "Shikimori" 41 | 42 | 43 | client = MongoClient() 44 | client = MongoClient(MONGO_DB_URI, MONGO_PORT)[MONGO_DB] 45 | motor = motor_asyncio.AsyncIOMotorClient(MONGO_DB_URI, MONGO_PORT) 46 | db = motor[MONGO_DB] 47 | db = client["Shikimori"] 48 | try: 49 | asyncio.get_event_loop().run_until_complete(motor.server_info()) 50 | except ServerSelectionTimeoutError: 51 | sys.exit(log.critical("Can't connect to mongodb! Exiting...")) 52 | -------------------------------------------------------------------------------- /Shikimori/modules/anime_schedule.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | Ryu120 [https://github.com/Ryu120] 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from pyrogram import filters 28 | import requests 29 | from Shikimori import pbot 30 | 31 | @pbot.on_message(filters.command('latest')) 32 | def schedule(_, message): 33 | results = requests.get('https://subsplease.org/api/?f=schedule&h=true&tz=Japan').json() 34 | text = None 35 | for result in results['schedule']: 36 | title = result['title'] 37 | time = result['time'] 38 | aired = bool(result['aired']) 39 | title = f"**[{title}](https://subsplease.org/shows/{result['page']})**" if not aired else f"**~~[{title}](https://subsplease.org/shows/{result['page']})~~**" 40 | data = f"{title} - **{time}**" 41 | 42 | if text: 43 | text = f"{text}\n{data}" 44 | else: 45 | text = data 46 | 47 | message.reply_text(f"**Today's Schedule:**\nTime-Zone: Tokyo (GMT +9)\n\n{text}") 48 | 49 | 50 | __mod_name__ = "Schedule" 51 | 52 | __help__ = """ 53 | ❍ `/latest`: to see latest anime episode 54 | """ 55 | -------------------------------------------------------------------------------- /Shikimori/modules/helper_funcs/readable_time.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import time 28 | 29 | def get_readable_time(seconds: int) -> str: 30 | count = 0 31 | readable_time = "" 32 | time_list = [] 33 | time_suffix_list = ["s", "m", "h", "days"] 34 | 35 | while count < 4: 36 | count += 1 37 | if count < 3: 38 | remainder, result = divmod(seconds, 60) 39 | else: 40 | remainder, result = divmod(seconds, 24) 41 | if seconds == 0 and remainder == 0: 42 | break 43 | time_list.append(int(result)) 44 | seconds = int(remainder) 45 | 46 | for x in range(len(time_list)): 47 | time_list[x] = str(time_list[x]) + time_suffix_list[x] 48 | if len(time_list) == 4: 49 | readable_time += time_list.pop() + ", " 50 | 51 | time_list.reverse() 52 | readable_time += ":".join(time_list) 53 | 54 | return readable_time 55 | -------------------------------------------------------------------------------- /Shikimori/core/decorators/errors.py: -------------------------------------------------------------------------------- 1 | """ WRITTEN BY @pokurt, https://github.com/pokurt""" 2 | 3 | import sys 4 | import traceback 5 | from functools import wraps 6 | from Shikimori import pbot 7 | from Shikimori.vars import LOG_CHANNEL 8 | from pyrogram.errors.exceptions.forbidden_403 import ChatWriteForbidden 9 | 10 | def split_limits(text): 11 | if len(text) < 2048: 12 | return [text] 13 | 14 | lines = text.splitlines(True) 15 | small_msg = "" 16 | result = [] 17 | for line in lines: 18 | if len(small_msg) + len(line) < 2048: 19 | small_msg += line 20 | else: 21 | result.append(small_msg) 22 | small_msg = line 23 | else: 24 | result.append(small_msg) 25 | 26 | return result 27 | 28 | def capture_err(func): 29 | @wraps(func) 30 | async def capture(client, message, *args, **kwargs): 31 | try: 32 | return await func(client, message, *args, **kwargs) 33 | except ChatWriteForbidden: 34 | await pbot.leave_chat(message.chat.id) 35 | return 36 | except Exception as err: 37 | exc_type, exc_obj, exc_tb = sys.exc_info() 38 | errors = traceback.format_exception( 39 | etype=exc_type, 40 | value=exc_obj, 41 | tb=exc_tb, 42 | ) 43 | error_feedback = split_limits( 44 | "**ERROR** | `{}` | `{}`\n\n```{}```\n\n```{}```\n".format( 45 | 0 if not message.from_user else message.from_user.id, 46 | 0 if not message.chat else message.chat.id, 47 | message.text or message.caption, 48 | "".join(errors), 49 | ), 50 | ) 51 | for x in error_feedback: 52 | await pbot.send_message(LOG_CHANNEL, x) 53 | raise err 54 | 55 | return capture 56 | -------------------------------------------------------------------------------- /Shikimori/modules/antichannel.py: -------------------------------------------------------------------------------- 1 | from telegram.ext.filters import Filters 2 | from Shikimori.modules.helper_funcs.decorators import Shikimoricmd, Shikimorimsg 3 | from telegram import Update, message 4 | from telegram.ext import CallbackContext 5 | from ..modules.helper_funcs.anonymous import user_admin, AdminPerms 6 | import html 7 | from .mongo.antichannel_mongo import antichannel_status, disable_antichannel, enable_antichannel 8 | 9 | 10 | @Shikimoricmd(command="antichannel", group=100) 11 | @user_admin(AdminPerms.CAN_RESTRICT_MEMBERS) 12 | def set_antichannel(update: Update, context: CallbackContext): 13 | message = update.effective_message 14 | chat = update.effective_chat 15 | if chat.type == "private": 16 | return 17 | args = context.args 18 | if len(args) > 0: 19 | s = args[0].lower() 20 | if s in ["yes", "on"]: 21 | enable_antichannel(chat.id) 22 | message.reply_html("Enabled antichannel in {}".format(html.escape(chat.title))) 23 | elif s in ["off", "no"]: 24 | disable_antichannel(chat.id) 25 | message.reply_html("Disabled antichannel in {}".format(html.escape(chat.title))) 26 | else: 27 | message.reply_text("Unrecognized arguments {}".format(s)) 28 | return 29 | message.reply_html( 30 | "Antichannel setting is currently {} in {}".format(antichannel_status(chat.id), html.escape(chat.title))) 31 | 32 | 33 | @Shikimorimsg(Filters.chat_type.groups, group=110) 34 | def eliminate_channel(update: Update, context: CallbackContext): 35 | message = update.effective_message 36 | chat = update.effective_chat 37 | bot = context.bot 38 | if not antichannel_status(chat.id): 39 | return 40 | if message.sender_chat and message.sender_chat.type == "channel" and not message.is_automatic_forward: 41 | message.delete() 42 | sender_chat = message.sender_chat 43 | bot.ban_chat_sender_chat(sender_chat_id=sender_chat.id, chat_id=chat.id) 44 | -------------------------------------------------------------------------------- /Shikimori/utils/adminperms.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori import pbot as app 28 | 29 | 30 | async def member_permissions(chat_id: int, user_id: int): 31 | perms = [] 32 | member = await app.get_chat_member(chat_id, user_id) 33 | if member.can_post_messages: 34 | perms.append("can_post_messages") 35 | if member.can_edit_messages: 36 | perms.append("can_edit_messages") 37 | if member.can_delete_messages: 38 | perms.append("can_delete_messages") 39 | if member.can_restrict_members: 40 | perms.append("can_restrict_members") 41 | if member.can_promote_members: 42 | perms.append("can_promote_members") 43 | if member.can_change_info: 44 | perms.append("can_change_info") 45 | if member.can_invite_users: 46 | perms.append("can_invite_users") 47 | if member.can_pin_messages: 48 | perms.append("can_pin_messages") 49 | if member.can_manage_voice_chats: 50 | perms.append("can_manage_voice_chats") 51 | return perms 52 | -------------------------------------------------------------------------------- /Shikimori/modules/carbon.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | 4 | Copyright (c) 2021 TheHamkerCat 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | """ 24 | 25 | from pyrogram import filters 26 | 27 | from Shikimori import pbot 28 | from Shikimori.core.decorators.errors import capture_err 29 | from Shikimori.utils.functions import make_carbon 30 | 31 | 32 | @pbot.on_message(filters.command("carbon")) 33 | async def carbon_func(_, message): 34 | if not message.reply_to_message: 35 | return await message.reply_text( 36 | "Reply to a text message to make carbon." 37 | ) 38 | if not message.reply_to_message.text: 39 | return await message.reply_text( 40 | "Reply to a text message to make carbon." 41 | ) 42 | m = await message.reply_text("Preparing Carbon") 43 | carbon = await make_carbon(message.reply_to_message.text) 44 | await m.edit("Uploading") 45 | await pbot.send_photo(message.chat.id, carbon) 46 | await m.delete() 47 | carbon.close() 48 | -------------------------------------------------------------------------------- /Shikimori/modules/wish.py: -------------------------------------------------------------------------------- 1 | """ 2 | GNU General Public License v3.0 3 | 4 | Copyright (C) 2017-2019, Paul Larsen 5 | Copyright (C) 2021-2022, Awesome-RJ, [ https://github.com/Awesome-RJ ] 6 | Copyright (c) 2021-2022, Yūki • Black Knights Union, [ https://github.com/Awesome-RJ/CutiepiiRobot ] 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see . 20 | """ 21 | 22 | import random 23 | 24 | from Shikimori import DEV_USERS, OWNER_ID, telethn 25 | 26 | from telethon import events, Button 27 | from telegram import ParseMode 28 | 29 | BUTTON = [[Button.url("❓ What Is This", "https://t.me/Shikimori_bot_Updates/34")]] 30 | COMET = "https://telegra.ph/file/713fbfbdde25cc1726866.mp4" 31 | STAR = "https://telegra.ph/file/ad90b44c551cec31df76b.mp4" 32 | WISH = """ 33 | **You can use** `/wish` **as a general Wishing Well of sorts** 34 | **For example:** 35 | `/wish I could date you 😍,` **or** 36 | `/wish that sushi was 🍣 in /emojify, or 37 | /wish I had someone to /cuddle at night...` 38 | """ 39 | 40 | @telethn.on(events.NewMessage(pattern="/wish ?(.*)")) 41 | async def wish(e): 42 | quew = e.pattern_match.group(1) 43 | if e.sender_id != DEV_USERS and not quew: 44 | (await e.reply(WISH, parse_mode=ParseMode.MARKDOWN, buttons=BUTTON, file=STAR),) 45 | return 46 | if not e.is_reply: 47 | mm = random.randint(1,100) 48 | DREAM = f"**Your wish has been cast.✨**\n\n__chance of success {mm}%__" 49 | await e.reply(DREAM, buttons=BUTTON, file=COMET ) 50 | -------------------------------------------------------------------------------- /Shikimori/utils/errors.py: -------------------------------------------------------------------------------- 1 | """ WRITTEN BY @pokurt, https://github.com/pokurt""" 2 | # credits goes to William, https://github.com/WilliamButcherBot 3 | 4 | import sys 5 | import traceback 6 | from functools import wraps 7 | 8 | from pyrogram.errors.exceptions.forbidden_403 import ChatWriteForbidden 9 | from Shikimori.modules.helper_funcs.chat_status import dev_plus 10 | 11 | 12 | from Shikimori import LOGGER, pbot as app 13 | 14 | 15 | def split_limits(text): 16 | if len(text) < 2048: 17 | return [text] 18 | 19 | lines = text.splitlines(True) 20 | small_msg = "" 21 | result = [] 22 | for line in lines: 23 | if len(small_msg) + len(line) < 2048: 24 | small_msg += line 25 | else: 26 | result.append(small_msg) 27 | small_msg = line 28 | 29 | result.append(small_msg) 30 | 31 | return result 32 | 33 | @dev_plus 34 | def capture_err(func): 35 | @wraps(func) 36 | async def capture(client, message, *args, **kwargs): 37 | try: 38 | return await func(client, message, *args, **kwargs) 39 | except ChatWriteForbidden: 40 | await app.leave_chat(message.chat.id) 41 | return 42 | except Exception as err: 43 | exc_type, exc_obj, exc_tb = sys.exc_info() 44 | errors = traceback.format_exception( 45 | etype=exc_type, 46 | value=exc_obj, 47 | tb=exc_tb, 48 | ) 49 | error_feedback = split_limits( 50 | "**ERROR** | `{}` | `{}`\n\n```{}```\n\n```{}```\n".format( 51 | 0 if not message.from_user else message.from_user.id, 52 | 0 if not message.chat else message.chat.id, 53 | message.text or message.caption, 54 | "".join(errors), 55 | ), 56 | ) 57 | for x in error_feedback: 58 | await app.send_message(LOGGER, x) 59 | raise err 60 | 61 | return capture 62 | -------------------------------------------------------------------------------- /Shikimori/modules/animelinks.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | from Shikimori.imports.animedev import client as animedev_client, exceptions 25 | from Shikimori.events import register 26 | from Shikimori import telethn 27 | from Shikimori.vars import SUPPORT_CHAT 28 | from telethon import Button 29 | 30 | 31 | @register(pattern='/anilink') 32 | async def animelink(event): 33 | animename = event.message.message.split() 34 | if len(animename) <= 1: 35 | await event.reply('/anilink anime name') 36 | return 37 | try: 38 | anime = animedev_client.search(' '.join(animename[1:])) 39 | anime['Search_Query'] = anime['Search_Query'].replace(' ', '+') 40 | except exceptions.NotFound: 41 | await event.reply('Anime not found.') 42 | return 43 | except Exception as e: 44 | await event.reply(f'*Error*: Contact @{SUPPORT_CHAT}.\nERROR: {e}') 45 | return 46 | text = f''' 47 | Anime Title: {anime['AnimeTitle']} 48 | ''' 49 | button_list = [[Button.url('Download Link', anime['AnimeLink'])], [Button.url('Search Query', anime['Search_Query'])]] 50 | 51 | await telethn.send_file(event.chat_id, anime['AnimeImg'], caption=text, buttons=button_list, parse_mode='html', reply_to=event.id) 52 | 53 | 54 | -------------------------------------------------------------------------------- /Shikimori/modules/apod.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | from Shikimori import dispatcher 25 | from Shikimori.vars import APOD_API_KEY 26 | from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update, ParseMode 27 | from telegram.ext import ( 28 | CallbackContext, 29 | CommandHandler, 30 | ) 31 | import requests 32 | 33 | def apod(update: Update, context: CallbackContext): 34 | url = 'https://apod.nasa.gov/apod/' 35 | result = requests.get('https://api.nasa.gov/planetary/apod?api_key=' + APOD_API_KEY).json() 36 | img = result['hdurl'] 37 | title = result['title'] 38 | if result['copyright']: 39 | copyright = result['copyright'] 40 | text = f'Title: {title}\n\nCredits: {copyright}' 41 | else: 42 | text = f'Title: {title}' 43 | 44 | update.effective_message.reply_photo(img, caption=text, reply_markup=InlineKeyboardMarkup( 45 | [ 46 | [InlineKeyboardButton("More Info" , url=url)] 47 | 48 | ]), 49 | parse_mode=ParseMode.HTML) 50 | 51 | apod_handler = CommandHandler("apod", apod, run_async = True) 52 | dispatcher.add_handler(apod_handler) 53 | 54 | __mod_name__ = "NASA" 55 | 56 | __help__ = """ 57 | Use `/apod` to get Picture of the Day by NASA. 58 | """ 59 | -------------------------------------------------------------------------------- /Shikimori/modules/encrypt.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori import telethn as tbot 28 | from Shikimori.events import register 29 | import secureme 30 | 31 | 32 | @register(pattern="^/encrypt ?(.*)") 33 | async def hmm(event): 34 | if event.reply_to_msg_id: 35 | lel = await event.get_reply_message() 36 | cmd = lel.text 37 | else: 38 | cmd = event.pattern_match.group(1) 39 | Text = cmd 40 | k = secureme.encrypt(Text) 41 | await event.reply(k) 42 | 43 | 44 | @register(pattern="^/decrypt ?(.*)") 45 | async def hmm(event): 46 | if event.reply_to_msg_id: 47 | lel = await event.get_reply_message() 48 | ok = lel.text 49 | else: 50 | ok = event.pattern_match.group(1) 51 | Text = ok 52 | k = secureme.decrypt(Text) 53 | await event.reply(k) 54 | 55 | 56 | __mod_name__ = "Encryption" 57 | 58 | ___help__ = """ 59 | Here is help for Encryption 60 | 61 | Note: Only works for text. 62 | 63 | ❍ `/encrypt` - Reply to a text message to Encrypt it. 64 | ❍ `/decrypt` - Reply to a text message to Decrypt it. 65 | """ 66 | 67 | -------------------------------------------------------------------------------- /Shikimori/modules/watchorder.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import requests 28 | from Shikimori.events import register 29 | from Shikimori import telethn 30 | from Shikimori.vars import SUPPORT_CHAT 31 | from bs4 import BeautifulSoup 32 | 33 | @register(pattern='/watchorder') 34 | async def watchorder(event): 35 | animename = event.message.message.replace(event.text.split(' ')[0], '') 36 | if len(animename) <= 1: 37 | await event.reply('/watchorder anime name') 38 | return 39 | try: 40 | res = requests.get(f'https://chiaki.site/?/tools/autocomplete_series&term={animename}').json() 41 | data = None 42 | id_ = res[0]['id'] 43 | res_ = requests.get(f'https://chiaki.site/?/tools/watch_order/id/{id_}').text 44 | soup = BeautifulSoup(res_ , 'html.parser') 45 | anime_names = soup.find_all('span' , class_='wo_title') 46 | for x in anime_names: 47 | data = f"{data}\n{x.text}" if data else x.text 48 | await telethn.send_message(event.chat_id, f'Watchorder of {animename}: \n\n{data}',parse_mode='html', reply_to=event.id) 49 | except Exception as e: 50 | await event.reply(f'*Error*: Contact @{SUPPORT_CHAT}.\nERROR: {e}') 51 | return 52 | 53 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/images/nsfwMobileWallpaper.json: -------------------------------------------------------------------------------- 1 | [ 2 | "https://preview.redd.it/rna0fdwap2351.jpg?width=640&crop=smart&auto=webp&s=6ff496dbe4dfccd9497a62fa8889e346af878d0c", 3 | "https://preview.redd.it/o1ygf19i4x251.png?width=640&crop=smart&auto=webp&s=0baafd2fb61715bb9125d270a9fd37019ee2d5c5", 4 | "https://preview.redd.it/342tk4lp4x251.png?width=640&crop=smart&auto=webp&s=f41f747db8905cb9f696396605d46c8a6c77e298", 5 | "https://preview.redd.it/7e9wiykk1w251.jpg?width=640&crop=smart&auto=webp&s=095f0de28e6cc21bd58ea935ff5d61cac54d8871", 6 | "https://preview.redd.it/nojrjvjrlq251.jpg?width=640&crop=smart&auto=webp&s=9d05edcb46aabe5387eebad6d7827777a2c70abe", 7 | "https://preview.redd.it/1bq0nvbfip251.png?width=640&height=1137&crop=smart&auto=webp&s=9d964c449d481d1ec1002112811fcd6e5d952536", 8 | "https://preview.redd.it/4oluafjwip251.png?width=640&height=1137&crop=smart&auto=webp&s=2245953392387fc795f4568e09be2d6daa461edd", 9 | "https://preview.redd.it/sp2ce9u6jp251.png?width=640&crop=smart&auto=webp&s=e78b7f8130b7f24866997368f99018e16d16faaf", 10 | "https://preview.redd.it/ikrvzdbi4m251.jpg?width=640&crop=smart&auto=webp&s=fc3133149bcdc16254ed12ccbccf1806ba6728bd", 11 | "https://preview.redd.it/y5om6cwnpi251.png?width=640&crop=smart&auto=webp&s=bb9083f71da7e3827902396c9f83515a67b38d89", 12 | "https://preview.redd.it/rs80rxbspi251.png?width=640&height=1137&crop=smart&auto=webp&s=54379c9fc0655ffb82a32ba0028dd708d6decbc7", 13 | "https://cdn.discordapp.com/attachments/770948564947304448/771035043568156682/ZNo3wUfy0i8.jpg", 14 | "https://cdn.discordapp.com/attachments/707201738255368194/771376827688157184/4f6bznfcvlo41.png", 15 | "https://cdn.discordapp.com/attachments/707201738255368194/771377469748019250/2504031-ed-jim-izuku_midoriya-my_hero_academia-_01CF6YGT6YZBHEHPC3FBWAMHM1.png", 16 | "https://cdn.discordapp.com/attachments/707201738255368194/771377855863062528/Izumi.png", 17 | "https://cdn.discordapp.com/attachments/707201738255368194/771378443139940353/3qiliOo0.png", 18 | "https://cdn.discordapp.com/attachments/716326877488349275/772539304823750706/mRGStORGZw.jpg" 19 | ] -------------------------------------------------------------------------------- /Shikimori/modules/urbandictionary.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import requests 28 | from Shikimori import dispatcher 29 | from Shikimori.modules.disable import DisableAbleCommandHandler 30 | from telegram import ParseMode, Update 31 | from telegram.ext import CallbackContext 32 | 33 | 34 | 35 | def ud(update: Update, context: CallbackContext): 36 | message = update.effective_message 37 | args = context.args 38 | if len(args) == 0: 39 | return message.reply_text("/ud [word]") 40 | 41 | text = message.text[len('/ud '):] 42 | results = requests.get( 43 | f'https://api.urbandictionary.com/v0/define?term={text}').json() 44 | try: 45 | reply_text = f'*{text}*\n\n{results["list"][0]["definition"]}\n\n_{results["list"][0]["example"]}_' 46 | except: 47 | reply_text = "No results found." 48 | message.reply_text(reply_text, parse_mode=ParseMode.MARKDOWN) 49 | 50 | 51 | UD_HANDLER = DisableAbleCommandHandler(["ud"], ud, run_async=True) 52 | 53 | dispatcher.add_handler(UD_HANDLER) 54 | 55 | __command_list__ = ["ud"] 56 | __handlers__ = [UD_HANDLER] 57 | 58 | __mod_name__ = "Urban Dictionary" 59 | __help__ = """ 60 | *Urban Dictionary* 61 | ❍ `/ud` : Search for word in Urban Dictionary 62 | """ 63 | -------------------------------------------------------------------------------- /Shikimori/modules/animals.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | import requests 25 | import random 26 | import Shikimori.strings.animal_facts_string as animal_facts 27 | from Shikimori import dispatcher 28 | from telegram import Update 29 | from Shikimori.modules.disable import DisableAbleCommandHandler 30 | from telegram.ext import CallbackContext 31 | 32 | 33 | def animalfact(update: Update, context: CallbackContext): 34 | update.effective_message.reply_text(random.choice(animal_facts.ANIMAL_FACTS)) 35 | 36 | def cats(update, context): 37 | msg = update.effective_message 38 | try: 39 | url = f'https://aws.random.cat/meow' 40 | result = requests.get(url).json() 41 | img = result['file'] 42 | msg.reply_photo(photo=img) 43 | except: 44 | url = f'https://aws.random.cat/meow' 45 | result = requests.get(url).json() 46 | img = result['file'] 47 | msg.reply_photo(photo=img) 48 | 49 | ANIMALFACT_HANDLER = DisableAbleCommandHandler("animalfacts", animalfact, run_async=True) 50 | dispatcher.add_handler(ANIMALFACT_HANDLER) 51 | CAT_HANDLER = DisableAbleCommandHandler(("cats", "cat"), cats, run_async=True) 52 | dispatcher.add_handler(CAT_HANDLER) 53 | 54 | __mod_name__ = "Animals" 55 | __help__ = """ 56 | ➢ `/animalfacts` - To Get random animal facts. 57 | ➢ `/cats` - To Get Random Photo of Cats. 58 | ➢ `/goose`*:* Sends Random Goose pic. 59 | ➢ `/woof`*:* Sends Random Woof pic. 60 | ➢ `/lizard`*:* Sends Random Lizard GIFs. 61 | """ -------------------------------------------------------------------------------- /Shikimori/modules/sql/forceSubscribe_sql.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from sqlalchemy import Column, String, Numeric, Boolean 28 | from Shikimori.modules.sql import BASE, SESSION 29 | 30 | 31 | class forceSubscribe(BASE): 32 | __tablename__ = "forceSubscribe" 33 | chat_id = Column(Numeric, primary_key=True) 34 | channel = Column(String) 35 | 36 | def __init__(self, chat_id, channel): 37 | self.chat_id = chat_id 38 | self.channel = channel 39 | 40 | 41 | forceSubscribe.__table__.create(checkfirst=True) 42 | 43 | 44 | def fs_settings(chat_id): 45 | try: 46 | return ( 47 | SESSION.query(forceSubscribe) 48 | .filter(forceSubscribe.chat_id == chat_id) 49 | .one() 50 | ) 51 | except: 52 | return None 53 | finally: 54 | SESSION.close() 55 | 56 | 57 | def add_channel(chat_id, channel): 58 | adder = SESSION.query(forceSubscribe).get(chat_id) 59 | if adder: 60 | adder.channel = channel 61 | else: 62 | adder = forceSubscribe(chat_id, channel) 63 | SESSION.add(adder) 64 | SESSION.commit() 65 | 66 | 67 | def disapprove(chat_id): 68 | rem = SESSION.query(forceSubscribe).get(chat_id) 69 | if rem: 70 | SESSION.delete(rem) 71 | SESSION.commit() 72 | -------------------------------------------------------------------------------- /Shikimori/core/keyboard.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | 4 | Copyright (c) 2021 TheHamkerCat 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | """ 24 | from pykeyboard import InlineKeyboard 25 | from pyrogram.types import InlineKeyboardButton as Ikb 26 | 27 | from Shikimori.utils.functions import get_urls_from_text as is_url 28 | 29 | 30 | def keyboard(buttons_list, row_width: int = 2): 31 | """ 32 | Buttons builder, pass buttons in a list and it will 33 | return pyrogram.types.IKB object 34 | Ex: keyboard([["click here", "https://google.com"]]) 35 | if theres, a url, it will make url button, else callback button 36 | """ 37 | buttons = InlineKeyboard(row_width=row_width) 38 | data = [ 39 | ( 40 | Ikb(text=str(i[0]), callback_data=str(i[1])) 41 | if not is_url(i[1]) 42 | else Ikb(text=str(i[0]), url=str(i[1])) 43 | ) 44 | for i in buttons_list 45 | ] 46 | buttons.add(*data) 47 | return buttons 48 | 49 | 50 | def ikb(data: dict, row_width: int = 2): 51 | """ 52 | Converts a dict to pyrogram buttons 53 | Ex: dict_to_keyboard({"click here": "this is callback data"}) 54 | """ 55 | return keyboard(data.items(), row_width=row_width) 56 | -------------------------------------------------------------------------------- /Shikimori/modules/wallpaper.py: -------------------------------------------------------------------------------- 1 | from random import randint 2 | 3 | import requests as r 4 | from Shikimori import dispatcher 5 | from Shikimori.vars import SUPPORT_CHAT, WALL_API 6 | from Shikimori.modules.disable import DisableAbleCommandHandler 7 | from telegram import Update 8 | from telegram.ext import CallbackContext 9 | 10 | # Wallpapers module by @TheRealPhoenix using wall.alphacoders.com 11 | 12 | 13 | def wall(update: Update, context: CallbackContext): 14 | chat_id = update.effective_chat.id 15 | msg = update.effective_message 16 | args = context.args 17 | msg_id = update.effective_message.message_id 18 | bot = context.bot 19 | query = " ".join(args) 20 | if not query: 21 | msg.reply_text("Please enter a query!") 22 | return 23 | caption = query 24 | term = query.replace(" ", "%20") 25 | json_rep = r.get( 26 | f"https://wall.alphacoders.com/api2.0/get.php?auth={WALL_API}&method=search&term={term}", 27 | ).json() 28 | if not json_rep.get("success"): 29 | msg.reply_text(f"An error occurred! Report this @{SUPPORT_CHAT}") 30 | else: 31 | wallpapers = json_rep.get("wallpapers") 32 | if not wallpapers: 33 | msg.reply_text("No results found! Refine your search.") 34 | return 35 | index = randint(0, len(wallpapers) - 1) # Choose random index 36 | wallpaper = wallpapers[index] 37 | wallpaper = wallpaper.get("url_image") 38 | wallpaper = wallpaper.replace("\\", "") 39 | bot.send_photo( 40 | chat_id, 41 | photo=wallpaper, 42 | caption="Preview", 43 | reply_to_message_id=msg_id, 44 | timeout=60, 45 | ) 46 | bot.send_document( 47 | chat_id, 48 | document=wallpaper, 49 | filename="wallpaper", 50 | caption=caption, 51 | reply_to_message_id=msg_id, 52 | timeout=60, 53 | ) 54 | 55 | 56 | WALLPAPER_HANDLER = DisableAbleCommandHandler("wall", wall, run_async=True) 57 | dispatcher.add_handler(WALLPAPER_HANDLER) 58 | 59 | __mod_name__ = "Wallpaper" 60 | __help__ = """ 61 | *Wallpaper* 62 | ❍ `/wall` : Search for wallpaper of given query 63 | ❍ `/wallpaper` : Get a random wallpaper 64 | """ 65 | -------------------------------------------------------------------------------- /Shikimori/modules/helper_funcs/alternate.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from functools import wraps 28 | from telegram import error, ChatAction 29 | 30 | 31 | def send_message(message, text, *args, **kwargs): 32 | try: 33 | return message.reply_text(text, *args, **kwargs) 34 | except error.BadRequest as err: 35 | if str(err) == "Reply message not found": 36 | return message.reply_text(text, quote=False, *args, **kwargs) 37 | 38 | 39 | def typing_action(func): 40 | """Sends typing action while processing func command.""" 41 | 42 | @wraps(func) 43 | def command_func(update, context, *args, **kwargs): 44 | context.bot.send_chat_action( 45 | chat_id=update.effective_chat.id, action=ChatAction.TYPING 46 | ) 47 | return func(update, context, *args, **kwargs) 48 | 49 | return command_func 50 | 51 | 52 | def send_action(action): 53 | """Sends `action` while processing func command.""" 54 | 55 | def decorator(func): 56 | @wraps(func) 57 | def command_func(update, context, *args, **kwargs): 58 | context.bot.send_chat_action( 59 | chat_id=update.effective_chat.id, action=action 60 | ) 61 | return func(update, context, *args, **kwargs) 62 | 63 | return command_func 64 | 65 | return decorator 66 | -------------------------------------------------------------------------------- /Shikimori/modules/snipe.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from telegram import TelegramError 28 | from telegram import Update 29 | from telegram.ext import CommandHandler 30 | from telegram.ext.dispatcher import CallbackContext 31 | 32 | from Shikimori.modules.helper_funcs.filters import CustomFilters 33 | from Shikimori import dispatcher, LOGGER 34 | 35 | def snipe(update: Update, context: CallbackContext): 36 | args = context.args 37 | bot = context.bot 38 | try: 39 | chat_id = str(args[0]) 40 | del args[0] 41 | except TypeError: 42 | update.effective_message.reply_text( 43 | "Please give me a chat to echo to!") 44 | to_send = " ".join(args) 45 | if len(to_send) >= 2: 46 | try: 47 | bot.sendMessage(int(chat_id), str(to_send)) 48 | except TelegramError: 49 | LOGGER.warning("Couldn't send to group %s", str(chat_id)) 50 | update.effective_message.reply_text( 51 | "Couldn't send the message. Perhaps I'm not part of that group?") 52 | 53 | 54 | __help__ = """ 55 | *Dev only:* 56 | ❂ `/snipe` *:* Make me send a message to a specific chat. 57 | """ 58 | 59 | __mod_name__ = "Snipe" 60 | 61 | SNIPE_HANDLER = CommandHandler( 62 | "snipe", 63 | snipe, 64 | pass_args=True, 65 | filters=CustomFilters.dev_filter, run_async = True) 66 | 67 | dispatcher.add_handler(SNIPE_HANDLER) 68 | -------------------------------------------------------------------------------- /Shikimori/modules/games.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from pyrogram import filters 28 | from pyrogram.types import Message 29 | 30 | from Shikimori import pbot as app 31 | 32 | 33 | 34 | __mod_name__ = "Games 🎮" 35 | __help__ = """ 36 | Use these commands and try to score.\n\n 37 | ❍ `/dice` - Dice 🎲\n 38 | ❍ `/dart` - Dart 🎯\n 39 | ❍ `/basket` - Basket Ball 🏀\n 40 | ❍ `/bowling` - Bowling Ball 🎳\n 41 | ❍ `/football` - Football ⚽\n 42 | ❍ `/slot` - Spin slot machine 🎰 43 | """ 44 | 45 | @app.on_message(filters.command("dice")) 46 | async def throw_dice(client, message: Message): 47 | await client.send_dice(message.chat.id, "🎲") 48 | 49 | @app.on_message(filters.command("dart")) 50 | async def throw_dice(client, message: Message): 51 | await client.send_dice(message.chat.id, "🎯") 52 | 53 | @app.on_message(filters.command("basket")) 54 | async def throw_dice(client, message: Message): 55 | await client.send_dice(message.chat.id, "🏀") 56 | 57 | @app.on_message(filters.command("bowling")) 58 | async def throw_dice(client, message: Message): 59 | await client.send_dice(message.chat.id, "🎳") 60 | 61 | @app.on_message(filters.command("football")) 62 | async def throw_dice(client, message: Message): 63 | await client.send_dice(message.chat.id, "⚽") 64 | 65 | @app.on_message(filters.command("slot")) 66 | async def throw_dice(client, message: Message): 67 | await client.send_dice(message.chat.id, "🎰") 68 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Merit 2 | 3 | 1. The project creators, lead developers, core team, constitute 4 | the managing members of the project and have final say in every decision 5 | of the project, technical or otherwise, including overruling previous decisions. 6 | There are no limitations to this decisional power. 7 | 8 | 2. Contributions are an expected result of your membership on the project. 9 | Don't expect others to do your work or help you with your work forever. 10 | 11 | 3. All members have the same opportunities to seek any challenge they want 12 | within the project. 13 | 14 | 4. Authority or position in the project will be proportional 15 | to the accrued contribution. Seniority must be earned. 16 | 17 | 5. Software is evolutive: the better implementations must supersede lesser 18 | implementations. Technical advantage is the primary evaluation metric. 19 | 20 | 6. This is a space for technical prowess; topics outside of the project 21 | will not be tolerated. 22 | 23 | 7. Non technical conflicts will be discussed in a separate space. Disruption 24 | of the project will not be allowed. 25 | 26 | 8. Individual characteristics, including but not limited to, 27 | body, sex, sexual preference, race, language, religion, nationality, 28 | or political preferences are irrelevant in the scope of the project and 29 | will not be taken into account concerning your value or that of your contribution 30 | to the project. 31 | 32 | 9. Discuss or debate the idea, not the person. 33 | 34 | 10. There is no room for ambiguity: Ambiguity will be met with questioning; 35 | further ambiguity will be met with silence. It is the responsibility 36 | of the originator to provide requested context. 37 | 38 | 11. If something is illegal outside the scope of the project, it is illegal 39 | in the scope of the project. This Code of Merit does not take precedence over 40 | governing law. 41 | 42 | 12. This Code of Merit governs the technical procedures of the project not the 43 | activities outside of it. 44 | 45 | 13. Participation on the project equates to agreement of this Code of Merit. 46 | 47 | 14. No objectives beyond the stated objectives of this project are relevant 48 | to the project. Any intent to deviate the project from its original purpose 49 | of existence will constitute grounds for remedial action which may include 50 | expulsion from the project. 51 | 52 | This document is the Code of Merit (http://code-of-merit.org), version 1.0. 53 | -------------------------------------------------------------------------------- /Shikimori/modules/reddit.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | Copyright (c) 2021 TheHamkerCat 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | SOFTWARE. 19 | """ 20 | from pyrogram import filters 21 | 22 | from Shikimori import pbot as app, arq 23 | from Shikimori.utils.errors import capture_err 24 | 25 | __mod_name__ = "Reddit" 26 | 27 | 28 | 29 | @app.on_message(filters.command("reddit")) 30 | async def reddit(_, message): 31 | if len(message.command) != 2: 32 | return await message.reply_text("/reddit needs an argument") 33 | subreddit = message.text.split(None, 1)[1] 34 | m = await message.reply_text("Searching") 35 | reddit = await arq.reddit(subreddit) 36 | if not reddit.ok: 37 | return await m.edit_text(reddit.result) 38 | reddit = reddit.result 39 | nsfw = reddit.nsfw 40 | sreddit = reddit.subreddit 41 | title = reddit.title 42 | image = reddit.url 43 | link = reddit.postLink 44 | if nsfw: 45 | return await m.edit_text("NSFW RESULTS COULD NOT BE SHOWN.") 46 | 47 | caption = f""" 48 | **Title:** `{title}` 49 | **Subreddit:** {sreddit} 50 | **PostLink:** {link}""" 51 | try: 52 | await message.reply_photo(photo=image, caption=caption) 53 | await m.delete() 54 | except Exception as e: 55 | await m.edit_text(e.MESSAGE) 56 | 57 | __mod_name__ = "Reddit" 58 | __help__ = """ 59 | *Reddit* 60 | ❍ `/reddit` : Searches reddit 61 | """ 62 | -------------------------------------------------------------------------------- /Shikimori/modules/sql_2/rules_sql.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import threading 28 | 29 | from Shikimori.modules.sql_2 import BASE, SESSION 30 | from sqlalchemy import Column, String, UnicodeText, distinct, func 31 | 32 | 33 | class Rules(BASE): 34 | __tablename__ = "rules" 35 | chat_id = Column(String(14), primary_key=True) 36 | rules = Column(UnicodeText, default="") 37 | 38 | def __init__(self, chat_id): 39 | self.chat_id = chat_id 40 | 41 | def __repr__(self): 42 | return "".format(self.chat_id, self.rules) 43 | 44 | 45 | Rules.__table__.create(checkfirst=True) 46 | 47 | INSERTION_LOCK = threading.RLock() 48 | 49 | 50 | def set_rules(chat_id, rules_text): 51 | with INSERTION_LOCK: 52 | rules = SESSION.query(Rules).get(str(chat_id)) 53 | if not rules: 54 | rules = Rules(str(chat_id)) 55 | rules.rules = rules_text 56 | 57 | SESSION.add(rules) 58 | SESSION.commit() 59 | 60 | 61 | def get_rules(chat_id): 62 | rules = SESSION.query(Rules).get(str(chat_id)) 63 | ret = "" 64 | if rules: 65 | ret = rules.rules 66 | 67 | SESSION.close() 68 | return ret 69 | 70 | 71 | def num_chats(): 72 | try: 73 | return SESSION.query(func.count(distinct(Rules.chat_id))).scalar() 74 | finally: 75 | SESSION.close() 76 | 77 | 78 | def migrate_chat(old_chat_id, new_chat_id): 79 | with INSERTION_LOCK: 80 | chat = SESSION.query(Rules).get(str(old_chat_id)) 81 | if chat: 82 | chat.chat_id = str(new_chat_id) 83 | SESSION.commit() 84 | -------------------------------------------------------------------------------- /Shikimori/modules/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori import LOGGER 28 | from Shikimori.vars import LOAD, NO_LOAD 29 | import sys 30 | 31 | 32 | def __list_all_modules(): 33 | from os.path import dirname, basename, isfile 34 | import glob 35 | 36 | # This generates a list of modules in this folder for the * in __main__ to work. 37 | mod_paths = glob.glob(dirname(__file__) + "/*.py") 38 | all_modules = [ 39 | basename(f)[:-3] 40 | for f in mod_paths 41 | if isfile(f) and f.endswith(".py") and not f.endswith("__init__.py") 42 | ] 43 | 44 | if LOAD or NO_LOAD: 45 | to_load = LOAD 46 | if to_load: 47 | if not all( 48 | any(mod == module_name for module_name in all_modules) 49 | for mod in to_load 50 | ): 51 | LOGGER.error("[Shikimori] Invalid loadorder names. Quitting.") 52 | sys.exit(1) 53 | 54 | all_modules = sorted(set(all_modules) - set(to_load)) 55 | to_load = list(all_modules) + to_load 56 | 57 | else: 58 | to_load = all_modules 59 | 60 | if NO_LOAD: 61 | LOGGER.info("[Shikimori] Not loading: {}".format(NO_LOAD)) 62 | return [item for item in to_load if item not in NO_LOAD] 63 | 64 | return to_load 65 | 66 | return all_modules 67 | 68 | 69 | ALL_MODULES = __list_all_modules() 70 | LOGGER.info("[Shikimori] Modules to load: %s", str(ALL_MODULES)) 71 | __all__ = ALL_MODULES + ["ALL_MODULES"] 72 | -------------------------------------------------------------------------------- /Shikimori/modules/fakeit.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from faker import Faker 28 | from faker.providers import internet 29 | from telethon import events 30 | from Shikimori import telethn as tbot 31 | from pyrogram import filters 32 | from Shikimori import pbot 33 | 34 | @tbot.on(events.NewMessage(pattern="/fakegen$")) 35 | async def hi(event): 36 | fake = Faker() 37 | print("FAKE DETAILS GENERATED\n") 38 | name = str(fake.name()) 39 | fake.add_provider(internet) 40 | address = str(fake.address()) 41 | ip = fake.ipv4_private() 42 | cc = fake.credit_card_full() 43 | email = fake.ascii_free_email() 44 | job = fake.job() 45 | android = fake.android_platform_token() 46 | pc = fake.chrome() 47 | await event.reply( 48 | f" Fake Information Generated\nName :-{name}\n\nAddress:-{address}\n\nIP ADDRESS:-{ip}\n\ncredit card:-{cc}\n\nEmail Id:-{email}\n\nJob:-{job}\n\nandroid user agent:-{android}\n\nPc user agent:-{pc}", 49 | parse_mode="HTML", 50 | ) 51 | 52 | @pbot.on_message(filters.command('picgen')) 53 | async def picgen(_, message): 54 | img = "https://thispersondoesnotexist.com/image" 55 | text = f"Fake Image successfully generated." 56 | await message.reply_photo(photo=img, caption=text) 57 | 58 | 59 | 60 | 61 | __mod_name__ = "Fake info" 62 | 63 | __help__ = """ 64 | *Commands:* 65 | - `/fakegen` : Generates Fake Information 66 | - `/picgen` : Generate a Fake pic 67 | """ 68 | -------------------------------------------------------------------------------- /Shikimori/modules/ann.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | # Imports from external libraries. (DON'T EDIT) 25 | import requests 26 | from telegram import ParseMode 27 | from telegram.ext import CommandHandler 28 | 29 | # Imports dispatcher = updater.dispatcher from __init__.py (*MUST EDIT* CHANGE MODULE NAME TO THE FOLDER NAME OF MODULES IN YOUR BOT) 30 | from Shikimori import dispatcher 31 | 32 | # Main code, Credit to https://github.com/itspro-dev for making the API. 33 | def ann(update, context): 34 | try: 35 | msg = update.effective_message 36 | # API (DON'T EDIT) 37 | url = f'https://api.animeepisode.org/waifu/animenews.php' 38 | result = requests.get(url).json() 39 | img = result['Post_image'] 40 | # Message (EDIT THIS PART AS HTML *IF YOU WANT*) 41 | text = f''' 42 | Title : {result['Post_title']} 43 | 44 | Description : {result['Description']} 45 | 46 | For more info : {result['Post_url']} 47 | ''' 48 | msg.reply_photo(photo=img, caption=text, parse_mode=ParseMode.HTML) 49 | 50 | except Exception as e: 51 | text = f'Error: ' + e + '' 52 | msg.reply_text(text, parse_mode=ParseMode.HTML) 53 | 54 | # Code Handler (YOU CAN CHANGE 'ann' TO ANY 'cmd' FOR THIS TO BE WORKED AS '/cmd' *IF YOU WANT*.) 55 | ANN_HANDLER = CommandHandler('ann', ann, run_async=True) 56 | dispatcher.add_handler(ANN_HANDLER) 57 | 58 | # Buttons for /help . 59 | __mod_name__ = 'Anime News Network' # *IF YOU WANT* EDIT NAME OF BUTTON IN '/help' 60 | 61 | # *IF YOU WANT* EDIT MESSAGE FOR HELP OF THIS MODULE. 62 | __help__ = ''' 63 | ❍ `/ann` : Gives latest Anime news. 64 | ''' 65 | 66 | # DON'T EDIT 67 | __handlers__ = [ANN_HANDLER] -------------------------------------------------------------------------------- /Shikimori/modules/truth_and_dare.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | import random 25 | import Shikimori.strings.truth_and_dare_string as truth_and_dare_string 26 | from Shikimori import dispatcher 27 | from telegram import Update 28 | from Shikimori.modules.disable import DisableAbleCommandHandler 29 | from telegram.ext import CallbackContext 30 | 31 | def truth(update: Update, context: CallbackContext): 32 | args = context.args 33 | update.effective_message.reply_text(random.choice(truth_and_dare_string.TRUTH)) 34 | 35 | def dare(update: Update, context: CallbackContext): 36 | args = context.args 37 | update.effective_message.reply_text(random.choice(truth_and_dare_string.DARE)) 38 | 39 | def wyr(update: Update, context: CallbackContext): 40 | update.effective_message.reply_text(random.choice(truth_and_dare_string.WYR)) 41 | 42 | 43 | def tord(update: Update, context: CallbackContext): 44 | update.effective_message.reply_text(random.choice(truth_and_dare_string.TORD)) 45 | 46 | 47 | TRUTH_HANDLER = DisableAbleCommandHandler("truth", truth, run_async=True) 48 | DARE_HANDLER = DisableAbleCommandHandler("dare", dare, run_async=True) 49 | TORD_HANDLER = DisableAbleCommandHandler("tord", tord, run_async=True) 50 | WYR_HANDLER = DisableAbleCommandHandler(("rather", "wyr"), wyr, run_async=True) 51 | 52 | 53 | dispatcher.add_handler(TRUTH_HANDLER) 54 | dispatcher.add_handler(TORD_HANDLER) 55 | dispatcher.add_handler(WYR_HANDLER) 56 | dispatcher.add_handler(DARE_HANDLER) 57 | 58 | __mod_name__ = "Truth or Dare" 59 | __help__ = """ 60 | *Truth or Dare* 61 | ❍ `/truth` : Asks a question 62 | ❍ `/dare` : Tells a task to do 63 | ❍ `/tord` : Can either be a truth or dare 64 | ❍ `/rather` or `/wyr`: Would you rather? 65 | """ 66 | -------------------------------------------------------------------------------- /Shikimori/modules/covid.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import requests 28 | from telegram import ParseMode, Update 29 | from telegram.ext import CallbackContext 30 | 31 | from Shikimori import dispatcher 32 | from Shikimori.modules.disable import DisableAbleCommandHandler 33 | 34 | 35 | 36 | def covid(update: Update, context: CallbackContext): 37 | message = update.effective_message 38 | text = message.text.split(" ", 1) 39 | if len(text) == 1: 40 | r = requests.get("https://corona.lmao.ninja/v2/all").json() 41 | reply_text = f"**Global Totals** 🦠\nCases: {r['cases']:,}\nCases Today: {r['todayCases']:,}\nDeaths: {r['deaths']:,}\nDeaths Today: {r['todayDeaths']:,}\nRecovered: {r['recovered']:,}\nActive: {r['active']:,}\nCritical: {r['critical']:,}\nCases/Mil: {r['casesPerOneMillion']}\nDeaths/Mil: {r['deathsPerOneMillion']}" 42 | else: 43 | variabla = text[1] 44 | r = requests.get(f"https://corona.lmao.ninja/v2/countries/{variabla}").json() 45 | reply_text = f"**Cases for {r['country']} 🦠**\nCases: {r['cases']:,}\nCases Today: {r['todayCases']:,}\nDeaths: {r['deaths']:,}\nDeaths Today: {r['todayDeaths']:,}\nRecovered: {r['recovered']:,}\nActive: {r['active']:,}\nCritical: {r['critical']:,}\nCases/Mil: {r['casesPerOneMillion']}\nDeaths/Mil: {r['deathsPerOneMillion']}" 46 | message.reply_text(reply_text, parse_mode=ParseMode.MARKDOWN) 47 | 48 | 49 | COVID_HANDLER = DisableAbleCommandHandler(["covid", "corona"], covid, run_async = True) 50 | dispatcher.add_handler(COVID_HANDLER) 51 | 52 | __mod_name__ = "COVID 19 🦠" 53 | __help__ = """ 54 | *COVID 19* 55 | `/corona` - Gives information regarding covid 19 cases 56 | `/covid` - Gives information regarding covid 19 cases 57 | """ 58 | -------------------------------------------------------------------------------- /Shikimori/modules/helper_funcs/filters.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori import DEV_USERS, DRAGONS, DEMONS 28 | from telegram import Message 29 | from telegram.ext import MessageFilter 30 | 31 | 32 | class CustomFilters(object): 33 | class _Supporters(MessageFilter): 34 | def filter(self, message: Message): 35 | return bool(message.from_user and message.from_user.id in DEMONS) 36 | 37 | support_filter = _Supporters() 38 | 39 | class _Sudoers(MessageFilter): 40 | def filter(self, message: Message): 41 | return bool(message.from_user and message.from_user.id in DRAGONS) 42 | 43 | sudo_filter = _Sudoers() 44 | 45 | class _Developers(MessageFilter): 46 | def filter(self, message: Message): 47 | return bool(message.from_user and message.from_user.id in DEV_USERS) 48 | 49 | dev_filter = _Developers() 50 | 51 | class _MimeType(MessageFilter): 52 | def __init__(self, mimetype): 53 | self.mime_type = mimetype 54 | self.name = "CustomFilters.mime_type({})".format(self.mime_type) 55 | 56 | def filter(self, message: Message): 57 | return bool( 58 | message.document and message.document.mime_type == self.mime_type, 59 | ) 60 | 61 | mime_type = _MimeType 62 | 63 | class _HasText(MessageFilter): 64 | def filter(self, message: Message): 65 | return bool( 66 | message.text 67 | or message.sticker 68 | or message.photo 69 | or message.document 70 | or message.video, 71 | ) 72 | 73 | has_text = _HasText() 74 | -------------------------------------------------------------------------------- /Shikimori/core/filters.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | 4 | Copyright (c) 2021 TheHamkerCat 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | """ 24 | from pyrogram import filters as filters_ 25 | from pyrogram.types import Message 26 | 27 | from Shikimori import SUDOERS 28 | from Shikimori.vars import OWNER_ID 29 | from Shikimori.utils.functions import get_urls_from_text 30 | 31 | 32 | def url(_, __, message: Message) -> bool: 33 | # Can't use entities to check for url because 34 | # monospace removes url entity 35 | 36 | # TODO Fix detection of those urls which 37 | # doesn't have schema, ex-facebook.com 38 | 39 | text = message.text or message.caption 40 | if not text: 41 | return False 42 | return bool(get_urls_from_text(text)) 43 | 44 | 45 | def entities(_, __, message: Message) -> bool: 46 | return bool(message.entities) 47 | 48 | 49 | def anonymous(_, __, message: Message) -> bool: 50 | return bool(message.sender_chat) 51 | 52 | 53 | def sudoers(_, __, message: Message) -> bool: 54 | if not message.from_user: 55 | return False 56 | return message.from_user.id in SUDOERS 57 | 58 | 59 | def owner(_, __, message: Message) -> bool: 60 | if not message.from_user: 61 | return False 62 | return message.from_user.id == OWNER_ID 63 | 64 | 65 | class Filters: 66 | pass 67 | 68 | 69 | filters = Filters 70 | filters.url = filters_.create(url) 71 | filters.entities = filters_.create(entities) 72 | filters.anonymous = filters_.create(anonymous) 73 | filters.sudoers = filters_.create(sudoers) 74 | filters.owner = filters_.create(owner) 75 | -------------------------------------------------------------------------------- /Shikimori/modules/plet.py: -------------------------------------------------------------------------------- 1 | # thonkify initially made by @devrism for discord. ported to telegram bot api (and) improved by @rupansh 2 | 3 | import base64 4 | from io import BytesIO 5 | 6 | from PIL import Image 7 | from telegram import Update 8 | from telegram.ext import CallbackContext 9 | 10 | from Shikimori import dispatcher 11 | from Shikimori.modules.disable import DisableAbleCommandHandler 12 | from Shikimori.modules.thonkify_dict import thonkifydict 13 | 14 | 15 | def plet(update: Update, context: CallbackContext): 16 | message = update.effective_message 17 | if not message.reply_to_message: 18 | msg = message.text.split(None, 1)[1] 19 | else: 20 | msg = message.reply_to_message.text 21 | 22 | # the processed photo becomes too long and unreadable + the telegram doesn't support any longer dimensions + you have the lulz. 23 | if (len(msg)) > 39: 24 | message.reply_text("thonk yourself") 25 | return 26 | 27 | tracking = Image.open( 28 | BytesIO( 29 | base64.b64decode( 30 | "iVBORw0KGgoAAAANSUhEUgAAAAYAAAOACAYAAAAZzQIQAAAALElEQVR4nO3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAAAAAAAAAPwZV4AAAfA8WFIAAAAASUVORK5CYII=" 31 | ) 32 | ) 33 | ) # base64 encoded empty image(but longer) 34 | 35 | for character in msg: 36 | if character not in thonkifydict: 37 | msg = msg.replace(character, "") 38 | 39 | x = 0 40 | y = 896 41 | image = Image.new("RGBA", [x, y], (0, 0, 0)) 42 | for character in msg: 43 | value = thonkifydict.get(character) 44 | addedimg = Image.new( 45 | "RGBA", [x + value.size[0] + tracking.size[0], y], (0, 0, 0) 46 | ) 47 | addedimg.paste(image, [0, 0]) 48 | addedimg.paste(tracking, [x, 0]) 49 | addedimg.paste(value, [x + tracking.size[0], 0]) 50 | image = addedimg 51 | x = x + value.size[0] + tracking.size[0] 52 | 53 | maxsize = 1024, 896 54 | if image.size[0] > maxsize[0]: 55 | image.thumbnail(maxsize, Image.ANTIALIAS) 56 | 57 | # put processed image in a buffer and then upload cause async 58 | with BytesIO() as buffer: 59 | buffer.name = "image.png" 60 | image.save(buffer, "PNG") 61 | buffer.seek(0) 62 | context.bot.send_sticker(chat_id=message.chat_id, sticker=buffer) 63 | 64 | 65 | PLET_HANDLER = DisableAbleCommandHandler("plet", plet, run_async= True) 66 | 67 | dispatcher.add_handler(PLET_HANDLER) 68 | 69 | __help__ = """ 70 | `/plet` : Creates a sticker with your Sending message 71 | """ 72 | 73 | __mod_name__ = "Text To Sticker🌈" 74 | __command_list__ = [ 75 | "plet" 76 | ] 77 | __handlers__ = [PLET_HANDLER] 78 | 79 | -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/images/lick.json: -------------------------------------------------------------------------------- 1 | [ 2 | "https://cdn.discordapp.com/attachments/707201738255368194/847555405491601509/tenor_1.gif", 3 | "https://cdn.discordapp.com/attachments/707201738255368194/847555484999483402/tenor_2.gif", 4 | "https://cdn.discordapp.com/attachments/707201738255368194/847555550701944872/tenor_3.gif", 5 | "https://cdn.discordapp.com/attachments/707201738255368194/847555677870096434/tenor_5.gif", 6 | "https://cdn.discordapp.com/attachments/707201738255368194/847555688753659904/tenor_6.gif", 7 | "https://cdn.discordapp.com/attachments/707201738255368194/847555762028019732/tenor_9.gif", 8 | "https://cdn.discordapp.com/attachments/707201738255368194/847555780180836382/tenor_8.gif", 9 | "https://cdn.discordapp.com/attachments/707201738255368194/847555852722634772/tenor_10.gif", 10 | "https://cdn.discordapp.com/attachments/707201738255368194/847555870564810792/tenor_15.gif", 11 | "https://cdn.discordapp.com/attachments/707201738255368194/847555889698570240/tenor_12.gif", 12 | "https://cdn.discordapp.com/attachments/707201738255368194/847555894438002739/tenor_11.gif", 13 | "https://cdn.discordapp.com/attachments/707201738255368194/847555910541115422/tenor_16.gif", 14 | "https://cdn.discordapp.com/attachments/707201738255368194/847555989846360134/tenor_17.gif", 15 | "https://cdn.discordapp.com/attachments/707201738255368194/847556005093048320/tenor_18.gif", 16 | "https://cdn.discordapp.com/attachments/707201738255368194/847556052567851008/tenor_21.gif", 17 | "https://cdn.discordapp.com/attachments/707201738255368194/847556054711664700/tenor_25.gif", 18 | "https://cdn.discordapp.com/attachments/707201738255368194/847556056586518558/tenor_19.gif", 19 | "https://cdn.discordapp.com/attachments/707201738255368194/847556122558726144/tenor_27.gif", 20 | "https://cdn.discordapp.com/attachments/707201738255368194/847556171547803738/tenor_28.gif", 21 | "https://cdn.discordapp.com/attachments/707201738255368194/847556224459210772/tenor_30.gif", 22 | "https://cdn.discordapp.com/attachments/707201738255368194/847556251977252904/tenor_32.gif", 23 | "https://cdn.discordapp.com/attachments/707201738255368194/847556291962601512/tenor_36.gif", 24 | "https://cdn.discordapp.com/attachments/707201738255368194/847556296072888340/tenor_34.gif", 25 | "https://cdn.discordapp.com/attachments/707201738255368194/847556362690101291/tenor_38.gif", 26 | "https://cdn.discordapp.com/attachments/707201738255368194/847556364125732864/tenor_39.gif", 27 | "https://cdn.discordapp.com/attachments/707201738255368194/847556494509342720/tenor_42.gif", 28 | "https://cdn.discordapp.com/attachments/707201738255368194/847556532458487818/tenor_43.gif" 29 | ] -------------------------------------------------------------------------------- /Shikimori/modules/cricketscore.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import urllib.request 28 | 29 | from bs4 import BeautifulSoup 30 | from telethon import events 31 | from Shikimori import telethn as tbot 32 | from telethon.tl import functions, types 33 | from telethon.tl.types import * 34 | 35 | 36 | async def is_register_admin(chat, user): 37 | if isinstance(chat, (types.InputPeerChannel, types.InputChannel)): 38 | return isinstance( 39 | ( 40 | await tbot(functions.channels.GetParticipantRequest(chat, user)) 41 | ).participant, 42 | (types.ChannelParticipantAdmin, types.ChannelParticipantCreator), 43 | ) 44 | if isinstance(chat, types.InputPeerUser): 45 | return True 46 | 47 | 48 | @tbot.on(events.NewMessage(pattern="/(c|cs)$")) 49 | async def _(event): 50 | if event.fwd_from: 51 | return 52 | if event.is_group: 53 | if not (await is_register_admin(event.input_chat, event.message.sender_id)): 54 | await event.reply("🚨 Need Admin Pewer.. You can't use this command.. But you can use in my pm") 55 | return 56 | 57 | score_page = "http://static.cricinfo.com/rss/livescores.xml" 58 | page = urllib.request.urlopen(score_page) 59 | soup = BeautifulSoup(page, "html.parser") 60 | result = soup.find_all("description") 61 | Sed = "" 62 | for match in result: 63 | Sed += match.get_text() + "\n\n" 64 | await event.reply( 65 | f"Match information gathered successful\n\n\n{Sed}", 66 | parse_mode="HTML", 67 | ) 68 | 69 | __mod_name__ = "Cricket Score 🏏" 70 | __help__ = """ 71 | *Cricket Score* 72 | ❍ `/c` : To check live cricket score 73 | ❍ `/cs` : To check live cricket score 74 | """ 75 | -------------------------------------------------------------------------------- /Shikimori/imports/emoji_pip/unicode_codes/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from Shikimori.imports.emoji_pip.unicode_codes.data_dict import * 4 | 5 | 6 | __all__ = [ 7 | 'EMOJI_UNICODE', 'UNICODE_EMOJI', 8 | 'EMOJI_UNICODE_ENGLISH', 'UNICODE_EMOJI_ENGLISH', 9 | 'EMOJI_ALIAS_UNICODE_ENGLISH', 'UNICODE_EMOJI_ALIAS_ENGLISH', 10 | 'EMOJI_UNICODE_SPANISH', 'UNICODE_EMOJI_SPANISH', 11 | 'EMOJI_UNICODE_PORTUGUESE', 'UNICODE_EMOJI_PORTUGUESE', 12 | 'EMOJI_UNICODE_ITALIAN', 'UNICODE_EMOJI_ITALIAN', 13 | 'EMOJI_UNICODE_FRENCH', 'UNICODE_EMOJI_FRENCH', 14 | 'EMOJI_UNICODE_GERMAN', 'UNICODE_EMOJI_GERMAN', 15 | 'EMOJI_DATA', 'STATUS' 16 | ] 17 | 18 | 19 | def get_emoji_unicode_dict(lang): 20 | """ Get the EMOJI_UNICODE_{language} dict containing all fully-qualified and component emoji""" 21 | return {data[lang]: emj for emj, data in EMOJI_DATA.items() if lang in data and data['status'] <= STATUS['fully_qualified']} 22 | 23 | 24 | def get_unicode_emoji_dict(lang): 25 | """ Get the UNICODE_EMOJI_{language} dict containing all emoji that have a name in {lang}""" 26 | return {emj: data[lang] for emj, data in EMOJI_DATA.items() if lang in data} 27 | 28 | 29 | EMOJI_UNICODE_ENGLISH = get_emoji_unicode_dict('en') 30 | UNICODE_EMOJI_ENGLISH = get_unicode_emoji_dict('en') 31 | 32 | EMOJI_ALIAS_UNICODE_ENGLISH = dict(EMOJI_UNICODE_ENGLISH.items()) 33 | for emj, data in EMOJI_DATA.items(): 34 | if 'alias' in data and data['status'] <= STATUS['fully_qualified']: 35 | for alias in data['alias']: 36 | EMOJI_ALIAS_UNICODE_ENGLISH[alias] = emj 37 | UNICODE_EMOJI_ALIAS_ENGLISH = {v: k for k, v in EMOJI_ALIAS_UNICODE_ENGLISH.items()} 38 | 39 | EMOJI_UNICODE_GERMAN = get_emoji_unicode_dict('de') 40 | UNICODE_EMOJI_GERMAN = get_unicode_emoji_dict('de') 41 | 42 | EMOJI_UNICODE_SPANISH = get_emoji_unicode_dict('es') 43 | UNICODE_EMOJI_SPANISH = get_unicode_emoji_dict('es') 44 | 45 | EMOJI_UNICODE_FRENCH = get_emoji_unicode_dict('fr') 46 | UNICODE_EMOJI_FRENCH = get_unicode_emoji_dict('fr') 47 | 48 | EMOJI_UNICODE_ITALIAN = get_emoji_unicode_dict('it') 49 | UNICODE_EMOJI_ITALIAN = get_unicode_emoji_dict('it') 50 | 51 | EMOJI_UNICODE_PORTUGUESE = get_emoji_unicode_dict('pt') 52 | UNICODE_EMOJI_PORTUGUESE = get_unicode_emoji_dict('pt') 53 | 54 | EMOJI_UNICODE = { 55 | 'en': EMOJI_UNICODE_ENGLISH, 56 | 'es': EMOJI_UNICODE_SPANISH, 57 | 'pt': EMOJI_UNICODE_PORTUGUESE, 58 | 'it': EMOJI_UNICODE_ITALIAN, 59 | 'fr': EMOJI_UNICODE_FRENCH, 60 | 'de': EMOJI_UNICODE_GERMAN, 61 | } 62 | 63 | UNICODE_EMOJI = { 64 | 'en': UNICODE_EMOJI_ENGLISH, 65 | 'es': UNICODE_EMOJI_SPANISH, 66 | 'pt': UNICODE_EMOJI_PORTUGUESE, 67 | 'it': UNICODE_EMOJI_ITALIAN, 68 | 'fr': UNICODE_EMOJI_FRENCH, 69 | 'de': UNICODE_EMOJI_GERMAN, 70 | } 71 | -------------------------------------------------------------------------------- /Shikimori/modules/helper_funcs/admin_status.py: -------------------------------------------------------------------------------- 1 | 2 | from enum import Enum 3 | import functools 4 | 5 | from telegram import Update, ParseMode 6 | from telegram.ext import CallbackContext 7 | from telegram.inline.inlinekeyboardbutton import InlineKeyboardButton 8 | from telegram.inline.inlinekeyboardmarkup import InlineKeyboardMarkup 9 | 10 | from Shikimori import DEV_USERS, DRAGONS, dispatcher 11 | 12 | class AdminPerms(Enum): 13 | CAN_RESTRICT_MEMBERS = 'can_restrict_members' 14 | CAN_PROMOTE_MEMBERS = 'can_promote_members' 15 | CAN_INVITE_USERS = 'can_invite_users' 16 | CAN_DELETE_MESSAGES = 'can_delete_messages' 17 | CAN_CHANGE_INFO = 'can_change_info' 18 | CAN_PIN_MESSAGES = 'can_pin_messages' 19 | 20 | 21 | class ChatStatus(Enum): 22 | CREATOR = "creator" 23 | ADMIN = "administrator" 24 | 25 | 26 | anon_callbacks = {} 27 | anon_callback_messages = {} 28 | 29 | 30 | def user_admin(permission: AdminPerms): 31 | def wrapper(func): 32 | @functools.wraps(func) 33 | def awrapper(update: Update, context: CallbackContext, *args, **kwargs): 34 | nonlocal permission 35 | if update.effective_chat.type == 'private': 36 | return func(update, context, *args, **kwargs) 37 | message = update.effective_message 38 | is_anon = bool(update.effective_message.sender_chat) 39 | 40 | if is_anon: 41 | callback_id = f'anoncb/{message.chat.id}/{message.message_id}/{permission.value}' 42 | anon_callbacks[(message.chat.id, message.message_id)] = ((update, context), func) 43 | anon_callback_messages[(message.chat.id, message.message_id)] = ( 44 | message.reply_text("Seems like you're anonymous, click the button below to prove your identity", 45 | reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text='Prove identity', 46 | callback_data=callback_id)]]))).message_id 47 | # send message with callback f'anoncb{callback_id}' 48 | else: 49 | user_id = message.from_user.id 50 | chat_id = message.chat.id 51 | mem = context.bot.get_chat_member(chat_id=chat_id, user_id=user_id) 52 | if getattr(mem, permission.value) is True or mem.status == "creator" or user_id in DRAGONS: 53 | return func(update, context, *args, **kwargs) 54 | else: 55 | return message.reply_text(f"You lack the permission: `{permission.name}`", 56 | parse_mode=ParseMode.MARKDOWN) 57 | 58 | return awrapper 59 | 60 | return wrapper 61 | 62 | -------------------------------------------------------------------------------- /Shikimori/modules/shell.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import subprocess 28 | 29 | from Shikimori import LOGGER, dispatcher 30 | from Shikimori.modules.helper_funcs.chat_status import dev_plus 31 | from telegram import ParseMode, Update 32 | from telegram.ext import CallbackContext, CommandHandler 33 | 34 | @dev_plus 35 | def shell(update: Update, context: CallbackContext): 36 | message = update.effective_message 37 | cmd = message.text.split(" ", 1) 38 | if len(cmd) == 1: 39 | message.reply_text("No command to execute was given.") 40 | return 41 | cmd = cmd[1] 42 | process = subprocess.Popen( 43 | cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True 44 | ) 45 | stdout, stderr = process.communicate() 46 | reply = "" 47 | stderr = stderr.decode() 48 | stdout = stdout.decode() 49 | if stdout: 50 | reply += f"*Stdout*\n`{stdout}`\n" 51 | LOGGER.info(f"Shell - {cmd} - {stdout}") 52 | if stderr: 53 | reply += f"*Stderr*\n`{stderr}`\n" 54 | LOGGER.error(f"Shell - {cmd} - {stderr}") 55 | if len(reply) > 3000: 56 | with open("shell_output.txt", "w") as file: 57 | file.write(reply) 58 | with open("shell_output.txt", "rb") as doc: 59 | context.bot.send_document( 60 | document=doc, 61 | filename=doc.name, 62 | reply_to_message_id=message.message_id, 63 | chat_id=message.chat_id, 64 | ) 65 | else: 66 | message.reply_text(reply, parse_mode=ParseMode.MARKDOWN) 67 | 68 | 69 | SHELL_HANDLER = CommandHandler(["sh", "shell"], shell, run_async=True) 70 | dispatcher.add_handler(SHELL_HANDLER) 71 | __mod_name__ = "Shell" 72 | __command_list__ = ["sh"] 73 | __handlers__ = [SHELL_HANDLER] 74 | -------------------------------------------------------------------------------- /Shikimori/modules/sql_2/approve_sql.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import threading 28 | from sqlalchemy import Column, String, UnicodeText, func, distinct 29 | from Shikimori.modules.sql_2 import BASE, SESSION 30 | from sqlalchemy.sql.sqltypes import BigInteger 31 | 32 | class Approvals(BASE): 33 | __tablename__ = "approval" 34 | chat_id = Column(String(14), primary_key=True) 35 | user_id = Column(BigInteger, primary_key=True) 36 | 37 | def __init__(self, chat_id, user_id): 38 | self.chat_id = str(chat_id) # ensure string 39 | self.user_id = user_id 40 | 41 | def __repr__(self): 42 | return "" % self.user_id 43 | 44 | 45 | Approvals.__table__.create(checkfirst=True) 46 | 47 | APPROVE_INSERTION_LOCK = threading.RLock() 48 | 49 | 50 | def approve(chat_id, user_id): 51 | with APPROVE_INSERTION_LOCK: 52 | approve_user = Approvals(str(chat_id), user_id) 53 | SESSION.add(approve_user) 54 | SESSION.commit() 55 | 56 | 57 | def is_approved(chat_id, user_id): 58 | try: 59 | return SESSION.query(Approvals).get((str(chat_id), user_id)) 60 | finally: 61 | SESSION.close() 62 | 63 | 64 | def disapprove(chat_id, user_id): 65 | with APPROVE_INSERTION_LOCK: 66 | disapprove_user = SESSION.query(Approvals).get((str(chat_id), user_id)) 67 | if disapprove_user: 68 | SESSION.delete(disapprove_user) 69 | SESSION.commit() 70 | return True 71 | else: 72 | SESSION.close() 73 | return False 74 | 75 | 76 | def list_approved(chat_id): 77 | try: 78 | return ( 79 | SESSION.query(Approvals) 80 | .filter(Approvals.chat_id == str(chat_id)) 81 | .order_by(Approvals.user_id.asc()) 82 | .all() 83 | ) 84 | finally: 85 | SESSION.close() 86 | -------------------------------------------------------------------------------- /Shikimori/utils/http.py: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | Copyright (c) 2021 TheHamkerCat 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | SOFTWARE. 19 | """ 20 | from asyncio import gather 21 | 22 | from Shikimori import aiohttpsession as session 23 | 24 | 25 | async def get(url: str, *args, **kwargs): 26 | async with session.get(url, *args, **kwargs) as resp: 27 | try: 28 | data = await resp.json() 29 | except Exception: 30 | data = await resp.text() 31 | return data 32 | 33 | 34 | async def head(url: str, *args, **kwargs): 35 | async with session.head(url, *args, **kwargs) as resp: 36 | try: 37 | data = await resp.json() 38 | except Exception: 39 | data = await resp.text() 40 | return data 41 | 42 | 43 | async def post(url: str, *args, **kwargs): 44 | async with session.post(url, *args, **kwargs) as resp: 45 | try: 46 | data = await resp.json() 47 | except Exception: 48 | data = await resp.text() 49 | return data 50 | 51 | 52 | async def multiget(url: str, times: int, *args, **kwargs): 53 | return await gather(*[get(url, *args, **kwargs) for _ in range(times)]) 54 | 55 | 56 | async def multihead(url: str, times: int, *args, **kwargs): 57 | return await gather(*[head(url, *args, **kwargs) for _ in range(times)]) 58 | 59 | 60 | async def multipost(url: str, times: int, *args, **kwargs): 61 | return await gather(*[post(url, *args, **kwargs) for _ in range(times)]) 62 | 63 | 64 | async def resp_get(url: str, *args, **kwargs): 65 | return await session.get(url, *args, **kwargs) 66 | 67 | 68 | async def resp_post(url: str, *args, **kwargs): 69 | return await session.post(url, *args, **kwargs) 70 | -------------------------------------------------------------------------------- /Shikimori/modules/crypto.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori.core.sections import section 28 | import requests 29 | from Shikimori import dispatcher 30 | from telegram.ext import CommandHandler, CallbackContext 31 | from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, ParseMode 32 | 33 | def crypto(update: Update, context: CallbackContext): 34 | message = update.effective_message 35 | args = context.args 36 | if len(args) == 0: 37 | return message.reply_text("/crypto [currency]") 38 | 39 | currency = message.text.split(None, 1)[1].lower() 40 | 41 | buttons = [ 42 | [ 43 | InlineKeyboardButton(text = "Available Currencies", url ="https://plotcryptoprice.herokuapp.com"), 44 | ], 45 | ] 46 | 47 | try: 48 | url = f'https://x.wazirx.com/wazirx-falcon/api/v2.0/crypto_rates' 49 | result = requests.get(url).json() 50 | except Exception: 51 | return message.reply_text("[ERROR]: Something went wrong.") 52 | 53 | if currency not in result: 54 | return update.effective_message.reply_text( 55 | "[ERROR]: INVALID CURRENCY", 56 | reply_markup=InlineKeyboardMarkup(buttons) 57 | ) 58 | 59 | body = {i.upper(): j for i, j in result.get(currency).items()} 60 | 61 | text = section( 62 | "Current Crypto Rates For " + currency.upper(), 63 | body, 64 | ) 65 | update.effective_message.reply_text(text, reply_markup=InlineKeyboardMarkup(buttons), parse_mode=ParseMode.MARKDOWN) 66 | 67 | CRYPTO_HANDLER = CommandHandler("crypto", crypto, run_async=True) 68 | 69 | dispatcher.add_handler(CRYPTO_HANDLER) 70 | 71 | __handlers__ = [ 72 | CRYPTO_HANDLER 73 | ] 74 | 75 | 76 | __mod_name__ = "Crypto 🪙" 77 | __help__ = """ 78 | ➢ `/crypto` [currency] :Get Real Time value from currency given. 79 | """ -------------------------------------------------------------------------------- /Shikimori/modules/TTS.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import os 28 | 29 | from gtts import gTTS 30 | from gtts import gTTSError 31 | from telethon import * 32 | from telethon.tl.types import * 33 | 34 | from Shikimori import * 35 | 36 | from Shikimori import telethn as tbot 37 | from Shikimori.events import register 38 | 39 | 40 | @register(pattern="^/tts (.*)") 41 | async def _(event): 42 | if event.fwd_from: 43 | return 44 | input_str = event.pattern_match.group(1) 45 | reply_to_id = event.message.id 46 | if event.reply_to_msg_id: 47 | previous_message = await event.get_reply_message() 48 | text = previous_message.message 49 | lan = input_str 50 | elif "|" in input_str: 51 | lan, text = input_str.split("|") 52 | else: 53 | await event.reply( 54 | "Invalid Syntax\nFormat `/tts lang | text`\nFor eg: `/tts en | hello`" 55 | ) 56 | return 57 | text = text.strip() 58 | lan = lan.strip() 59 | try: 60 | tts = gTTS(text, tld="com", lang=lan) 61 | tts.save("k.mp3") 62 | except AssertionError: 63 | await event.reply( 64 | "The text is empty.\n" 65 | "Nothing left to speak after pre-precessing, " 66 | "tokenizing and cleaning." 67 | ) 68 | return 69 | except ValueError: 70 | await event.reply("Language is not supported.") 71 | return 72 | except RuntimeError: 73 | await event.reply("Error loading the languages dictionary.") 74 | return 75 | except gTTSError: 76 | await event.reply("Error in Google Text-to-Speech API request!") 77 | return 78 | with open("k.mp3", "r"): 79 | await tbot.send_file( 80 | event.chat_id, "k.mp3", voice_note=True, reply_to=reply_to_id 81 | ) 82 | os.remove("k.mp3") 83 | -------------------------------------------------------------------------------- /Shikimori/modules/tagall.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from Shikimori import telethn 28 | from Shikimori.events import register 29 | 30 | 31 | @register(pattern="^(/all|/mentionall|/tagall|/utag|@all|@mentionall|@tagall|@utag) ?(.*)") 32 | async def _(event): 33 | if not event.is_group: 34 | return 35 | if event.fwd_from: 36 | return 37 | mentions = "Tagged by an admin" 38 | chat = await event.get_input_chat() 39 | async for x in telethn.iter_participants(chat, 99999999): 40 | mentions += f" \n [{x.first_name}](tg://user?id={x.id})" 41 | if event.reply_to_msg_id: 42 | try: 43 | await event.send_message(event.chat_id, mentions, reply_to=event.reply_to_msg_id) 44 | except: 45 | await event.reply(mentions) 46 | await event.reply(mentions) 47 | 48 | __mod_name__ = "TagAll" 49 | __help__ = """ 50 | *Tag All* 51 | ❍ `/users` : Get txt file of all users in your group. 52 | ❍ `/all` : (reply to message or add another message) To mention all members in your group, without exception. 53 | ❍ `/tagall` : (reply to message or add another message) To mention all members in your group, without exception. 54 | ❍ `/utag` : (reply to message or add another message) To mention all members in your group, without exception. 55 | ❍ `/mentionall` : (reply to message or add another message) To mention all members in your group, without exception. 56 | ❍ `@all` : (reply to message or add another message) To mention all members in your group, without exception. 57 | ❍ `@tagall` : (reply to message or add another message) To mention all members in your group, without exception. 58 | ❍ `@utag` : (reply to message or add another message) To mention all members in your group, without exception. 59 | ❍ `@mentionall` : (reply to message or add another message) To mention all members in your group, without exception. 60 | """ 61 | -------------------------------------------------------------------------------- /Shikimori/modules/uchiha.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | from Shikimori import dispatcher 25 | from Shikimori.vars import NETWORK_USERNAME 26 | from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update, ParseMode 27 | 28 | from telegram.ext import ( 29 | CallbackContext, 30 | CommandHandler, 31 | ) 32 | 33 | PHOTO = "https://telegra.ph/file/7cb643db87efa3a111744.jpg" 34 | 35 | network_name = NETWORK_USERNAME.lower() 36 | 37 | if network_name == "uchihaxnetwork": 38 | def uchiha(update: Update, context: CallbackContext): 39 | 40 | TEXT = f""" 41 | ᴡᴇʟᴄᴏᴍᴇ ᴛᴏ [❟❛❟ 𝖀𝖈𝖍𝖎𝖍𝖆 ❟❛❟ 𝘕𝘌𝘛𝘞𝘖𝘙𝘒](https://t.me/UchihaXNetwork/70), 42 | 𝖀𝖈𝖍𝖎𝖍𝖆 𝙞𝙨 𝙖𝙣 𝙖𝙣𝙞𝙢𝙚 𝙗𝙖𝙨𝙚𝙙 𝘾𝙤𝙢𝙢𝙪𝙣𝙞𝙩𝙮 𝙬𝙞𝙩𝙝 𝙖 𝙢𝙤𝙩𝙞𝙫𝙚 𝙩𝙤 𝙨𝙥𝙧𝙚𝙖𝙙 𝙡𝙤𝙫𝙚 𝙖𝙣𝙙 𝙥𝙚𝙖𝙘𝙚 𝙖𝙧𝙤𝙪𝙣𝙙 𝙩𝙚𝙡𝙚𝙜𝙧𝙖𝙢. 𝙂𝙤 𝙩𝙝𝙧𝙤𝙪𝙜𝙝 𝙩𝙝𝙚 𝙘𝙝𝙖𝙣𝙣𝙚𝙡 𝙖𝙣𝙙 𝙟𝙤𝙞𝙣 𝙩𝙝𝙚 𝘾𝙤𝙢𝙢𝙪𝙣𝙞𝙩𝙮, 𝙞𝙛 𝙞𝙩 𝙙𝙧𝙖𝙬𝙨 𝙮𝙤𝙪𝙧 𝙖𝙩𝙩𝙚𝙣𝙩𝙞𝙤𝙣. 43 | """ 44 | 45 | update.effective_message.reply_photo( 46 | PHOTO, caption= TEXT, 47 | parse_mode=ParseMode.MARKDOWN, 48 | 49 | reply_markup=InlineKeyboardMarkup( 50 | [ 51 | [InlineKeyboardButton(text="❟❛❟ 𝖀𝖈𝖍𝖎𝖍𝖆 ❟❛❟ 𝙉𝙚𝙩𝙬𝙤𝙧𝙠", url="https://t.me/UchihaXNetwork/70")], 52 | [ 53 | InlineKeyboardButton(text="★彡[ᴜꜱᴇʀ ᴛᴀɢ]彡★", url="https://t.me/UchihaXNetwork/74"), 54 | InlineKeyboardButton(text="★彡[ᴏꜰꜰɪᴄɪᴀʟ ɢʀᴏᴜᴘ]彡★", url="https://t.me/Uchihashrine") 55 | ], 56 | ] 57 | ), 58 | ) 59 | 60 | 61 | uchiha_handler = CommandHandler(("uchiha", "network", "net"), uchiha, run_async = True) 62 | dispatcher.add_handler(uchiha_handler) 63 | 64 | __help__ = """ 65 | ──「❟❛❟ 𝖀𝖈𝖍𝖎𝖍𝖆 ❟❛❟ 𝘕𝘌𝘛𝘞𝘖𝘙𝘒」── 66 | 67 | ❂ /uchiha: Get information about our community! Using it in groups may create promotion so we don't support using it in groups.""" 68 | 69 | __mod_name__ = "❟❛❟ 𝖀𝖈𝖍𝖎𝖍𝖆 ❟❛❟" 70 | -------------------------------------------------------------------------------- /Shikimori/Extras/errors.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import sys 28 | import traceback 29 | from functools import wraps 30 | from pyrogram.errors.exceptions.forbidden_403 import ChatWriteForbidden 31 | from Shikimori import pbot as app 32 | from Shikimori.vars import LOG_CHANNEL 33 | 34 | 35 | def split_limits(text): 36 | if len(text) < 2048: 37 | return [text] 38 | 39 | lines = text.splitlines(True) 40 | small_msg = "" 41 | result = [] 42 | for line in lines: 43 | if len(small_msg) + len(line) < 2048: 44 | small_msg += line 45 | else: 46 | result.append(small_msg) 47 | small_msg = line 48 | else: 49 | result.append(small_msg) 50 | 51 | return result 52 | 53 | 54 | def capture_err(func): 55 | @wraps(func) 56 | async def capture(client, message, *args, **kwargs): 57 | try: 58 | return await func(client, message, *args, **kwargs) 59 | except ChatWriteForbidden: 60 | await app.leave_chat(message.chat.id) 61 | return 62 | except Exception as err: 63 | exc_type, exc_obj, exc_tb = sys.exc_info() 64 | errors = traceback.format_exception( 65 | etype=exc_type, 66 | value=exc_obj, 67 | tb=exc_tb, 68 | ) 69 | error_feedback = split_limits( 70 | "**ERROR** | `{}` | `{}`\n\n```{}```\n\n```{}```\n".format( 71 | 0 if not message.from_user else message.from_user.id, 72 | 0 if not message.chat else message.chat.id, 73 | message.text or message.caption, 74 | "".join(errors), 75 | ), 76 | ) 77 | for x in error_feedback: 78 | await app.send_message(LOG_CHANNEL, x) 79 | raise err 80 | 81 | return capture 82 | -------------------------------------------------------------------------------- /Shikimori/modules/debug.py: -------------------------------------------------------------------------------- 1 | import os 2 | import datetime 3 | import time 4 | 5 | from telethon import events 6 | from telegram import Update, ParseMode 7 | from telegram.ext import CallbackContext, CommandHandler 8 | from telegram.error import BadRequest 9 | 10 | from Shikimori import telethn, dispatcher 11 | from Shikimori.modules.helper_funcs.chat_status import dev_plus 12 | 13 | DEBUG_MODE = False 14 | 15 | @dev_plus 16 | def debug(update: Update, context: CallbackContext): 17 | global DEBUG_MODE 18 | args = update.effective_message.text.split(None, 1) 19 | message = update.effective_message 20 | print(DEBUG_MODE) 21 | if len(args) > 1: 22 | if args[1] in ("yes", "on"): 23 | DEBUG_MODE = True 24 | message.reply_text("Debug mode is now on.") 25 | elif args[1] in ("no", "off"): 26 | DEBUG_MODE = False 27 | message.reply_text("Debug mode is now off.") 28 | else: 29 | if DEBUG_MODE: 30 | message.reply_text("Debug mode is currently on.") 31 | else: 32 | message.reply_text("Debug mode is currently off.") 33 | 34 | 35 | @telethn.on(events.NewMessage(pattern="[/!].*")) 36 | async def i_do_nothing_yes(event): 37 | global DEBUG_MODE 38 | if DEBUG_MODE: 39 | print(f"-{event.from_id} ({event.chat_id}) : {event.text}") 40 | if os.path.exists("updates.txt"): 41 | with open("updates.txt", "r") as f: 42 | text = f.read() 43 | with open("updates.txt", "w+") as f: 44 | f.write(text + f"\n-{event.from_id} ({event.chat_id}) : {event.text}") 45 | else: 46 | with open("updates.txt", "w+") as f: 47 | f.write( 48 | f"- {event.from_id} ({event.chat_id}) : {event.text} | {datetime.datetime.now()}", 49 | ) 50 | 51 | support_chat = os.getenv("SUPPORT_CHAT") 52 | 53 | @dev_plus 54 | def logs(update: Update, context: CallbackContext): 55 | chat = update.effective_chat 56 | user = update.effective_user 57 | with open("bot_logs.txt", "rb") as f: 58 | context.bot.send_document(document=f, filename=f.name, chat_id=user.id) 59 | if chat.type != chat.PRIVATE: 60 | msg = update.effective_message 61 | hmm = msg.reply_text("`Logs sent. Check your pm.`", parse_mode=ParseMode.MARKDOWN) 62 | time.sleep(10) 63 | try: 64 | msg.delete() 65 | hmm.delete() 66 | except BadRequest: 67 | pass 68 | 69 | LOG_HANDLER = CommandHandler(("logs", "log"), logs, run_async=True) 70 | dispatcher.add_handler(LOG_HANDLER) 71 | 72 | DEBUG_HANDLER = CommandHandler("debug", debug, run_async=True) 73 | dispatcher.add_handler(DEBUG_HANDLER) 74 | 75 | __mod_name__ = "Debug" 76 | __command_list__ = ["debug"] 77 | __handlers__ = [DEBUG_HANDLER] 78 | -------------------------------------------------------------------------------- /Shikimori/modules/get_common_chats.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import os 28 | from time import sleep 29 | 30 | from Shikimori import DEV_USERS, dispatcher 31 | from Shikimori.modules.helper_funcs.extraction import extract_user 32 | from Shikimori.modules.sql.users_sql import get_user_com_chats 33 | from telegram import Update 34 | from telegram.error import BadRequest, RetryAfter, Unauthorized 35 | from telegram.ext import CallbackContext, CommandHandler, Filters 36 | 37 | def get_user_common_chats(update: Update, context: CallbackContext): 38 | bot, args = context.bot, context.args 39 | msg = update.effective_message 40 | user = extract_user(msg, args) 41 | if not user: 42 | msg.reply_text("I share no common chats with the void.") 43 | return 44 | common_list = get_user_com_chats(user) 45 | if not common_list: 46 | msg.reply_text("No common chats with this user!") 47 | return 48 | name = bot.get_chat(user).first_name 49 | text = f"Common chats with {name}\n" 50 | for chat in common_list: 51 | try: 52 | chat_name = bot.get_chat(chat).title 53 | chat_limk = bot.get_chat(chat).username 54 | sleep(0.3) 55 | text += f"• Name :- {chat_name} \n Username :- @{chat_limk} \n" 56 | except BadRequest: 57 | pass 58 | except Unauthorized: 59 | pass 60 | except RetryAfter as e: 61 | sleep(e.retry_after) 62 | 63 | if len(text) < 4096: 64 | msg.reply_text(text, parse_mode="HTML") 65 | else: 66 | with open("common_chats.txt", "w") as f: 67 | f.write(text) 68 | with open("common_chats.txt", "rb") as f: 69 | msg.reply_document(f) 70 | os.remove("common_chats.txt") 71 | 72 | 73 | COMMON_CHATS_HANDLER = CommandHandler( 74 | "getchats", get_user_common_chats, filters=Filters.user(DEV_USERS), run_async = True 75 | ) 76 | 77 | dispatcher.add_handler(COMMON_CHATS_HANDLER) 78 | -------------------------------------------------------------------------------- /Shikimori/modules/sql/blacklistusers_sql.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import threading 28 | 29 | from Shikimori.modules.sql import BASE, SESSION 30 | from sqlalchemy import Column, String, UnicodeText 31 | 32 | 33 | class BlacklistUsers(BASE): 34 | __tablename__ = "blacklistusers" 35 | user_id = Column(String(14), primary_key=True) 36 | reason = Column(UnicodeText) 37 | 38 | def __init__(self, user_id, reason=None): 39 | self.user_id = user_id 40 | self.reason = reason 41 | 42 | 43 | BlacklistUsers.__table__.create(checkfirst=True) 44 | 45 | BLACKLIST_LOCK = threading.RLock() 46 | BLACKLIST_USERS = set() 47 | 48 | 49 | def blacklist_user(user_id, reason=None): 50 | with BLACKLIST_LOCK: 51 | user = SESSION.query(BlacklistUsers).get(str(user_id)) 52 | if not user: 53 | user = BlacklistUsers(str(user_id), reason) 54 | else: 55 | user.reason = reason 56 | 57 | SESSION.add(user) 58 | SESSION.commit() 59 | __load_blacklist_userid_list() 60 | 61 | 62 | def unblacklist_user(user_id): 63 | with BLACKLIST_LOCK: 64 | user = SESSION.query(BlacklistUsers).get(str(user_id)) 65 | if user: 66 | SESSION.delete(user) 67 | 68 | SESSION.commit() 69 | __load_blacklist_userid_list() 70 | 71 | 72 | def get_reason(user_id): 73 | user = SESSION.query(BlacklistUsers).get(str(user_id)) 74 | rep = "" 75 | if user: 76 | rep = user.reason 77 | 78 | SESSION.close() 79 | return rep 80 | 81 | 82 | def is_user_blacklisted(user_id): 83 | return user_id in BLACKLIST_USERS 84 | 85 | 86 | def __load_blacklist_userid_list(): 87 | global BLACKLIST_USERS 88 | try: 89 | BLACKLIST_USERS = {int(x.user_id) for x in SESSION.query(BlacklistUsers).all()} 90 | finally: 91 | SESSION.close() 92 | 93 | 94 | __load_blacklist_userid_list() 95 | -------------------------------------------------------------------------------- /Shikimori/imports/emoji_pip/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | 3 | 4 | """ 5 | emoji for Python 6 | ~~~~~~~~~~~~~~~~ 7 | 8 | emoji terminal output for Python. 9 | 10 | >>> import emoji 11 | >>> print(emoji.emojize('Python is :thumbsup:', use_aliases=True)) 12 | Python is 👍 13 | >> print(emoji.emojize('Python is :thumbs_up:')) 14 | Python is 👍 15 | """ 16 | 17 | 18 | from Shikimori.imports.emoji_pip.core import * 19 | from Shikimori.imports.emoji_pip.unicode_codes import * 20 | 21 | __all__ = [ 22 | # emoji.core 23 | 'emojize', 'demojize', 'get_emoji_regexp', 'emoji_count', 'emoji_lis', 24 | 'replace_emoji', 'version', 25 | # emoji.unicode_codes 26 | 'EMOJI_UNICODE_ENGLISH', 'EMOJI_UNICODE_SPANISH', 'EMOJI_UNICODE_PORTUGUESE', 27 | 'EMOJI_UNICODE_ITALIAN', 'EMOJI_UNICODE_FRENCH', 'EMOJI_UNICODE_GERMAN', 28 | 'UNICODE_EMOJI_ENGLISH', 'UNICODE_EMOJI_SPANISH', 'UNICODE_EMOJI_PORTUGUESE', 29 | 'UNICODE_EMOJI_ITALIAN', 'UNICODE_EMOJI_FRENCH', 'UNICODE_EMOJI_GERMAN', 30 | 'EMOJI_ALIAS_UNICODE_ENGLISH', 'UNICODE_EMOJI_ALIAS_ENGLISH', 'EMOJI_DATA', 31 | ] 32 | 33 | __version__ = '1.6.3' 34 | __author__ = 'Taehoon Kim, Kevin Wurster and Tahir Jalilov' 35 | __email__ = 'carpedm20@gmail.com' 36 | # and wursterk@gmail.com, tahir.jalilov@gmail.com 37 | __source__ = 'https://github.com/carpedm20/emoji/' 38 | __license__ = ''' 39 | New BSD License 40 | 41 | Copyright (c) 2014-2021, Taehoon Kim, Kevin Wurster and Tahir Jalilov 42 | All rights reserved. 43 | 44 | Redistribution and use in source and binary forms, with or without 45 | modification, are permitted provided that the following conditions are met: 46 | 47 | * Redistributions of source code must retain the above copyright notice, this 48 | list of conditions and the following disclaimer. 49 | 50 | * Redistributions in binary form must reproduce the above copyright notice, 51 | this list of conditions and the following disclaimer in the documentation 52 | and/or other materials provided with the distribution. 53 | 54 | * The names of its contributors may not be used to endorse or promote products 55 | derived from this software without specific prior written permission. 56 | 57 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 58 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 59 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 60 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 61 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 62 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 63 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 64 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 65 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 66 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 67 | ''' 68 | -------------------------------------------------------------------------------- /Shikimori/modules/waifu.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | """ 23 | 24 | # Created By: https://telegram.dog/SOME1_HING 25 | # Assisted By: https://telegram.dog/SastaDev from https://telegram.dog/SastaNetwork 26 | 27 | # Imports from external libraries. (DON'T EDIT) 28 | import requests 29 | from telegram import ParseMode 30 | from telegram.ext import CommandHandler 31 | 32 | import random 33 | # Imports dispatcher = updater.dispatcher from __init__.py (*MUST EDIT* CHANGE MODULE NAME TO THE FOLDER NAME OF MODULES IN YOUR BOT) 34 | from Shikimori import dispatcher 35 | 36 | # Main code, Credit to https://github.com/itspro-dev for making the API. 37 | 38 | def waifu(update, context): 39 | try: 40 | msg = update.effective_message 41 | # API (DON'T EDIT) 42 | url = f'https://api.animeepisode.org/waifu/' 43 | result = requests.get(url).json() 44 | img = result['Character_Image'] 45 | # Message (EDIT THIS PART AS HTML *IF YOU WANT*) 46 | text = f''' 47 | Name : {result['Character_Name']} 48 | 49 | Anime : {result['Anime_name']} 50 | ''' 51 | msg.reply_photo(photo=img, caption=text, parse_mode=ParseMode.HTML) 52 | 53 | except Exception as e: 54 | text = f'Error: ' + e + '' 55 | msg.reply_text(text, parse_mode=ParseMode.HTML) 56 | 57 | 58 | # Code Handler (YOU CAN CHANGE 'waifu' TO ANY 'cmd' FOR THIS TO BE WORKED AS '/cmd' *IF YOU WANT*.) 59 | WAIFUINFO_HANDLER = CommandHandler('waifuinfo', waifu, run_async=True) 60 | dispatcher.add_handler(WAIFUINFO_HANDLER) 61 | 62 | # Buttons for /help . 63 | __mod_name__ = 'Waifus' # *IF YOU WANT* EDIT NAME OF BUTTON IN '/help' 64 | 65 | 66 | # *IF YOU WANT* EDIT MESSAGE FOR HELP OF THIS MODULE. 67 | __help__ = ''' 68 | *Get waifu images* 69 | 70 | ➢ `/waifu`*:* Sends limited but best Waifu image. *RECOMMENDED* 71 | ➢ `/waifuinfo`*:* Gives random image of waifu with info. 72 | ➢ `/waifus`*:* Sends Random Waifu image. 73 | ➢ `/swaifu`*:* Sends Random Waifu image. 74 | 75 | *NSFW CONTENT* 76 | ➢ `/nsfwwaifu` 77 | ➢ `/nwaifu` 78 | ''' 79 | 80 | # DON'T EDIT 81 | __handlers__ = [WAIFUINFO_HANDLER] -------------------------------------------------------------------------------- /Shikimori/imports/youtube_search/__init__.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import urllib.parse 3 | import json 4 | 5 | 6 | class YoutubeSearch: 7 | def __init__(self, search_terms: str, max_results=None): 8 | self.search_terms = search_terms 9 | self.max_results = max_results 10 | self.videos = self._search() 11 | 12 | def _search(self): 13 | encoded_search = urllib.parse.quote_plus(self.search_terms) 14 | BASE_URL = "https://youtube.com" 15 | url = f"{BASE_URL}/results?search_query={encoded_search}" 16 | response = requests.get(url).text 17 | while "ytInitialData" not in response: 18 | response = requests.get(url).text 19 | results = self._parse_html(response) 20 | if self.max_results is not None and len(results) > self.max_results: 21 | return results[: self.max_results] 22 | return results 23 | 24 | def _parse_html(self, response): 25 | results = [] 26 | start = ( 27 | response.index("ytInitialData") 28 | + len("ytInitialData") 29 | + 3 30 | ) 31 | end = response.index("};", start) + 1 32 | json_str = response[start:end] 33 | data = json.loads(json_str) 34 | 35 | videos = data["contents"]["twoColumnSearchResultsRenderer"]["primaryContents"][ 36 | "sectionListRenderer" 37 | ]["contents"][0]["itemSectionRenderer"]["contents"] 38 | 39 | for video in videos: 40 | res = {} 41 | if "videoRenderer" in video.keys(): 42 | video_data = video.get("videoRenderer", {}) 43 | res["id"] = video_data.get("videoId", None) 44 | res["thumbnails"] = [thumb.get("url", None) for thumb in video_data.get("thumbnail", {}).get("thumbnails", [{}]) ] 45 | res["title"] = video_data.get("title", {}).get("runs", [[{}]])[0].get("text", None) 46 | res["long_desc"] = video_data.get("descriptionSnippet", {}).get("runs", [{}])[0].get("text", None) 47 | res["channel"] = video_data.get("longBylineText", {}).get("runs", [[{}]])[0].get("text", None) 48 | res["duration"] = video_data.get("lengthText", {}).get("simpleText", 0) 49 | res["views"] = video_data.get("viewCountText", {}).get("simpleText", 0) 50 | res["publish_time"] = video_data.get("publishedTimeText", {}).get("simpleText", 0) 51 | res["url_suffix"] = video_data.get("navigationEndpoint", {}).get("commandMetadata", {}).get("webCommandMetadata", {}).get("url", None) 52 | results.append(res) 53 | return results 54 | 55 | def to_dict(self, clear_cache=True): 56 | result = self.videos 57 | if clear_cache: 58 | self.videos = "" 59 | return result 60 | 61 | def to_json(self, clear_cache=True): 62 | result = json.dumps({"videos": self.videos}) 63 | if clear_cache: 64 | self.videos = "" 65 | return result 66 | -------------------------------------------------------------------------------- /Shikimori/modules/json.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | import io 28 | from Shikimori.events import register 29 | from Shikimori import telethn as tbot 30 | from telethon import types 31 | from telethon.tl import functions 32 | from telethon.tl.types import * 33 | 34 | 35 | async def is_register_admin(chat, user): 36 | if isinstance(chat, (types.InputPeerChannel, types.InputChannel)): 37 | return isinstance( 38 | ( 39 | await tbot(functions.channels.GetParticipantRequest(chat, user)) 40 | ).participant, 41 | (types.ChannelParticipantAdmin, types.ChannelParticipantCreator), 42 | ) 43 | if isinstance(chat, types.InputPeerUser): 44 | return True 45 | 46 | 47 | @register(pattern="^/json$") 48 | async def _(event): 49 | if event.fwd_from: 50 | return 51 | if event.is_group: 52 | if not (await is_register_admin(event.input_chat, event.message.sender_id)): 53 | await event.reply( 54 | "🚨 Need Admin Power.. You can't use this command.. But you can use in my pm" 55 | ) 56 | return 57 | 58 | the_real_message = None 59 | reply_to_id = None 60 | if event.reply_to_msg_id: 61 | previous_message = await event.get_reply_message() 62 | the_real_message = previous_message.stringify() 63 | reply_to_id = event.reply_to_msg_id 64 | else: 65 | the_real_message = event.stringify() 66 | reply_to_id = event.message.id 67 | if len(the_real_message) > 4095: 68 | with io.BytesIO(str.encode(the_real_message)) as out_file: 69 | out_file.name = "json.text" 70 | await tbot.send_file( 71 | event.chat_id, 72 | out_file, 73 | force_document=True, 74 | allow_cache=False, 75 | reply_to=reply_to_id, 76 | ) 77 | await event.delete() 78 | else: 79 | await event.reply("`{}`".format(the_real_message)) 80 | -------------------------------------------------------------------------------- /Shikimori/strings/animequotes_string.py: -------------------------------------------------------------------------------- 1 | QUOTES_IMG = ( 2 | "https://i.imgur.com/Iub4RYj.jpg", 3 | "https://i.imgur.com/uvNMdIl.jpg", 4 | "https://i.imgur.com/YOBOntg.jpg", 5 | "https://i.imgur.com/fFpO2ZQ.jpg", 6 | "https://i.imgur.com/f0xZceK.jpg", 7 | "https://i.imgur.com/RlVcCip.jpg", 8 | "https://i.imgur.com/CjpqLRF.jpg", 9 | "https://i.imgur.com/8BHZDk6.jpg", 10 | "https://i.imgur.com/8bHeMgy.jpg", 11 | "https://i.imgur.com/5K3lMvr.jpg", 12 | "https://i.imgur.com/NTzw4RN.jpg", 13 | "https://i.imgur.com/wJxryAn.jpg", 14 | "https://i.imgur.com/9L0DWzC.jpg", 15 | "https://i.imgur.com/sBe8TTs.jpg", 16 | "https://i.imgur.com/1Au8gdf.jpg", 17 | "https://i.imgur.com/28hFQeU.jpg", 18 | "https://i.imgur.com/Qvc03JY.jpg", 19 | "https://i.imgur.com/gSX6Xlf.jpg", 20 | "https://i.imgur.com/iP26Hwa.jpg", 21 | "https://i.imgur.com/uSsJoX8.jpg", 22 | "https://i.imgur.com/OvX3oHB.jpg", 23 | "https://i.imgur.com/JMWuksm.jpg", 24 | "https://i.imgur.com/lhM3fib.jpg", 25 | "https://i.imgur.com/64IYKkw.jpg", 26 | "https://i.imgur.com/nMbyA3J.jpg", 27 | "https://i.imgur.com/7KFQhY3.jpg", 28 | "https://i.imgur.com/mlKb7zt.jpg", 29 | "https://i.imgur.com/JCQGJVw.jpg", 30 | "https://i.imgur.com/hSFYDEz.jpg", 31 | "https://i.imgur.com/PQRjAgl.jpg", 32 | "https://i.imgur.com/ot9624U.jpg", 33 | "https://i.imgur.com/iXmqN9y.jpg", 34 | "https://i.imgur.com/RhNBeGr.jpg", 35 | "https://i.imgur.com/tcMVNa8.jpg", 36 | "https://i.imgur.com/LrVg810.jpg", 37 | "https://i.imgur.com/TcWfQlz.jpg", 38 | "https://i.imgur.com/muAUdvJ.jpg", 39 | "https://i.imgur.com/AtC7ZRV.jpg", 40 | "https://i.imgur.com/sCObQCQ.jpg", 41 | "https://i.imgur.com/AJFDI1r.jpg", 42 | "https://i.imgur.com/TCgmRrH.jpg", 43 | "https://i.imgur.com/LMdmhJU.jpg", 44 | "https://i.imgur.com/eyyax0N.jpg", 45 | "https://i.imgur.com/YtYxV66.jpg", 46 | "https://i.imgur.com/292w4ye.jpg", 47 | "https://i.imgur.com/6Fm1vdw.jpg", 48 | "https://i.imgur.com/2vnBOZd.jpg", 49 | "https://i.imgur.com/j5hI9Eb.jpg", 50 | "https://i.imgur.com/cAv7pJB.jpg", 51 | "https://i.imgur.com/jvI7Vil.jpg", 52 | "https://i.imgur.com/fANpjsg.jpg", 53 | "https://i.imgur.com/5o1SJyo.jpg", 54 | "https://i.imgur.com/dSVxmh8.jpg", 55 | "https://i.imgur.com/02dXlAD.jpg", 56 | "https://i.imgur.com/htvIoGY.jpg", 57 | "https://i.imgur.com/hy6BXOj.jpg", 58 | "https://i.imgur.com/OuwzNYu.jpg", 59 | "https://i.imgur.com/L8vwvc2.jpg", 60 | "https://i.imgur.com/3VMVF9y.jpg", 61 | "https://i.imgur.com/yzjq2n2.jpg", 62 | "https://i.imgur.com/0qK7TAN.jpg", 63 | "https://i.imgur.com/zvcxSOX.jpg", 64 | "https://i.imgur.com/FO7bApW.jpg", 65 | "https://i.imgur.com/KK06gwg.jpg", 66 | "https://i.imgur.com/6lG4tsO.jpg" 67 | 68 | ) -------------------------------------------------------------------------------- /Shikimori/imports/hmfull/src/images/depression.json: -------------------------------------------------------------------------------- 1 | [ 2 | "https://cdn.discordapp.com/attachments/876720644019060746/876720698289168384/23-43-45-sad-depressed.gif", 3 | "https://cdn.discordapp.com/attachments/876720644019060746/876720699799126086/23-44-01-anime-depressed.gif", 4 | "https://cdn.discordapp.com/attachments/876720644019060746/876720705192996864/23-44-11-anime-anime-sad.gif", 5 | "https://cdn.discordapp.com/attachments/876720644019060746/876720710163255306/23-44-21-emotional-cry.gif", 6 | "https://cdn.discordapp.com/attachments/876720644019060746/876720713581596692/23-44-26-sad-anime.gif", 7 | "https://cdn.discordapp.com/attachments/876720644019060746/876720715787825162/23-44-33-sad-depressed.gif", 8 | "https://cdn.discordapp.com/attachments/876720644019060746/876720718841249822/23-44-39-sad.gif", 9 | "https://cdn.discordapp.com/attachments/876720644019060746/876720723253657660/23-44-51-sad-but-true-im-hopeless.gif", 10 | "https://cdn.discordapp.com/attachments/876720644019060746/876720728710467605/23-44-54-depressed-rain.gif", 11 | "https://cdn.discordapp.com/attachments/876720644019060746/876720733139656755/23-45-15-depression-no-text.gif", 12 | "https://cdn.discordapp.com/attachments/876720644019060746/876720750134951956/23-45-44-anime-sad.gif", 13 | "https://cdn.discordapp.com/attachments/876720644019060746/876720756426440714/23-45-47-crying-anime.gif", 14 | "https://cdn.discordapp.com/attachments/876720644019060746/876720759920279592/23-45-54-sad.gif", 15 | "https://cdn.discordapp.com/attachments/876720644019060746/876720765754568714/23-46-15-anime-depressed.gif", 16 | "https://cdn.discordapp.com/attachments/876720644019060746/876720772566114334/23-46-28-isuzu-sento-bath.gif", 17 | "https://cdn.discordapp.com/attachments/876720644019060746/876720779759329280/23-47-01-alone-sad.gif", 18 | "https://cdn.discordapp.com/attachments/876720644019060746/876720786537332756/23-47-39-waiting-cold.gif", 19 | "https://cdn.discordapp.com/attachments/876720644019060746/876720791218167878/23-47-45-hyouka-houtaro-oreki.gif", 20 | "https://cdn.discordapp.com/attachments/876720644019060746/876720797362819072/23-47-53-triste-sad.gif", 21 | "https://cdn.discordapp.com/attachments/876720644019060746/876720802140151848/23-48-03-crying-raining.gif", 22 | "https://cdn.discordapp.com/attachments/876720644019060746/876720807735357440/23-48-20-anime-sad.gif", 23 | "https://cdn.discordapp.com/attachments/876720644019060746/876720812483301396/23-48-27-anime-anime-gif.gif", 24 | "https://cdn.discordapp.com/attachments/876720644019060746/876720816967004170/23-48-53-sad-depressed.gif", 25 | "https://cdn.discordapp.com/attachments/876720644019060746/876720821547204609/23-49-20-oop.gif", 26 | "https://cdn.discordapp.com/attachments/876720644019060746/876720830871126016/23-49-41-sad-aesthetic.gif", 27 | "https://cdn.discordapp.com/attachments/876720644019060746/876720837149982720/23-49-50-cropped-sad.gif", 28 | "https://cdn.discordapp.com/attachments/876720644019060746/876720844028657714/23-50-33-anime-sad.gif" 29 | ] -------------------------------------------------------------------------------- /Shikimori/modules/pfp.py: -------------------------------------------------------------------------------- 1 | """ 2 | STATUS: Code is working. ✅ 3 | """ 4 | 5 | """ 6 | GNU General Public License v3.0 7 | 8 | Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] 9 | 10 | Credits:- 11 | I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | """ 26 | 27 | from telethon import * 28 | from telethon.tl.functions.account import * 29 | from telethon.tl.functions.channels import * 30 | from telethon.tl.functions.photos import * 31 | from telethon.tl.types import * 32 | from Shikimori.events import register 33 | from Shikimori import telethn as borg 34 | from html import * 35 | import logging 36 | 37 | logger = logging.getLogger(__name__) 38 | 39 | 40 | 41 | if 1 == 1: 42 | name = "Profile Photos" 43 | client = borg 44 | 45 | @register(pattern=("/pfp")) 46 | async def PPScmd(event): 47 | # """Gets the profile photos of replied users, channels or chats""" 48 | try: 49 | id = "".join(event.raw_text.split(maxsplit=2)[1:]) 50 | user = await event.get_reply_message() 51 | if user: 52 | photos = await event.client.get_profile_photos(user.sender) 53 | else: 54 | photos = await event.client.get_profile_photos(event.chat_id) 55 | if id.strip() == "": 56 | try: 57 | await event.client.send_file(event.chat.id, photos) 58 | except a: 59 | photo = await event.client.download_profile_photo(event.chat_id) 60 | await borg.send_file(event.chat.id, photo) 61 | else: 62 | try: 63 | id = int(id) 64 | if id <= 0: 65 | await event.edit("ID number you entered is invalid") 66 | return 67 | except: 68 | await event.edit("ID number you entered is invalid") 69 | return 70 | if int(id) <= (len(photos)): 71 | send_photos = await event.client.download_media(photos[id - 1]) 72 | await borg.send_file(event.chat.id, send_photos) 73 | else: 74 | await event.edit("No photo found with that id") 75 | return 76 | except: 77 | await borg.send_message("Reply to user mate") 78 | --------------------------------------------------------------------------------