From 43e8dc3c822604db59876b32190ad27fe9054b26 Mon Sep 17 00:00:00 2001 From: SOME1HING Date: Thu, 14 Jul 2022 09:12:30 +0530 Subject: [PATCH] Stable release for Shikimori. --- Shikimori/Extras/ImageEditor/edit_1.py | 247 ---- Shikimori/Extras/ImageEditor/edit_2.py | 399 ------- Shikimori/Extras/ImageEditor/edit_3.py | 165 --- Shikimori/Extras/ImageEditor/edit_4.py | 412 ------- Shikimori/Extras/ImageEditor/edit_5.py | 424 ------- Shikimori/Extras/chatbot.py | 33 - Shikimori/Extras/dbfunctions.py | 36 + Shikimori/Extras/errors.py | 36 + Shikimori/__init__.py | 36 + Shikimori/__main__.py | 36 + Shikimori/confing.py | 36 + Shikimori/core/tasks.py | 36 + Shikimori/events.py | 36 + Shikimori/ex_plugins/dbfunctions.py | 36 + .../{modules => imports}/animedev/__init__.py | 0 .../animedev/exceptions.py | 0 Shikimori/modules/ExtraGifs.py | 36 + Shikimori/modules/TTS.py | 36 + Shikimori/modules/__init__.py | 36 + Shikimori/modules/about.py | 33 + Shikimori/modules/admin.py | 36 + Shikimori/modules/afk.py | 36 + Shikimori/modules/animelinks.py | 2 +- Shikimori/modules/anti_channel.py.txt | 48 - Shikimori/modules/antichannel.py | 73 -- Shikimori/modules/antinsfw.py | 206 ---- Shikimori/modules/antiservice.py | 60 - Shikimori/modules/apod.py | 33 + Shikimori/modules/approve.py | 36 + Shikimori/modules/arq.py | 97 +- Shikimori/modules/backups.py | 36 + Shikimori/modules/bans.py | 36 + Shikimori/modules/blacklist.py | 36 + Shikimori/modules/blacklist_stickers.py | 36 + Shikimori/modules/blacklistusers.py | 37 + Shikimori/modules/books.py | 36 + Shikimori/modules/cash.py | 36 + Shikimori/modules/chatbot.py | 2 + Shikimori/modules/cleaner.py | 36 + Shikimori/modules/connection.py | 36 + Shikimori/modules/country.py | 36 + Shikimori/modules/covid.py | 36 + Shikimori/modules/cricketscore.py | 36 + Shikimori/modules/crypto.py | 36 + Shikimori/modules/cust_filters.py | 36 + Shikimori/modules/dbcleanup.py | 149 --- Shikimori/modules/debug.py | 83 +- Shikimori/modules/dev.py | 36 + Shikimori/modules/disable.py | 36 + Shikimori/modules/disasters.py | 36 + Shikimori/modules/encrypt.py | 36 + Shikimori/modules/error_handler.py | 35 + Shikimori/modules/eval.py | 36 + Shikimori/modules/fakeit.py | 36 + Shikimori/modules/feds.py | 36 + Shikimori/modules/forcesubs.py | 36 + Shikimori/modules/games.py | 36 + Shikimori/modules/get_common_chats.py | 36 + Shikimori/modules/gettime.py | 36 + Shikimori/modules/global_bans.py | 36 + Shikimori/modules/gtranslator.py | 36 + Shikimori/modules/help.py | 33 + .../modules/helper_funcs/admin_rights.py | 36 + Shikimori/modules/helper_funcs/alternate.py | 36 + Shikimori/modules/helper_funcs/chat_status.py | 36 + Shikimori/modules/helper_funcs/decorators.py | 36 + Shikimori/modules/helper_funcs/extraction.py | 36 + Shikimori/modules/helper_funcs/filters.py | 36 + Shikimori/modules/helper_funcs/handlers.py | 36 + Shikimori/modules/helper_funcs/misc.py | 36 + Shikimori/modules/helper_funcs/msg_types.py | 36 + .../modules/helper_funcs/readable_time.py | 37 +- .../modules/helper_funcs/regex_helper.py | 37 +- .../modules/helper_funcs/string_handling.py | 36 + .../helper_funcs/telethn/chatstatus.py | 36 + Shikimori/modules/heroku.py | 232 ---- Shikimori/modules/imgeditor.py | 460 -------- Shikimori/modules/info.py | 36 + Shikimori/modules/inlinebot.py | 1000 ----------------- Shikimori/modules/json.py | 36 + Shikimori/modules/karma.py | 36 + Shikimori/modules/locks.py | 36 + Shikimori/modules/log_channel.py | 36 + Shikimori/modules/logomaker.py | 36 + Shikimori/modules/math.py | 132 --- Shikimori/modules/misc.py | 36 + Shikimori/modules/modules.py | 36 + Shikimori/modules/muting.py | 36 + Shikimori/modules/nightmode.py | 193 ---- Shikimori/modules/notes.py | 36 + Shikimori/modules/paste.py | 36 + Shikimori/modules/pfp.py | 36 + Shikimori/modules/phone.py | 98 -- Shikimori/modules/purge.py | 36 + Shikimori/modules/quotes.py | 36 + Shikimori/modules/reactions.py | 36 + Shikimori/modules/redis/afk_redis.py | 36 + Shikimori/modules/reporting.py | 36 + Shikimori/modules/reverse.py | 36 + Shikimori/modules/rss_feed.py | 36 + Shikimori/modules/rules.py | 36 + Shikimori/modules/send.py | 39 +- Shikimori/modules/shell.py | 36 + Shikimori/modules/shippering.py | 36 + Shikimori/modules/snipe.py | 35 + Shikimori/modules/speed_test.py | 36 + Shikimori/modules/sql/__init__.py | 36 + Shikimori/modules/sql/antichannel_sql.py | 95 -- Shikimori/modules/sql/antichannel_sql.py.txt | 65 -- Shikimori/modules/sql/antiflood_sql.py | 36 + Shikimori/modules/sql/approve_sql.py | 36 + Shikimori/modules/sql/blacklist_sql.py | 36 + Shikimori/modules/sql/blacklistusers_sql.py | 36 + Shikimori/modules/sql/blsticker_sql.py | 36 + Shikimori/modules/sql/chatbot_sql.py | 36 + Shikimori/modules/sql/cleaner_sql.py | 36 + Shikimori/modules/sql/connection_sql.py | 36 + Shikimori/modules/sql/cust_filters_sql.py | 36 + Shikimori/modules/sql/disable_sql.py | 36 + Shikimori/modules/sql/feds_sql.py | 36 + Shikimori/modules/sql/forceSubscribe_sql.py | 36 + Shikimori/modules/sql/global_bans_sql.py | 36 + Shikimori/modules/sql/locks_sql.py | 37 + Shikimori/modules/sql/log_channel_sql.py | 36 + Shikimori/modules/sql/logger_sql.py | 36 + Shikimori/modules/sql/night_mode_sql.py | 70 -- Shikimori/modules/sql/notes_sql.py | 37 + Shikimori/modules/sql/reporting_sql.py | 36 + Shikimori/modules/sql/rss_sql.py | 36 + Shikimori/modules/sql/rules_sql.py | 36 + Shikimori/modules/sql/userinfo_sql.py | 36 + Shikimori/modules/sql/users_sql.py | 36 + Shikimori/modules/sql/warns_sql.py | 36 + Shikimori/modules/sql/welcome_sql.py | 36 + Shikimori/modules/stickers.py | 36 + Shikimori/modules/styletext.py | 36 + Shikimori/modules/tagall.py | 36 + Shikimori/modules/telegraph.py | 36 + Shikimori/modules/term_and_eval.py | 36 + Shikimori/modules/tiny.py | 36 + Shikimori/modules/urbandictionary.py | 36 + Shikimori/modules/userinfo.py | 36 + Shikimori/modules/users.py | 36 + Shikimori/modules/waifu.py | 3 - Shikimori/modules/warns.py | 36 + Shikimori/modules/watchorder.py | 36 + Shikimori/modules/welcome.py | 36 + Shikimori/modules/whatanime.py | 36 + Shikimori/modules/whisper.py | 97 -- Shikimori/modules/wiki.py | 36 + Shikimori/modules/wish.py | 58 - Shikimori/modules/yts.py | 36 + Shikimori/modules/zip.py | 36 + Shikimori/modules/zombies.py | 36 + Shikimori/mongo.py | 36 + Shikimori/pyrogramee/dark.py | 36 + Shikimori/pyrogramee/errors.py | 36 + Shikimori/pyrogramee/pluginshelper.py | 36 + Shikimori/pyrogramee/pyrogram.py | 36 + Shikimori/pyrogramee/telethonbasics.py | 36 + Shikimori/utils/adminperms.py | 36 + Shikimori/utils/arqapi.py | 36 + Shikimori/utils/captcha_mongo.py | 36 + Shikimori/utils/inlinefuncs.py | 36 + Shikimori/utils/paste.py | 36 + Shikimori/utils/permissions.py | 36 + Shikimori/utils/pluginhelper.py | 36 + Shikimori/utils/uputils.py | 36 + 168 files changed, 5063 insertions(+), 4841 deletions(-) delete mode 100644 Shikimori/Extras/ImageEditor/edit_1.py delete mode 100644 Shikimori/Extras/ImageEditor/edit_2.py delete mode 100644 Shikimori/Extras/ImageEditor/edit_3.py delete mode 100644 Shikimori/Extras/ImageEditor/edit_4.py delete mode 100644 Shikimori/Extras/ImageEditor/edit_5.py delete mode 100644 Shikimori/Extras/chatbot.py rename Shikimori/{modules => imports}/animedev/__init__.py (100%) rename Shikimori/{modules => imports}/animedev/exceptions.py (100%) delete mode 100644 Shikimori/modules/anti_channel.py.txt delete mode 100644 Shikimori/modules/antichannel.py delete mode 100644 Shikimori/modules/antinsfw.py delete mode 100644 Shikimori/modules/antiservice.py delete mode 100644 Shikimori/modules/dbcleanup.py delete mode 100644 Shikimori/modules/heroku.py delete mode 100644 Shikimori/modules/imgeditor.py delete mode 100644 Shikimori/modules/inlinebot.py delete mode 100644 Shikimori/modules/math.py delete mode 100644 Shikimori/modules/nightmode.py delete mode 100644 Shikimori/modules/phone.py delete mode 100644 Shikimori/modules/sql/antichannel_sql.py delete mode 100644 Shikimori/modules/sql/antichannel_sql.py.txt delete mode 100644 Shikimori/modules/sql/night_mode_sql.py delete mode 100644 Shikimori/modules/whisper.py delete mode 100644 Shikimori/modules/wish.py diff --git a/Shikimori/Extras/ImageEditor/edit_1.py b/Shikimori/Extras/ImageEditor/edit_1.py deleted file mode 100644 index 2185c13d..00000000 --- a/Shikimori/Extras/ImageEditor/edit_1.py +++ /dev/null @@ -1,247 +0,0 @@ -# By @TroJanzHEX -import os -import shutil - -import cv2 -from PIL import Image, ImageEnhance, ImageFilter - - -async def bright(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "brightness.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - image = Image.open(a) - brightness = ImageEnhance.Brightness(image) - brightness.enhance(1.5).save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("bright-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def mix(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "mix.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - image = Image.open(a) - red, green, blue = image.split() - new_image = Image.merge("RGB", (green, red, blue)) - new_image.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("mix-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def black_white(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "black_white.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - image_file = cv2.imread(a) - grayImage = cv2.cvtColor(image_file, cv2.COLOR_BGR2GRAY) - cv2.imwrite(edit_img_loc, grayImage) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("black_white-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def normal_blur(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "BlurImage.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - OriImage = Image.open(a) - blurImage = OriImage.filter(ImageFilter.BLUR) - blurImage.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("normal_blur-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def g_blur(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "gaussian_blur.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - im1 = Image.open(a) - im2 = im1.filter(ImageFilter.GaussianBlur(radius=5)) - im2.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("g_blur-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def box_blur(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "box_blur.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - im1 = Image.open(a) - im2 = im1.filter(ImageFilter.BoxBlur(0)) - im2.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("box_blur-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return diff --git a/Shikimori/Extras/ImageEditor/edit_2.py b/Shikimori/Extras/ImageEditor/edit_2.py deleted file mode 100644 index 6594a99d..00000000 --- a/Shikimori/Extras/ImageEditor/edit_2.py +++ /dev/null @@ -1,399 +0,0 @@ -# By @TroJanzHEX -import os -import shutil - -import cv2 -import numpy as np -from PIL import Image, ImageDraw, ImageEnhance - - -async def circle_with_bg(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "circle.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - img = Image.open(a).convert("RGB") - npImage = np.array(img) - h, w = img.size - alpha = Image.new("L", img.size, 0) - draw = ImageDraw.Draw(alpha) - draw.pieslice([0, 0, h, w], 0, 360, fill=255) - npAlpha = np.array(alpha) - npImage = np.dstack((npImage, npAlpha)) - Image.fromarray(npImage).save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("circle_with_bg-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def circle_without_bg(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "circle.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - img = Image.open(a).convert("RGB") - npImage = np.array(img) - h, w = img.size - alpha = Image.new("L", img.size, 0) - draw = ImageDraw.Draw(alpha) - draw.pieslice([0, 0, h, w], 0, 360, fill=255) - npAlpha = np.array(alpha) - npImage = np.dstack((npImage, npAlpha)) - Image.fromarray(npImage).save(edit_img_loc) - await message.reply_chat_action("upload_document") - await message.reply_to_message.reply_document(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("circle_without_bg-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def sticker(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "sticker.webp" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - os.rename(a, edit_img_loc) - await message.reply_to_message.reply_sticker(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("sticker-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -def add_corners(im, rad): - circle = Image.new("L", (rad * 2, rad * 2), 0) - draw = ImageDraw.Draw(circle) - draw.ellipse((0, 0, rad * 2, rad * 2), fill=255) - alpha = Image.new("L", im.size, 255) - w, h = im.size - alpha.paste(circle.crop((0, 0, rad, rad)), (0, 0)) - alpha.paste(circle.crop((0, rad, rad, rad * 2)), (0, h - rad)) - alpha.paste(circle.crop((rad, 0, rad * 2, rad)), (w - rad, 0)) - alpha.paste(circle.crop((rad, rad, rad * 2, rad * 2)), (w - rad, h - rad)) - im.putalpha(alpha) - return im - - -async def edge_curved(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "edge_curved.webp" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - im = Image.open(a) - im = add_corners(im, 100) - im.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_sticker(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("edge_curved-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def contrast(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "contrast.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - image = Image.open(a) - contrast = ImageEnhance.Contrast(image) - contrast.enhance(1.5).save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("contrast-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -def sepia(img): - width, height = img.size - new_img = img.copy() - for x in range(width): - for y in range(height): - red, green, blue = img.getpixel((x, y)) - new_val = 0.3 * red + 0.59 * green + 0.11 * blue - new_red = int(new_val * 2) - if new_red > 255: - new_red = 255 - new_green = int(new_val * 1.5) - if new_green > 255: - new_green = 255 - new_blue = int(new_val) - if new_blue > 255: - new_blue = 255 - - new_img.putpixel((x, y), (new_red, new_green, new_blue)) - - return new_img - - -async def sepia_mode(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "sepia.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - image = Image.open(a) - new_img = sepia(image) - new_img.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("sepia_mode-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -def dodgeV2(x, y): - return cv2.divide(x, 255 - y, scale=256) - - -async def pencil(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "pencil.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - img = cv2.imread(a) - img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) - img_invert = cv2.bitwise_not(img_gray) - img_smoothing = cv2.GaussianBlur(img_invert, (21, 21), sigmaX=0, sigmaY=0) - final_img = dodgeV2(img_gray, img_smoothing) - cv2.imwrite(edit_img_loc, final_img) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("pencil-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -def color_quantization(img, k): - data = np.float32(img).reshape((-1, 3)) - criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 20, 1.0) - _, label, center = cv2.kmeans( - data, k, None, criteria, 10, cv2.KMEANS_RANDOM_CENTERS - ) - center = np.uint8(center) - result = center[label.flatten()] - result = result.reshape(img.shape) - return result - - -async def cartoon(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "kang.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - img = cv2.imread(a) - edges = cv2.Canny(img, 100, 200) - gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) - edges = cv2.adaptiveThreshold( - gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 9, 5 - ) - color = cv2.bilateralFilter(img, d=9, sigmaColor=200, sigmaSpace=200) - - cv2.bitwise_and(color, color, mask=edges) - img_1 = color_quantization(img, 7) - cv2.imwrite(edit_img_loc, img_1) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("cartoon-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return diff --git a/Shikimori/Extras/ImageEditor/edit_3.py b/Shikimori/Extras/ImageEditor/edit_3.py deleted file mode 100644 index c28d6940..00000000 --- a/Shikimori/Extras/ImageEditor/edit_3.py +++ /dev/null @@ -1,165 +0,0 @@ -# By @TroJanzHEX -import os -import shutil - -from PIL import Image, ImageOps - - -async def black_border(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "imaged-black-border.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - img = Image.open(a) - img_with_border = ImageOps.expand(img, border=100, fill="black") - img_with_border.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("black_border-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def green_border(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "imaged-green-border.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - img = Image.open(a) - img_with_border = ImageOps.expand(img, border=100, fill="green") - img_with_border.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("green_border-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def blue_border(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "imaged-blue-border.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - img = Image.open(a) - img_with_border = ImageOps.expand(img, border=100, fill="blue") - img_with_border.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("blue_border-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def red_border(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "imaged-red-border.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - img = Image.open(a) - img_with_border = ImageOps.expand(img, border=100, fill="red") - img_with_border.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("red_border-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return diff --git a/Shikimori/Extras/ImageEditor/edit_4.py b/Shikimori/Extras/ImageEditor/edit_4.py deleted file mode 100644 index 1f442c4f..00000000 --- a/Shikimori/Extras/ImageEditor/edit_4.py +++ /dev/null @@ -1,412 +0,0 @@ -# By @TroJanzHEX -import io -import os -import shutil - -import cv2 -import numpy as np -import requests -from PIL import Image, ImageDraw, ImageOps - -from Shikimori.confing import get_str_key - -RemoveBG_API = get_str_key("REM_BG_API_KEY", required=False) - - -async def rotate_90(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "rotate_90.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - src = cv2.imread(a) - image = cv2.rotate(src, cv2.cv2.ROTATE_90_CLOCKWISE) - cv2.imwrite(edit_img_loc, image) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("rotate_90-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def rotate_180(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "rotate_180.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - src = cv2.imread(a) - image = cv2.rotate(src, cv2.ROTATE_180) - cv2.imwrite(edit_img_loc, image) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("rotate_180-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def rotate_270(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "rotate_270.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - src = cv2.imread(a) - image = cv2.rotate(src, cv2.ROTATE_90_COUNTERCLOCKWISE) - cv2.imwrite(edit_img_loc, image) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("rotate_270-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -def resize_photo(photo: str, userid: str) -> io.BytesIO: - image = Image.open(photo) - maxsize = 512 - scale = maxsize / max(image.width, image.height) - new_size = (int(image.width * scale), int(image.height * scale)) - image = image.resize(new_size, Image.LANCZOS) - resized_photo = io.BytesIO() - resized_photo.name = "./DOWNLOADS" + "/" + userid + "resized.png" - image.save(resized_photo, "PNG") - return resized_photo - - -async def round_sticker(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "rounded.webp" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - resized = resize_photo(a, userid) - img = Image.open(resized).convert("RGB") - npImage = np.array(img) - h, w = img.size - alpha = Image.new("L", img.size, 0) - draw = ImageDraw.Draw(alpha) - draw.pieslice([0, 0, h, w], 0, 360, fill=255) - npAlpha = np.array(alpha) - npImage = np.dstack((npImage, npAlpha)) - Image.fromarray(npImage).save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_sticker(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("round_sticker-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def inverted(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "inverted.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - a = await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - image = Image.open(a) - inverted_image = ImageOps.invert(image) - inverted_image.save(edit_img_loc) - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("inverted-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def removebg_plain(client, message): - try: - if not (RemoveBG_API == ""): - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "nobgplain.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - - response = requests.post( - "https://api.remove.bg/v1.0/removebg", - files={"image_file": open(download_location, "rb")}, - data={"size": "auto"}, - headers={"X-Api-Key": RemoveBG_API}, - ) - if response.status_code == 200: - with open(f"{edit_img_loc}", "wb") as out: - out.write(response.content) - else: - await message.reply_to_message.reply_text( - "Check if your api is correct", quote=True - ) - return - - await message.reply_chat_action("upload_document") - await message.reply_to_message.reply_document(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - else: - await message.reply_to_message.reply_text( - "Get the api from https://www.remove.bg/b/background-removal-api and add in Config Var", - quote=True, - disable_web_page_preview=True, - ) - except Exception as e: - print("removebg_plain-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def removebg_white(client, message): - try: - if not (RemoveBG_API == ""): - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "nobgwhite.png" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - - response = requests.post( - "https://api.remove.bg/v1.0/removebg", - files={"image_file": open(download_location, "rb")}, - data={"size": "auto"}, - headers={"X-Api-Key": Config.RemoveBG_API}, - ) - if response.status_code == 200: - with open(f"{edit_img_loc}", "wb") as out: - out.write(response.content) - else: - await message.reply_to_message.reply_text( - "Check if your api is correct", quote=True - ) - return - - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - else: - await message.reply_to_message.reply_text( - "Get the api from https://www.remove.bg/b/background-removal-api and add in Config Var", - quote=True, - disable_web_page_preview=True, - ) - except Exception as e: - print("removebg_white-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def removebg_sticker(client, message): - try: - if not (RemoveBG_API == ""): - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "nobgsticker.webp" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - - response = requests.post( - "https://api.remove.bg/v1.0/removebg", - files={"image_file": open(download_location, "rb")}, - data={"size": "auto"}, - headers={"X-Api-Key": RemoveBG_API}, - ) - if response.status_code == 200: - with open(f"{edit_img_loc}", "wb") as out: - out.write(response.content) - else: - await message.reply_to_message.reply_text( - "Check if your api is correct", quote=True - ) - return - - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_sticker(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - else: - await message.reply_to_message.reply_text( - "Get the api from https://www.remove.bg/b/background-removal-api and add in Config Var", - quote=True, - disable_web_page_preview=True, - ) - except Exception as e: - print("removebg_sticker-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return diff --git a/Shikimori/Extras/ImageEditor/edit_5.py b/Shikimori/Extras/ImageEditor/edit_5.py deleted file mode 100644 index a5df7fa8..00000000 --- a/Shikimori/Extras/ImageEditor/edit_5.py +++ /dev/null @@ -1,424 +0,0 @@ -# By @TroJanzHEX -import asyncio -import os -import shutil - - -async def normalglitch_1(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "normalglitch_1.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-o", edit_img_loc, download_location, "1"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("normalglitch_1-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def normalglitch_2(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "normalglitch_2.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-o", edit_img_loc, download_location, "2"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("normalglitch_2-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def normalglitch_3(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "normalglitch_3.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-o", edit_img_loc, download_location, "3"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("normalglitch_3-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def normalglitch_4(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "normalglitch_4.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-o", edit_img_loc, download_location, "4"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("normalglitch_4-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def normalglitch_5(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "normalglitch_5.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-o", edit_img_loc, download_location, "5"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("normalglitch_5-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def scanlineglitch_1(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "scanlineglitch_1.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-s", "-o", edit_img_loc, download_location, "1"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("scanlineglitch_1-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def scanlineglitch_2(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "scanlineglitch_2.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-s", "-o", edit_img_loc, download_location, "2"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("scanlineglitch_2-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def scanlineglitch_3(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "scanlineglitch_3.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-s", "-o", edit_img_loc, download_location, "3"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("scanlineglitch_3-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def scanlineglitch_4(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "scanlineglitch_4.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-s", "-o", edit_img_loc, download_location, "4"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("scanlineglitch_4-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return - - -async def scanlineglitch_5(client, message): - try: - userid = str(message.chat.id) - if not os.path.isdir(f"./DOWNLOADS/{userid}"): - os.makedirs(f"./DOWNLOADS/{userid}") - download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg" - edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "scanlineglitch_5.jpg" - if not message.reply_to_message.empty: - msg = await message.reply_to_message.reply_text( - "Downloading image", quote=True - ) - await client.download_media( - message=message.reply_to_message, file_name=download_location - ) - await msg.edit("Processing Image...") - cd = ["glitch_this", "-c", "-s", "-o", edit_img_loc, download_location, "5"] - process = await asyncio.create_subprocess_exec( - *cd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE - ) - await process.communicate() - await message.reply_chat_action("upload_photo") - await message.reply_to_message.reply_photo(edit_img_loc, quote=True) - await msg.delete() - else: - await message.reply_text("Why did you delete that??") - try: - shutil.rmtree(f"./DOWNLOADS/{userid}") - except Exception: - pass - except Exception as e: - print("scanlineglitch_5-error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_to_message.reply_text( - "Something went wrong!", quote=True - ) - except Exception: - return diff --git a/Shikimori/Extras/chatbot.py b/Shikimori/Extras/chatbot.py deleted file mode 100644 index 85f8539b..00000000 --- a/Shikimori/Extras/chatbot.py +++ /dev/null @@ -1,33 +0,0 @@ -from Shikimori.mongo import client as db_x - -lydia = db_x["CHATBOT"] - - -def add_chat(chat_id): - stark = lydia.find_one({"chat_id": chat_id}) - if stark: - return False - lydia.insert_one({"chat_id": chat_id}) - return True - - -def remove_chat(chat_id): - stark = lydia.find_one({"chat_id": chat_id}) - if not stark: - return False - lydia.delete_one({"chat_id": chat_id}) - return True - - -def get_all_chats(): - r = list(lydia.find()) - if r: - return r - return False - - -def get_session(chat_id): - stark = lydia.find_one({"chat_id": chat_id}) - if not stark: - return False - return stark diff --git a/Shikimori/Extras/dbfunctions.py b/Shikimori/Extras/dbfunctions.py index abd98a60..690aa5ec 100644 --- a/Shikimori/Extras/dbfunctions.py +++ b/Shikimori/Extras/dbfunctions.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import codecs import pickle from typing import Dict, List, Union diff --git a/Shikimori/Extras/errors.py b/Shikimori/Extras/errors.py index 696d89d2..f40d5eac 100644 --- a/Shikimori/Extras/errors.py +++ b/Shikimori/Extras/errors.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import sys import traceback from functools import wraps diff --git a/Shikimori/__init__.py b/Shikimori/__init__.py index 28f46522..e5cd05a9 100644 --- a/Shikimori/__init__.py +++ b/Shikimori/__init__.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import logging import os import sys diff --git a/Shikimori/__main__.py b/Shikimori/__main__.py index d5f2acc9..8d62a88a 100644 --- a/Shikimori/__main__.py +++ b/Shikimori/__main__.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import json import importlib diff --git a/Shikimori/confing.py b/Shikimori/confing.py index ed6e1d81..60b29f21 100644 --- a/Shikimori/confing.py +++ b/Shikimori/confing.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os import sys diff --git a/Shikimori/core/tasks.py b/Shikimori/core/tasks.py index e7b84b49..dcd79c00 100644 --- a/Shikimori/core/tasks.py +++ b/Shikimori/core/tasks.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from asyncio import Lock, create_task from time import time diff --git a/Shikimori/events.py b/Shikimori/events.py index 06a48257..7d81f510 100644 --- a/Shikimori/events.py +++ b/Shikimori/events.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import inspect import logging import sys diff --git a/Shikimori/ex_plugins/dbfunctions.py b/Shikimori/ex_plugins/dbfunctions.py index 333d75bd..2eaecb5a 100644 --- a/Shikimori/ex_plugins/dbfunctions.py +++ b/Shikimori/ex_plugins/dbfunctions.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import codecs import pickle from typing import Dict, List, Union diff --git a/Shikimori/modules/animedev/__init__.py b/Shikimori/imports/animedev/__init__.py similarity index 100% rename from Shikimori/modules/animedev/__init__.py rename to Shikimori/imports/animedev/__init__.py diff --git a/Shikimori/modules/animedev/exceptions.py b/Shikimori/imports/animedev/exceptions.py similarity index 100% rename from Shikimori/modules/animedev/exceptions.py rename to Shikimori/imports/animedev/exceptions.py diff --git a/Shikimori/modules/ExtraGifs.py b/Shikimori/modules/ExtraGifs.py index 5b087853..24af3c86 100644 --- a/Shikimori/modules/ExtraGifs.py +++ b/Shikimori/modules/ExtraGifs.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import random import time diff --git a/Shikimori/modules/TTS.py b/Shikimori/modules/TTS.py index 9c4dada0..ede3982b 100644 --- a/Shikimori/modules/TTS.py +++ b/Shikimori/modules/TTS.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os from gtts import gTTS diff --git a/Shikimori/modules/__init__.py b/Shikimori/modules/__init__.py index 23c59a1a..148fb572 100644 --- a/Shikimori/modules/__init__.py +++ b/Shikimori/modules/__init__.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import LOAD, NO_LOAD, LOGGER import sys diff --git a/Shikimori/modules/about.py b/Shikimori/modules/about.py index 252e50ed..c587ae0d 100644 --- a/Shikimori/modules/about.py +++ b/Shikimori/modules/about.py @@ -1,3 +1,36 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import time from Shikimori.modules.helper_funcs.readable_time import get_readable_time from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ParseMode, Update diff --git a/Shikimori/modules/admin.py b/Shikimori/modules/admin.py index 0d2540ba..ad3b4876 100644 --- a/Shikimori/modules/admin.py +++ b/Shikimori/modules/admin.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os import html import re diff --git a/Shikimori/modules/afk.py b/Shikimori/modules/afk.py index 87193109..de5f109e 100644 --- a/Shikimori/modules/afk.py +++ b/Shikimori/modules/afk.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import time from telegram import MessageEntity, ParseMode diff --git a/Shikimori/modules/animelinks.py b/Shikimori/modules/animelinks.py index 7b3a72b6..5ceed293 100644 --- a/Shikimori/modules/animelinks.py +++ b/Shikimori/modules/animelinks.py @@ -31,7 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -from Shikimori.modules.animedev import client as animedev_client, exceptions +from Shikimori.imports.animedev import client as animedev_client, exceptions from Shikimori.events import register from Shikimori import telethn, SUPPORT_CHAT from telethon import Button diff --git a/Shikimori/modules/anti_channel.py.txt b/Shikimori/modules/anti_channel.py.txt deleted file mode 100644 index 67b68f95..00000000 --- a/Shikimori/modules/anti_channel.py.txt +++ /dev/null @@ -1,48 +0,0 @@ -from telegram.ext.filters import Filters -from Shikimori.modules.helper_funcs.decorators import Shikimoricmd, Shikimorimsg -from telegram import Update -from telegram.ext import CallbackContext -from Shikimori.modules.helper_funcs.anonymous import user_admin, AdminPerms -import html -from Shikimori.modules.sql.antichannel_sql import antichannel_status, disable_antichannel, enable_antichannel - - -@Shikimoricmd(command="antichannel", group=100) -@user_admin(AdminPerms.CAN_RESTRICT_MEMBERS) -def set_antichannel(update: Update, context: CallbackContext): - message = update.effective_message - chat = update.effective_chat - args = context.args - if len(args) > 0: - s = args[0].lower() - if s in ["yes", "on"]: - enable_antichannel(chat.id) - message.reply_html("Enabled antichannel in {}".format(html.escape(chat.title))) - elif s in ["off", "no"]: - disable_antichannel(chat.id) - message.reply_html("Disabled antichannel in {}".format(html.escape(chat.title))) - else: - message.reply_text("Unrecognized arguments {}".format(s)) - return - message.reply_html( - "Antichannel setting is currently {} in {}".format(antichannel_status(chat.id), html.escape(chat.title))) - - -@Shikimorimsg(Filters.chat_type.groups, group=110) -def eliminate_channel(update: Update, context: CallbackContext): - message = update.effective_message - chat = update.effective_chat - bot = context.bot - if not antichannel_status(chat.id): - return - if message.sender_chat and message.sender_chat.type == "channel" and not message.is_automatic_forward: - message.delete() - sender_chat = message.sender_chat - bot.ban_chat_sender_chat(sender_chat_id=sender_chat.id, chat_id=chat.id) - - -__mod_name__ = "Anti Channel" - -__help__ = """ ---> `/antichannel` [on/off] - To toggle antichannel -""" \ No newline at end of file diff --git a/Shikimori/modules/antichannel.py b/Shikimori/modules/antichannel.py deleted file mode 100644 index cf765acc..00000000 --- a/Shikimori/modules/antichannel.py +++ /dev/null @@ -1,73 +0,0 @@ -""" -BSD 2-Clause License - -Copyright (C) 2017-2019, Paul Larsen -Copyright (C) 2021-2022, Awesome-RJ, [ https://github.com/Awesome-RJ ] -Copyright (c) 2021-2022, Yūki • Black Knights Union, [ https://github.com/Awesome-RJ/CutiepiiRobot ] - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" -import html -from telegram import Update, ParseMode -from telegram.ext import Filters, CallbackContext - -from Shikimori import dispatcher -from Shikimori.modules.disable import DisableAbleCommandHandler -from Shikimori.modules.helper_funcs.anonymous import user_admin -from Shikimori.modules.sql.antichannel_sql import antichannel_status, disable_antichannel, enable_antichannel - -@user_admin -async def set_antichannel(update: Update, context: CallbackContext): - message = update.effective_message - chat = update.effective_chat - args = context.args - if len(args) > 0: - s = args[0].lower() - if s in ["yes", "on"]: - enable_antichannel(chat.id) - await message.reply_text(f"Enabled antichannel in {html.escape(chat.title)}", parse_mode=ParseMode.HTML) - elif s in ["off", "no"]: - disable_antichannel(chat.id) - await message.reply_text(f"Disabled antichannel in {html.escape(chat.title)}", parse_mode=ParseMode.HTML) - else: - await update.effective_message.reply_text(f"Unrecognized arguments {s}") - return - await message.reply_text( - f"Antichannel setting is currently {antichannel_status(chat.id)} in {html.escape(chat.title)}", parse_mode=ParseMode.HTML - ) - - -async def eliminate_channel(update: Update, context: CallbackContext): - message = update.effective_message - chat = update.effective_chat - bot = context.bot - if not antichannel_status(chat.id): - return - if message.sender_chat and message.sender_chat.type == "channel" and not message.is_automatic_forward: - await message.delete() - sender_chat = message.sender_chat - await bot.ban_chat_sender_chat(sender_chat_id=sender_chat.id, chat_id=chat.id) - - -dispatcher.add_handler(DisableAbleCommandHandler("antichannel", set_antichannel, filters=Filters.chat_type.groups)) \ No newline at end of file diff --git a/Shikimori/modules/antinsfw.py b/Shikimori/modules/antinsfw.py deleted file mode 100644 index 4cac06d8..00000000 --- a/Shikimori/modules/antinsfw.py +++ /dev/null @@ -1,206 +0,0 @@ -""" -STATUS: Code is working. ❎ -""" - -""" -BSD 2-Clause License - -Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] - -Credits:- - Copyright (C) 2017-2019, Paul Larsen - Copyright (C) 2021-2022, Awesome-RJ, [ https://github.com/Awesome-RJ ] - Copyright (c) 2021-2022, Copyright (c) 2021 TheHamkerCat - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" - -from os import remove -from pyrogram import filters - -from Shikimori import BOT_USERNAME, DEV_USERS, arq, pbot -from Shikimori.utils.errors import capture_err -from Shikimori.utils.permissions import adminsOnly -import Shikimori.modules.sql.nsfw_sql as sql -from Shikimori.modules.mongo.nsfw_mongo import is_nsfw_on, nsfw_off, nsfw_on - - -async def get_file_id_from_message(message): - file_id = None - if message.document: - if int(message.document.file_size) > 3145728: - return - mime_type = message.document.mime_type - if mime_type not in ("image/png", "image/jpeg"): - return - file_id = message.document.file_id - - if message.sticker: - if message.sticker.is_animated: - if not message.sticker.thumbs: - return - file_id = message.sticker.thumbs[0].file_id - else: - file_id = message.sticker.file_id - - if message.photo: - file_id = message.photo.file_id - - if message.animation: - if not message.animation.thumbs: - return - file_id = message.animation.thumbs[0].file_id - - if message.video: - if not message.video.thumbs: - return - file_id = message.video.thumbs[0].file_id - return file_id - - -@pbot.on_message( - ( - filters.document - | filters.photo - | filters.sticker - | filters.animation - | filters.video - ) - & ~filters.private, - group=8, -) -@capture_err -async def detect_nsfw(_, message): - if not await is_nsfw_on(message.chat.id): - return - is_nsfw = sql.is_nsfw(chat_id) - if is_nsfw: - pass - if not message.from_user: - return - file_id = await get_file_id_from_message(message) - if not file_id: - return - file = await pbot.download_media(file_id) - try: - results = await arq.nsfw_scan(file=file) - except Exception: - return - if not results.ok: - return - results = results.result - remove(file) - nsfw = results.is_nsfw - if message.from_user.id in DEV_USERS: - return - if not nsfw: - return - try: - await message.delete() - except Exception: - return - await message.reply_text( - f""" -**NSFW Image Detected & Deleted Successfully! -————————————————————** -**User:** {message.from_user.mention} [`{message.from_user.id}`] -**Safe:** `{results.neutral} %` -**Porn:** `{results.porn} %` -**Adult:** `{results.sexy} %` -**Hentai:** `{results.hentai} %` -**Drawings:** `{results.drawings} %` -**————————————————————** -__Powered by__@Yuki_Network. -""" - ) - - -@pbot.on_message(filters.command(["nsfwscan", "nsfwscan@Shikimori"])) -@capture_err -async def nsfw_scan_command(_, message): - if not message.reply_to_message: - await message.reply_text( - "Reply to an image/document/sticker/animation to scan it." - ) - return - reply = message.reply_to_message - if ( - not reply.document - and not reply.photo - and not reply.sticker - and not reply.animation - and not reply.video - ): - await message.reply_text( - "Reply to an image/document/sticker/animation to scan it." - ) - return - m = await message.reply_text("Scanning") - file_id = await get_file_id_from_message(reply) - if not file_id: - return await m.edit("Something wrong happened.") - file = await pbot.download_media(file_id) - try: - results = await arq.nsfw_scan(file=file) - except Exception: - return - remove(file) - if not results.ok: - return await m.edit(results.result) - results = results.result - await m.edit( - f""" -**Neutral:** `{results.neutral} %` -**Porn:** `{results.porn} %` -**Hentai:** `{results.hentai} %` -**Sexy:** `{results.sexy} %` -**Drawings:** `{results.drawings} %` -**NSFW:** `{results.is_nsfw}` -""" - ) - - -@pbot.on_message(filters.command(["antinsfw", f"antinsfw@{BOT_USERNAME}"]) & ~filters.private) -@adminsOnly("can_change_info") -async def nsfw_enable_disable(_, message): - if len(message.command) != 2: - await message.reply_text( - "Usage: /antinsfw [on/off]" - ) - return - status = message.text.split(None, 1)[1].strip() - status = status.lower() - chat_id = message.chat.id - if status in ("on", "yes"): - await nsfw_on(chat_id) - await message.reply_text( - "Enabled AntiNSFW System. I will Delete Messages Containing Inappropriate Content." - ) - elif status in ("off", "no"): - await nsfw_off(chat_id) - await message.reply_text("Disabled AntiNSFW System.") - else: - await message.reply_text( - "Unknown Suffix, Use /antinsfw [on/off]" - ) diff --git a/Shikimori/modules/antiservice.py b/Shikimori/modules/antiservice.py deleted file mode 100644 index bff74f90..00000000 --- a/Shikimori/modules/antiservice.py +++ /dev/null @@ -1,60 +0,0 @@ -# Written By [MaskedVirus | swatv3nub] for William and Ryūga -# Kang With Proper Credits - -from pyrogram import filters - -from Shikimori import app -from Shikimori.utils.permissions import adminsOnly -from Shikimori.utils.errors import capture_err -from Shikimori.ex_plugins.dbfunctions import ( - antiservice_off, - antiservice_on, - is_antiservice_on, -) - -__mod_name__ = "AntiService" -__help__ = """ -Plugin to delete service messages in a chat! - -/antiservice [enable|disable] -""" - - -@app.on_message( - filters.command("antiservice") - & ~filters.private -) -@capture_err -@adminsOnly("can_change_info") -async def anti_service(_, message): - if len(message.command) != 2: - return await message.reply_text( - "Usage: /antiservice [enable | disable]" - ) - status = message.text.split(None, 1)[1].strip() - status = status.lower() - chat_id = message.chat.id - if status == "enable": - await antiservice_on(chat_id) - await message.reply_text( - "Enabled AntiService System. I will Delete Service Messages from Now on." - ) - elif status == "disable": - await antiservice_off(chat_id) - await message.reply_text( - "Disabled AntiService System. I won't Be Deleting Service Message from Now on." - ) - else: - await message.reply_text( - "Unknown Suffix, Use /antiservice [enable|disable]" - ) - - -@app.on_message(filters.service, group=11) -async def delete_service(_, message): - chat_id = message.chat.id - try: - if await is_antiservice_on(chat_id): - return await message.delete() - except Exception: - pass diff --git a/Shikimori/modules/apod.py b/Shikimori/modules/apod.py index 5d925e1f..576bcf93 100644 --- a/Shikimori/modules/apod.py +++ b/Shikimori/modules/apod.py @@ -1,3 +1,36 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import dispatcher, APOD_API_KEY from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update, ParseMode from telegram.ext import ( diff --git a/Shikimori/modules/approve.py b/Shikimori/modules/approve.py index be9ad225..ff6be22c 100644 --- a/Shikimori/modules/approve.py +++ b/Shikimori/modules/approve.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html from Shikimori.modules.disable import DisableAbleCommandHandler from Shikimori import dispatcher, DRAGONS diff --git a/Shikimori/modules/arq.py b/Shikimori/modules/arq.py index 804f8cf4..03d6fb8f 100644 --- a/Shikimori/modules/arq.py +++ b/Shikimori/modules/arq.py @@ -1,3 +1,36 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from pyrogram import filters from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup from Shikimori import SUPPORT_CHAT, pbot @@ -65,69 +98,5 @@ async def ytarq(_, message): await m.delete() return await message.reply_photo(thumb ,caption = text, reply_markup=InlineKeyboardMarkup(buttons)) - except: - await m.edit(f"ERROR!!! Contact @{SUPPORT_CHAT}") - - -@pbot.on_message(filters.command("spellcheck")) -async def spellcheck_func(_, message): - if len(message.command) < 2: - return await message.reply_text("**Usage:**\n/spellcheck [QUERY]") - - query = message.text.strip().split(None, 1)[1] - - try: - spellcheck = await arq.spellcheck(query) - # spellcheck = hmm.result[0] - corrected = spellcheck["corrected"] - corrections = spellcheck["corrections"] - - text = f"corrected - **{corrected}**\n" - text += f"corrections - `{corrections}`\n" - - await message.reply_text(text) - - except: - await message.reply_text(f"Check your query. And if the function doesn't work, contact @{SUPPORT_CHAT}") - -@pbot.on_message(filters.command("phub")) -async def phub(_, message): - if len(message.command) < 2: - return await message.reply_text("**Usage:**\n\n`/phub [QUERY]`") - m = await message.reply_text("**Searching**") - query = message.text.strip().split(None, 1)[1] - - try: - hmm = await arq.pornhub(query) - result = hmm.result[0] - thumbs = result["thumbnails"] - thumb= thumbs[0] - thumb = thumb + ".jpg" - title = result["title"] - rating = result["rating"] - Duration = result["duration"] - views = result["views"] - url = result["url"] - category = result["category"] - views = views.replace('.', ",") - views = views.replace("Aufrufe", "") - - text = f"Title 🎩 - **{title}**\n" - text += f"Duration 🕔 - `{Duration}`\n" - text += f"Views 👀 - `{views}`\n" - text += f"Category 📺 - `{category}`\n" - text += f"Rating 📺 - `{rating}`\n" - link = f"https://youtube.com{url}" - text += f"{url}" - - buttons = [ - [ - InlineKeyboardButton(text="Visit", url=link), - ],] - await m.delete() - return await message.reply_photo(thumb ,caption = text, - #reply_markup=InlineKeyboardMarkup(buttons) - ) - except: await m.edit(f"ERROR!!! Contact @{SUPPORT_CHAT}") \ No newline at end of file diff --git a/Shikimori/modules/backups.py b/Shikimori/modules/backups.py index d48744c0..f54258ad 100644 --- a/Shikimori/modules/backups.py +++ b/Shikimori/modules/backups.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import json, time, os from io import BytesIO diff --git a/Shikimori/modules/bans.py b/Shikimori/modules/bans.py index 42bf1d97..90436524 100644 --- a/Shikimori/modules/bans.py +++ b/Shikimori/modules/bans.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html from telegram import ( diff --git a/Shikimori/modules/blacklist.py b/Shikimori/modules/blacklist.py index adad3bf8..df73bf53 100644 --- a/Shikimori/modules/blacklist.py +++ b/Shikimori/modules/blacklist.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import re diff --git a/Shikimori/modules/blacklist_stickers.py b/Shikimori/modules/blacklist_stickers.py index a9fde946..ca20a012 100644 --- a/Shikimori/modules/blacklist_stickers.py +++ b/Shikimori/modules/blacklist_stickers.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html from typing import Optional diff --git a/Shikimori/modules/blacklistusers.py b/Shikimori/modules/blacklistusers.py index a2dedd40..bcfa1a60 100644 --- a/Shikimori/modules/blacklistusers.py +++ b/Shikimori/modules/blacklistusers.py @@ -1,4 +1,41 @@ # Module to blacklist users and prevent them from using commands by @TheRealPhoenix + +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + @TheRealPhoenix + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import Shikimori.modules.sql.blacklistusers_sql as sql from Shikimori import ( diff --git a/Shikimori/modules/books.py b/Shikimori/modules/books.py index c4c09ac1..1808a5a0 100644 --- a/Shikimori/modules/books.py +++ b/Shikimori/modules/books.py @@ -1,6 +1,42 @@ # Special Thanks @TeamDaisyX # TeamMizuhara +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os import re diff --git a/Shikimori/modules/cash.py b/Shikimori/modules/cash.py index 20dbc34a..33ae3419 100644 --- a/Shikimori/modules/cash.py +++ b/Shikimori/modules/cash.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import requests from Shikimori import CASH_API_KEY, dispatcher from telegram import Update, ParseMode diff --git a/Shikimori/modules/chatbot.py b/Shikimori/modules/chatbot.py index 6c2bacd2..05e10f08 100644 --- a/Shikimori/modules/chatbot.py +++ b/Shikimori/modules/chatbot.py @@ -1,3 +1,5 @@ +# Credits to MetaVoid Team for making this module. + import json import re import os diff --git a/Shikimori/modules/cleaner.py b/Shikimori/modules/cleaner.py index 6944659d..3e48f13c 100644 --- a/Shikimori/modules/cleaner.py +++ b/Shikimori/modules/cleaner.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html from Shikimori import ALLOW_EXCL, CustomCommandHandler, dispatcher diff --git a/Shikimori/modules/connection.py b/Shikimori/modules/connection.py index e34d38ec..4952a050 100644 --- a/Shikimori/modules/connection.py +++ b/Shikimori/modules/connection.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import time import re diff --git a/Shikimori/modules/country.py b/Shikimori/modules/country.py index 683e64ba..b8a5dd59 100644 --- a/Shikimori/modules/country.py +++ b/Shikimori/modules/country.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import flag from countryinfo import CountryInfo from Shikimori import dispatcher, telethn as borg diff --git a/Shikimori/modules/covid.py b/Shikimori/modules/covid.py index b72a9fcd..8e42e75a 100644 --- a/Shikimori/modules/covid.py +++ b/Shikimori/modules/covid.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import requests from telegram import ParseMode, Update from telegram.ext import CallbackContext diff --git a/Shikimori/modules/cricketscore.py b/Shikimori/modules/cricketscore.py index 53cc6c27..e8b71f55 100644 --- a/Shikimori/modules/cricketscore.py +++ b/Shikimori/modules/cricketscore.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import urllib.request from bs4 import BeautifulSoup diff --git a/Shikimori/modules/crypto.py b/Shikimori/modules/crypto.py index b0ee722e..d2b3196c 100644 --- a/Shikimori/modules/crypto.py +++ b/Shikimori/modules/crypto.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori.core.sections import section import requests from Shikimori import dispatcher diff --git a/Shikimori/modules/cust_filters.py b/Shikimori/modules/cust_filters.py index 451f6051..60cc3c18 100644 --- a/Shikimori/modules/cust_filters.py +++ b/Shikimori/modules/cust_filters.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import re import random from html import escape diff --git a/Shikimori/modules/dbcleanup.py b/Shikimori/modules/dbcleanup.py deleted file mode 100644 index 1860b028..00000000 --- a/Shikimori/modules/dbcleanup.py +++ /dev/null @@ -1,149 +0,0 @@ -from time import sleep - -import Shikimori.modules.sql.global_bans_sql as gban_sql -import Shikimori.modules.sql.users_sql as user_sql -from Shikimori import DEV_USERS, OWNER_ID, dispatcher -from Shikimori.modules.helper_funcs.chat_status import dev_plus -from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update -from telegram.error import BadRequest, Unauthorized -from telegram.ext import ( - CallbackContext, - CallbackQueryHandler, - CommandHandler, -) - - -def get_invalid_chats(update: Update, context: CallbackContext, remove: bool = False): - bot = context.bot - chat_id = update.effective_chat.id - chats = user_sql.get_all_chats() - kicked_chats, progress = 0, 0 - chat_list = [] - progress_message = None - - for chat in chats: - - if ((100 * chats.index(chat)) / len(chats)) > progress: - progress_bar = f"{progress}% completed in getting invalid chats." - if progress_message: - try: - bot.editMessageText( - progress_bar, - chat_id, - progress_message.message_id, - ) - except: - pass - else: - progress_message = bot.sendMessage(chat_id, progress_bar) - progress += 5 - - cid = chat.chat_id - sleep(0.1) - try: - bot.get_chat(cid, timeout=60) - except (BadRequest, Unauthorized): - kicked_chats += 1 - chat_list.append(cid) - except: - pass - - try: - progress_message.delete() - except: - pass - - if not remove: - return kicked_chats - for muted_chat in chat_list: - sleep(0.1) - user_sql.rem_chat(muted_chat) - return kicked_chats - - -def get_invalid_gban(update: Update, context: CallbackContext, remove: bool = False): - bot = context.bot - banned = gban_sql.get_gban_list() - ungbanned_users = 0 - ungban_list = [] - - for user in banned: - user_id = user["user_id"] - sleep(0.1) - try: - bot.get_chat(user_id) - except BadRequest: - ungbanned_users += 1 - ungban_list.append(user_id) - except: - pass - - if not remove: - return ungbanned_users - for user_id in ungban_list: - sleep(0.1) - gban_sql.ungban_user(user_id) - return ungbanned_users - - -@dev_plus -def dbcleanup(update: Update, context: CallbackContext): - msg = update.effective_message - - msg.reply_text("Getting invalid chat count ...") - invalid_chat_count = get_invalid_chats(update, context) - - msg.reply_text("Getting invalid gbanned count ...") - invalid_gban_count = get_invalid_gban(update, context) - - reply = f"Total invalid chats - {invalid_chat_count}\n" - reply += f"Total invalid gbanned users - {invalid_gban_count}" - - buttons = [[InlineKeyboardButton("Cleanup DB", callback_data="db_cleanup")]] - - update.effective_message.reply_text( - reply, - reply_markup=InlineKeyboardMarkup(buttons), - ) - - -def callback_button(update: Update, context: CallbackContext): - bot = context.bot - query = update.callback_query - message = query.message - chat_id = update.effective_chat.id - query_type = query.data - - admin_list = [OWNER_ID] + DEV_USERS - - bot.answer_callback_query(query.id) - - if query_type == "db_leave_chat": - if query.from_user.id in admin_list: - bot.editMessageText("Leaving chats ...", chat_id, message.message_id) - chat_count = get_muted_chats(update, context, True) - bot.sendMessage(chat_id, f"Left {chat_count} chats.") - else: - query.answer("You are not allowed to use this.") - elif query_type == "db_cleanup": - if query.from_user.id in admin_list: - bot.editMessageText("Cleaning up DB ...", chat_id, message.message_id) - invalid_chat_count = get_invalid_chats(update, context, True) - invalid_gban_count = get_invalid_gban(update, context, True) - reply = "Cleaned up {} chats and {} gbanned users from db.".format( - invalid_chat_count, - invalid_gban_count, - ) - bot.sendMessage(chat_id, reply) - else: - query.answer("You are not allowed to use this.") - - -DB_CLEANUP_HANDLER = CommandHandler("dbcleanup", dbcleanup, run_async=True) -BUTTON_HANDLER = CallbackQueryHandler(callback_button, pattern="db_.*", run_async=True) - -dispatcher.add_handler(DB_CLEANUP_HANDLER) -dispatcher.add_handler(BUTTON_HANDLER) - -__mod_name__ = "DB Cleanup" -__handlers__ = [DB_CLEANUP_HANDLER, BUTTON_HANDLER] diff --git a/Shikimori/modules/debug.py b/Shikimori/modules/debug.py index cc6b20d1..6c0b5f08 100644 --- a/Shikimori/modules/debug.py +++ b/Shikimori/modules/debug.py @@ -1,8 +1,41 @@ -import os -import datetime +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import time -from telethon import events from telegram import Update, ParseMode from telegram.ext import CallbackContext, CommandHandler from telegram.error import BadRequest @@ -10,46 +43,6 @@ from Shikimori import telethn, dispatcher from Shikimori.modules.helper_funcs.chat_status import dev_plus -DEBUG_MODE = False - -@dev_plus -def debug(update: Update, context: CallbackContext): - global DEBUG_MODE - args = update.effective_message.text.split(None, 1) - message = update.effective_message - print(DEBUG_MODE) - if len(args) > 1: - if args[1] in ("yes", "on"): - DEBUG_MODE = True - message.reply_text("Debug mode is now on.") - elif args[1] in ("no", "off"): - DEBUG_MODE = False - message.reply_text("Debug mode is now off.") - else: - if DEBUG_MODE: - message.reply_text("Debug mode is currently on.") - else: - message.reply_text("Debug mode is currently off.") - - -@telethn.on(events.NewMessage(pattern="[/!].*")) -async def i_do_nothing_yes(event): - global DEBUG_MODE - if DEBUG_MODE: - print(f"-{event.from_id} ({event.chat_id}) : {event.text}") - if os.path.exists("updates.txt"): - with open("updates.txt", "r") as f: - text = f.read() - with open("updates.txt", "w+") as f: - f.write(text + f"\n-{event.from_id} ({event.chat_id}) : {event.text}") - else: - with open("updates.txt", "w+") as f: - f.write( - f"- {event.from_id} ({event.chat_id}) : {event.text} | {datetime.datetime.now()}", - ) - -support_chat = os.getenv("SUPPORT_CHAT") - @dev_plus def logs(update: Update, context: CallbackContext): chat = update.effective_chat @@ -69,9 +62,5 @@ def logs(update: Update, context: CallbackContext): LOG_HANDLER = CommandHandler(("logs", "log"), logs, run_async=True) dispatcher.add_handler(LOG_HANDLER) -DEBUG_HANDLER = CommandHandler("debug", debug, run_async=True) -dispatcher.add_handler(DEBUG_HANDLER) - __mod_name__ = "Debug" __command_list__ = ["debug"] -__handlers__ = [DEBUG_HANDLER] diff --git a/Shikimori/modules/dev.py b/Shikimori/modules/dev.py index 455f4ad7..4512b1be 100644 --- a/Shikimori/modules/dev.py +++ b/Shikimori/modules/dev.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os import subprocess import sys diff --git a/Shikimori/modules/disable.py b/Shikimori/modules/disable.py index ff75b101..97474ed8 100644 --- a/Shikimori/modules/disable.py +++ b/Shikimori/modules/disable.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import importlib from typing import Union diff --git a/Shikimori/modules/disasters.py b/Shikimori/modules/disasters.py index 430d3a22..87c9442c 100644 --- a/Shikimori/modules/disasters.py +++ b/Shikimori/modules/disasters.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import json import os diff --git a/Shikimori/modules/encrypt.py b/Shikimori/modules/encrypt.py index ded9b64f..8c61a0a2 100644 --- a/Shikimori/modules/encrypt.py +++ b/Shikimori/modules/encrypt.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import telethn as tbot from Shikimori.events import register import secureme diff --git a/Shikimori/modules/error_handler.py b/Shikimori/modules/error_handler.py index 1ba13996..878053b6 100644 --- a/Shikimori/modules/error_handler.py +++ b/Shikimori/modules/error_handler.py @@ -1,3 +1,38 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" import html import io diff --git a/Shikimori/modules/eval.py b/Shikimori/modules/eval.py index 1b6bc2f2..889ccf99 100644 --- a/Shikimori/modules/eval.py +++ b/Shikimori/modules/eval.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import io import os diff --git a/Shikimori/modules/fakeit.py b/Shikimori/modules/fakeit.py index 5d0441e7..b3abf0f0 100644 --- a/Shikimori/modules/fakeit.py +++ b/Shikimori/modules/fakeit.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from faker import Faker from faker.providers import internet from telethon import events diff --git a/Shikimori/modules/feds.py b/Shikimori/modules/feds.py index aae8b31f..aa70ecbb 100644 --- a/Shikimori/modules/feds.py +++ b/Shikimori/modules/feds.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import ast import csv import json diff --git a/Shikimori/modules/forcesubs.py b/Shikimori/modules/forcesubs.py index 8e6f9ade..2c9aa490 100644 --- a/Shikimori/modules/forcesubs.py +++ b/Shikimori/modules/forcesubs.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import logging import time diff --git a/Shikimori/modules/games.py b/Shikimori/modules/games.py index 7ec313b0..5fda82c1 100644 --- a/Shikimori/modules/games.py +++ b/Shikimori/modules/games.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from pyrogram import filters from pyrogram.types import Message diff --git a/Shikimori/modules/get_common_chats.py b/Shikimori/modules/get_common_chats.py index 0c022b04..6477502f 100644 --- a/Shikimori/modules/get_common_chats.py +++ b/Shikimori/modules/get_common_chats.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os from time import sleep diff --git a/Shikimori/modules/gettime.py b/Shikimori/modules/gettime.py index 346dd906..66ca8bb4 100644 --- a/Shikimori/modules/gettime.py +++ b/Shikimori/modules/gettime.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import datetime from typing import List diff --git a/Shikimori/modules/global_bans.py b/Shikimori/modules/global_bans.py index ba3da156..55ac8aaf 100644 --- a/Shikimori/modules/global_bans.py +++ b/Shikimori/modules/global_bans.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import time from datetime import datetime diff --git a/Shikimori/modules/gtranslator.py b/Shikimori/modules/gtranslator.py index b8d5bfec..002982ae 100644 --- a/Shikimori/modules/gtranslator.py +++ b/Shikimori/modules/gtranslator.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from gpytranslate import Translator from telegram.ext import CallbackContext from telegram import ( diff --git a/Shikimori/modules/help.py b/Shikimori/modules/help.py index ecc23917..07b89d35 100644 --- a/Shikimori/modules/help.py +++ b/Shikimori/modules/help.py @@ -1,3 +1,36 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import re from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ParseMode, Update from telegram.error import BadRequest diff --git a/Shikimori/modules/helper_funcs/admin_rights.py b/Shikimori/modules/helper_funcs/admin_rights.py index 928e305f..8551b8b2 100644 --- a/Shikimori/modules/helper_funcs/admin_rights.py +++ b/Shikimori/modules/helper_funcs/admin_rights.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from telegram import User, Chat diff --git a/Shikimori/modules/helper_funcs/alternate.py b/Shikimori/modules/helper_funcs/alternate.py index 1ba5e022..56ed1494 100644 --- a/Shikimori/modules/helper_funcs/alternate.py +++ b/Shikimori/modules/helper_funcs/alternate.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from functools import wraps from telegram import error, ChatAction diff --git a/Shikimori/modules/helper_funcs/chat_status.py b/Shikimori/modules/helper_funcs/chat_status.py index edaafcd9..fdcb9f9b 100644 --- a/Shikimori/modules/helper_funcs/chat_status.py +++ b/Shikimori/modules/helper_funcs/chat_status.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from time import perf_counter from functools import wraps from cachetools import TTLCache diff --git a/Shikimori/modules/helper_funcs/decorators.py b/Shikimori/modules/helper_funcs/decorators.py index 2ace641a..93ca6b3c 100644 --- a/Shikimori/modules/helper_funcs/decorators.py +++ b/Shikimori/modules/helper_funcs/decorators.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori.modules.disable import ( DisableAbleCommandHandler, DisableAbleMessageHandler, diff --git a/Shikimori/modules/helper_funcs/extraction.py b/Shikimori/modules/helper_funcs/extraction.py index 268a5b08..0a7ade56 100644 --- a/Shikimori/modules/helper_funcs/extraction.py +++ b/Shikimori/modules/helper_funcs/extraction.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from typing import List, Optional from Shikimori import LOGGER diff --git a/Shikimori/modules/helper_funcs/filters.py b/Shikimori/modules/helper_funcs/filters.py index cb237952..bdc5a6e5 100644 --- a/Shikimori/modules/helper_funcs/filters.py +++ b/Shikimori/modules/helper_funcs/filters.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import DEV_USERS, DRAGONS, DEMONS from telegram import Message from telegram.ext import MessageFilter diff --git a/Shikimori/modules/helper_funcs/handlers.py b/Shikimori/modules/helper_funcs/handlers.py index e9d640fc..4107af6d 100644 --- a/Shikimori/modules/helper_funcs/handlers.py +++ b/Shikimori/modules/helper_funcs/handlers.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import Shikimori.modules.sql.blacklistusers_sql as sql from Shikimori import ALLOW_EXCL from Shikimori import DEV_USERS, DRAGONS, DEMONS, TIGERS, WOLVES diff --git a/Shikimori/modules/helper_funcs/misc.py b/Shikimori/modules/helper_funcs/misc.py index 9ce991f7..89df0a9b 100644 --- a/Shikimori/modules/helper_funcs/misc.py +++ b/Shikimori/modules/helper_funcs/misc.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from typing import Dict, List from math import ceil diff --git a/Shikimori/modules/helper_funcs/msg_types.py b/Shikimori/modules/helper_funcs/msg_types.py index aee4a240..c6f66045 100644 --- a/Shikimori/modules/helper_funcs/msg_types.py +++ b/Shikimori/modules/helper_funcs/msg_types.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from enum import IntEnum, unique from Shikimori.modules.helper_funcs.string_handling import button_markdown_parser diff --git a/Shikimori/modules/helper_funcs/readable_time.py b/Shikimori/modules/helper_funcs/readable_time.py index 270c3bbb..58fc4b4b 100644 --- a/Shikimori/modules/helper_funcs/readable_time.py +++ b/Shikimori/modules/helper_funcs/readable_time.py @@ -1,5 +1,40 @@ -import time +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + +import time def get_readable_time(seconds: int) -> str: count = 0 diff --git a/Shikimori/modules/helper_funcs/regex_helper.py b/Shikimori/modules/helper_funcs/regex_helper.py index 90c2eb3b..cc71faf1 100644 --- a/Shikimori/modules/helper_funcs/regex_helper.py +++ b/Shikimori/modules/helper_funcs/regex_helper.py @@ -1,5 +1,40 @@ -import regex +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + +import regex def regex_searcher(regex_string, string): try: diff --git a/Shikimori/modules/helper_funcs/string_handling.py b/Shikimori/modules/helper_funcs/string_handling.py index 68dab13b..66983ce6 100644 --- a/Shikimori/modules/helper_funcs/string_handling.py +++ b/Shikimori/modules/helper_funcs/string_handling.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import re import time from typing import Dict, List diff --git a/Shikimori/modules/helper_funcs/telethn/chatstatus.py b/Shikimori/modules/helper_funcs/telethn/chatstatus.py index 4824f00a..9907b92c 100644 --- a/Shikimori/modules/helper_funcs/telethn/chatstatus.py +++ b/Shikimori/modules/helper_funcs/telethn/chatstatus.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori.modules.helper_funcs.telethn import IMMUNE_USERS, telethn from Shikimori import DRAGONS from telethon.tl.types import ChannelParticipantsAdmins diff --git a/Shikimori/modules/heroku.py b/Shikimori/modules/heroku.py deleted file mode 100644 index 4d51beef..00000000 --- a/Shikimori/modules/heroku.py +++ /dev/null @@ -1,232 +0,0 @@ -# Copyright (C) 2021 dihan official - -# This file is part of Mizuhara (Telegram Bot) - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. - -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - - - -import asyncio -import math -import os - -import heroku3 -import requests - -from Shikimori import DEV_USERS, telethn as HEROKU_APP_NAME, HEROKU_API_KEY -from Shikimori.events import register - -heroku_api = "https://api.heroku.com" -Heroku = heroku3.from_key(HEROKU_API_KEY) - - -@register(pattern="^/(set|see|del) var(?: |$)(.*)(?: |$)([\s\S]*)") -async def variable(var): - if var.fwd_from: - return - if var.sender_id == DEV_USERS: - pass - else: - return - """ - Manage most of ConfigVars setting, set new var, get current var, - or delete var... - """ - if HEROKU_APP_NAME is not None: - app = Heroku.app(HEROKU_APP_NAME) - else: - return await var.reply("`[HEROKU]:" "\nPlease setup your` **HEROKU_APP_NAME**") - exe = var.pattern_match.group(1) - heroku_var = app.config() - if exe == "see": - k = await var.reply("`Getting information...`") - await asyncio.sleep(1.5) - try: - variable = var.pattern_match.group(2).split()[0] - if variable in heroku_var: - return await k.edit( - "**ConfigVars**:" f"\n\n`{variable} = {heroku_var[variable]}`\n" - ) - else: - return await k.edit( - "**ConfigVars**:" f"\n\n`Error:\n-> {variable} don't exists`" - ) - except IndexError: - configs = prettyjson(heroku_var.to_dict(), indent=2) - with open("configs.json", "w") as fp: - fp.write(configs) - with open("configs.json", "r") as fp: - result = fp.read() - if len(result) >= 4096: - await var.client.send_file( - var.chat_id, - "configs.json", - reply_to=var.id, - caption="`Output too large, sending it as a file`", - ) - else: - await k.edit( - "`[HEROKU]` ConfigVars:\n\n" - "================================" - f"\n```{result}```\n" - "================================" - ) - os.remove("configs.json") - return - elif exe == "set": - s = await var.reply("`Setting information...weit ser`") - variable = var.pattern_match.group(2) - if not variable: - return await s.edit(">`.set var `") - value = var.pattern_match.group(3) - if not value: - variable = variable.split()[0] - try: - value = var.pattern_match.group(2).split()[1] - except IndexError: - return await s.edit(">`/set var `") - await asyncio.sleep(1.5) - if variable in heroku_var: - await s.edit( - f"**{variable}** `successfully changed to` -> **{value}**" - ) - else: - await s.edit( - f"**{variable}** `successfully added with value` -> **{value}**" - ) - heroku_var[variable] = value - elif exe == "del": - m = await var.edit("`Getting information to deleting variable...`") - try: - variable = var.pattern_match.group(2).split()[0] - except IndexError: - return await m.edit("`Please specify ConfigVars you want to delete`") - await asyncio.sleep(1.5) - if variable in heroku_var: - await m.edit(f"**{variable}** `successfully deleted`") - del heroku_var[variable] - else: - return await m.edit(f"**{variable}** `is not exists`") - - -@register(pattern="^/usage(?: |$)") -async def dyno_usage(dyno): - if dyno.fwd_from: - return - if dyno.sender_id == DEV_USERS: - pass - else: - return - """ - Get your account Dyno Usage - """ - die = await dyno.reply("Processing..") - useragent = ( - "Mozilla/5.0 (Linux; Android 10; SM-G975F) " - "AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/80.0.3987.149 Mobile Safari/537.36" - ) - user_id = Heroku.account().id - headers = { - "User-Agent": useragent, - "Authorization": f"Bearer {HEROKU_API_KEY}", - "Accept": "application/vnd.heroku+json; version=3.account-quotas", - } - path = "/accounts/" + user_id + "/actions/get-quota" - r = requests.get(heroku_api + path, headers=headers) - if r.status_code != 200: - return await die.edit( - "`Error: something bad happened`\n\n" f">.`{r.reason}`\n" - ) - result = r.json() - quota = result["account_quota"] - quota_used = result["quota_used"] - - """ - Used - """ - remaining_quota = quota - quota_used - percentage = math.floor(remaining_quota / quota * 100) - minutes_remaining = remaining_quota / 60 - hours = math.floor(minutes_remaining / 60) - minutes = math.floor(minutes_remaining % 60) - - """ - Current - """ - App = result["apps"] - try: - App[0]["quota_used"] - except IndexError: - AppQuotaUsed = 0 - AppPercentage = 0 - else: - AppQuotaUsed = App[0]["quota_used"] / 60 - AppPercentage = math.floor(App[0]["quota_used"] * 100 / quota) - AppHours = math.floor(AppQuotaUsed / 60) - AppMinutes = math.floor(AppQuotaUsed % 60) - - await asyncio.sleep(1.5) - - return await die.edit( - "**Dyno Usage**:\n\n" - f" -> `Dyno usage for` **{HEROKU_APP_NAME}**:\n" - f" • `{AppHours}`**h** `{AppMinutes}`**m** " - f"**|** [`{AppPercentage}`**%**]" - "\n\n" - " -> `Dyno hours quota remaining this month`:\n" - f" • `{hours}`**h** `{minutes}`**m** " - f"**|** [`{percentage}`**%**]" - ) - - -@register(pattern="^/logs$") -async def _(dyno): - if dyno.fwd_from: - return - if dyno.sender_id == DEV_USERS: - pass - else: - return - try: - Heroku = heroku3.from_key(HEROKU_API_KEY) - app = Heroku.app(HEROKU_APP_NAME) - except: - return await dyno.reply( - " Please make sure your Heroku API Key, Your App name are configured correctly in the heroku" - ) - v = await dyno.reply("Getting Logs....") - with open("logs.txt", "w") as log: - log.write(app.get_log()) - await v.edit("Got the logs wait a sec") - await dyno.client.send_file( - dyno.chat_id, - "logs.txt", - reply_to=dyno.id, - caption="Shikimori Bot Logs.", - ) - - await asyncio.sleep(5) - await v.delete() - return os.remove("logs.txt") - - -def prettyjson(obj, indent=2, maxlinelength=80): - """Renders JSON content with indentation and line splits/concatenations to fit maxlinelength. - Only dicts, lists and basic types are supported""" - - items, _ = getsubitems( - obj, - itemkey="", - islast=True, - maxlinelength=maxlinelength - indent, - indent=indent, - ) - return indentitems(items, indent, level=0) diff --git a/Shikimori/modules/imgeditor.py b/Shikimori/modules/imgeditor.py deleted file mode 100644 index 409ec217..00000000 --- a/Shikimori/modules/imgeditor.py +++ /dev/null @@ -1,460 +0,0 @@ -# By @TroJanzHEX -# Improved by TeamDaisyX - -from pyrogram import filters -from pyrogram.types import ( - CallbackQuery, - InlineKeyboardButton, - InlineKeyboardMarkup, - Message, -) - -# By @TroJanzHEX -from Shikimori.Extras.ImageEditor.edit_1 import ( # pylint:disable=import-error - black_white, - box_blur, - bright, - g_blur, - mix, - normal_blur, -) -from Shikimori.Extras.ImageEditor.edit_2 import ( # pylint:disable=import-error - cartoon, - circle_with_bg, - circle_without_bg, - contrast, - edge_curved, - pencil, - sepia_mode, - sticker, -) -from Shikimori.Extras.ImageEditor.edit_3 import ( # pylint:disable=import-error - black_border, - blue_border, - green_border, - red_border, -) -from Shikimori.Extras.ImageEditor.edit_4 import ( # pylint:disable=import-error - inverted, - removebg_plain, - removebg_sticker, - removebg_white, - rotate_90, - rotate_180, - rotate_270, - round_sticker, -) -from Shikimori.Extras.ImageEditor.edit_5 import ( # pylint:disable=import-error - normalglitch_1, - normalglitch_2, - normalglitch_3, - normalglitch_4, - normalglitch_5, - scanlineglitch_1, - scanlineglitch_2, - scanlineglitch_3, - scanlineglitch_4, - scanlineglitch_5, -) -from Shikimori import pbot - -lel = 00000000 -# pylint:disable=import-error -@pbot.on_message(filters.command(["edit", "editor"])) -async def photo(client: pbot, message: Message): - try: - if not message.reply_to_message.photo: - await client.send_message(message.chat.id, "Reply to an image man!ㅤㅤ") - return - except: - return - global lel - try: - lel = message.from_user.id - except: - return - try: - await client.send_message( - chat_id=message.chat.id, - text="Select your required mode from below!ㅤㅤ", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton(text="💡 BRIGHT", callback_data="bright"), - InlineKeyboardButton(text="🖼 MIXED", callback_data="mix"), - InlineKeyboardButton(text="🔳 B&W", callback_data="b|w"), - ], - [ - InlineKeyboardButton(text="🟡 CIRCLE", callback_data="circle"), - InlineKeyboardButton(text="🩸 BLUR", callback_data="blur"), - InlineKeyboardButton(text="🌌 BORDER", callback_data="border"), - ], - [ - InlineKeyboardButton(text="🎉 STICKER", callback_data="stick"), - InlineKeyboardButton(text="↩️ ROTATE", callback_data="rotate"), - InlineKeyboardButton( - text="🔦 CONTRAST", callback_data="contrast" - ), - ], - [ - InlineKeyboardButton(text="🌇 SEPIA", callback_data="sepia"), - InlineKeyboardButton(text="✏️ PENCIL", callback_data="pencil"), - InlineKeyboardButton(text="🐶 CARTOON", callback_data="cartoon"), - ], - [ - InlineKeyboardButton(text="🔄 INVERT", callback_data="inverted"), - InlineKeyboardButton(text="🔮 GLITCH", callback_data="glitch"), - InlineKeyboardButton( - text="✂️ REMOVE BG", callback_data="removebg" - ), - ], - [ - InlineKeyboardButton(text="❌ CLOSE", callback_data="close_e"), - ], - ] - ), - reply_to_message_id=message.reply_to_message_id, - ) - except Exception as e: - print("photomarkup error - " + str(e)) - if "USER_IS_BLOCKED" in str(e): - return - else: - try: - await message.reply_text("Something went wrong!", quote=True) - except Exception: - return - - -@pbot.on_callback_query() -async def cb_handler(client: pbot, query: CallbackQuery): - user_id = query.from_user.id - if lel == user_id: - if query.data == "removebg": - await query.message.edit_text( - "**Select required mode**ㅤㅤㅤㅤ", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton( - text="WITH WHITE BG", callback_data="rmbgwhite" - ), - InlineKeyboardButton( - text="WITHOUT BG", callback_data="rmbgplain" - ), - ], - [ - InlineKeyboardButton( - text="STICKER", callback_data="rmbgsticker" - ) - ], - ] - ), - ) - elif query.data == "stick": - await query.message.edit( - "**Select a Type**", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton(text="Normal", callback_data="stkr"), - InlineKeyboardButton( - text="Edge Curved", callback_data="cur_ved" - ), - ], - [ - InlineKeyboardButton( - text="Circle", callback_data="circle_sticker" - ) - ], - ] - ), - ) - elif query.data == "rotate": - await query.message.edit_text( - "**Select the Degree**", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton(text="180", callback_data="180"), - InlineKeyboardButton(text="90", callback_data="90"), - ], - [InlineKeyboardButton(text="270", callback_data="270")], - ] - ), - ) - - elif query.data == "glitch": - await query.message.edit_text( - "**Select required mode**ㅤㅤㅤㅤ", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton( - text="NORMAL", callback_data="normalglitch" - ), - InlineKeyboardButton( - text="SCAN LINES", callback_data="scanlineglitch" - ), - ] - ] - ), - ) - elif query.data == "normalglitch": - await query.message.edit_text( - "**Select Glitch power level**", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton( - text="1", callback_data="normalglitch1" - ), - InlineKeyboardButton( - text="2", callback_data="normalglitch2" - ), - InlineKeyboardButton( - text="3", callback_data="normalglitch3" - ), - ], - [ - InlineKeyboardButton( - text="4", callback_data="normalglitch4" - ), - InlineKeyboardButton( - text="5", callback_data="normalglitch5" - ), - ], - ] - ), - ) - elif query.data == "scanlineglitch": - await query.message.edit_text( - "**Select Glitch power level**", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton( - text="1", callback_data="scanlineglitch1" - ), - InlineKeyboardButton( - text="2", callback_data="scanlineglitch2" - ), - InlineKeyboardButton( - text="3", callback_data="scanlineglitch3" - ), - ], - [ - InlineKeyboardButton( - text="4", callback_data="scanlineglitch4" - ), - InlineKeyboardButton( - text="5", callback_data="scanlineglitch5" - ), - ], - ] - ), - ) - elif query.data == "blur": - await query.message.edit( - "**Select a Type**", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton(text="box", callback_data="box"), - InlineKeyboardButton(text="normal", callback_data="normal"), - ], - [InlineKeyboardButton(text="Gaussian", callback_data="gas")], - ] - ), - ) - elif query.data == "circle": - await query.message.edit_text( - "**Select required mode**", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton( - text="WITH BG", callback_data="circlewithbg" - ), - InlineKeyboardButton( - text="WITHOUT BG", callback_data="circlewithoutbg" - ), - ] - ] - ), - ) - elif query.data == "border": - await query.message.edit( - "**Select Border**", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton(text="🔴 RED 🔴", callback_data="red"), - InlineKeyboardButton( - text="🟢 Green 🟢", callback_data="green" - ), - ], - [ - InlineKeyboardButton( - text="⚫ Black ⚫", callback_data="black" - ), - InlineKeyboardButton(text="🔵 Blue 🔵", callback_data="blue"), - ], - ] - ), - ) - - elif query.data == "bright": - await query.message.delete() - await bright(client, query.message) - - elif query.data == "close_e": - await query.message.delete() - - elif query.data == "mix": - await query.message.delete() - await mix(client, query.message) - - elif query.data == "b|w": - await query.message.delete() - await black_white(client, query.message) - - elif query.data == "circlewithbg": - await query.message.delete() - await circle_with_bg(client, query.message) - - elif query.data == "circlewithoutbg": - await query.message.delete() - await circle_without_bg(client, query.message) - - elif query.data == "green": - await query.message.delete() - await green_border(client, query.message) - - elif query.data == "blue": - await query.message.delete() - await blue_border(client, query.message) - - elif query.data == "red": - await query.message.delete() - await red_border(client, query.message) - - elif query.data == "black": - await query.message.delete() - await black_border(client, query.message) - - elif query.data == "circle_sticker": - await query.message.delete() - await round_sticker(client, query.message) - - elif query.data == "inverted": - await query.message.delete() - await inverted(client, query.message) - - elif query.data == "stkr": - await query.message.delete() - await sticker(client, query.message) - - elif query.data == "cur_ved": - await query.message.delete() - await edge_curved(client, query.message) - - elif query.data == "90": - await query.message.delete() - await rotate_90(client, query.message) - - elif query.data == "180": - await query.message.delete() - await rotate_180(client, query.message) - - elif query.data == "270": - await query.message.delete() - await rotate_270(client, query.message) - - elif query.data == "contrast": - await query.message.delete() - await contrast(client, query.message) - - elif query.data == "box": - await query.message.delete() - await box_blur(client, query.message) - - elif query.data == "gas": - await query.message.delete() - await g_blur(client, query.message) - - elif query.data == "normal": - await query.message.delete() - await normal_blur(client, query.message) - - elif query.data == "sepia": - await query.message.delete() - await sepia_mode(client, query.message) - - elif query.data == "pencil": - await query.message.delete() - await pencil(client, query.message) - - elif query.data == "cartoon": - await query.message.delete() - await cartoon(client, query.message) - - elif query.data == "normalglitch1": - await query.message.delete() - await normalglitch_1(client, query.message) - - elif query.data == "normalglitch2": - await query.message.delete() - await normalglitch_2(client, query.message) - - elif query.data == "normalglitch3": - await normalglitch_3(client, query.message) - - elif query.data == "normalglitch4": - await query.message.delete() - await normalglitch_4(client, query.message) - - elif query.data == "normalglitch5": - await query.message.delete() - await normalglitch_5(client, query.message) - - elif query.data == "scanlineglitch1": - await query.message.delete() - await scanlineglitch_1(client, query.message) - - elif query.data == "scanlineglitch2": - await query.message.delete() - await scanlineglitch_2(client, query.message) - - elif query.data == "scanlineglitch3": - await query.message.delete() - await scanlineglitch_3(client, query.message) - - elif query.data == "scanlineglitch4": - await query.message.delete() - await scanlineglitch_4(client, query.message) - - elif query.data == "scanlineglitch5": - await query.message.delete() - await scanlineglitch_5(client, query.message) - - elif query.data == "rmbgwhite": - await query.message.delete() - await removebg_white(client, query.message) - - elif query.data == "rmbgplain": - await query.message.delete() - await removebg_plain(client, query.message) - - elif query.data == "rmbgsticker": - await removebg_sticker(client, query.message) - - -__mod_name__ = "Img Editor​ 📸" - -__help__ = """ -❍ `/edit` : To edit the image. -❍ `/editor` : To edit the image. - -Note: Remove BG doesn't work, dev will fix it later. -""" diff --git a/Shikimori/modules/info.py b/Shikimori/modules/info.py index 51d5bf30..53d2e37a 100644 --- a/Shikimori/modules/info.py +++ b/Shikimori/modules/info.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os from pyrogram import filters from pyrogram.types import Message diff --git a/Shikimori/modules/inlinebot.py b/Shikimori/modules/inlinebot.py deleted file mode 100644 index e57afa54..00000000 --- a/Shikimori/modules/inlinebot.py +++ /dev/null @@ -1,1000 +0,0 @@ -import datetime -import re -import time -import urllib.request -import requests -import aiohttp - -from datetime import datetime -from typing import List -from bs4 import BeautifulSoup -from countryinfo import CountryInfo -from faker import Faker -from faker.providers import internet -from PyDictionary import PyDictionary -from pyrogram import errors, filters -from pyrogram.types import ( - InlineKeyboardButton, - InlineKeyboardMarkup, - InlineQueryResultArticle, - InlineQueryResultPhoto, - InputTextMessageContent, -) -from search_engine_parser import GoogleSearch -from tswift import Song -from youtubesearchpython import VideosSearch - -from Shikimori.utils.inlinehelper import * -from Shikimori.utils.pluginhelpers import fetch, json_prettify -from Shikimori import pbot, API_WEATHER, TIME_API_KEY, SUPPORT_CHAT, BOT_USERNAME - -dictionary = PyDictionary() - - -class AioHttp: - @staticmethod - async def get_json(link): - async with aiohttp.ClientSession() as session, session.get(link) as resp: - return await resp.json() - - @staticmethod - async def get_text(link): - async with aiohttp.ClientSession() as session, session.get(link) as resp: - return await resp.text() - - @staticmethod - async def get_raw(link): - async with aiohttp.ClientSession() as session, session.get(link) as resp: - return await resp.read() - - -__mod_name__ = "Inline" -__help__ = f""" -INLINE BOT SERVICE OF @{BOT_USERNAME} -I'm more efficient when added as group admin. By the way these commands can be used by anyone in a group via inline. -──「 Syntax 」── - @{BOT_USERNAME} [command] [query] -──「 Commands Available 」── -➛ alive - Check Bot's Stats. -➛ yt [query] - Youtube Search. -➛ tr [LANGUAGE_CODE] [QUERY]** - Translate Text. -➛ modapk [name] - Give you direct link of mod apk. -➛ ud [QUERY] - Urban Dictionary Query -➛ google [QUERY] - Google Search. -➛ webss [URL] - Take Screenshot Of A Website. -➛ bitly [URL] - Shorten A Link. -➛ wall [Query] - Find Wallpapers. -➛ pic [Query] - Find pictures. -➛ saavn [SONG_NAME] - Get Songs From Saavn. -➛ deezer [SONG_NAME] - Get Songs From Deezer. -➛ torrent [QUERY] - Torrent Search. -➛ reddit [QUERY] - Get memes from reddit. -➛ imdb [QUERY] - Search movies on imdb. -➛ spaminfo [ID] - Get spam info of the user. -➛ lyrics [QUERY] - Get lyrics of the song. -➛ paste [TEXT] - Paste text on pastebin. -➛ define [WORD] - Get definition from Dictionary. -➛ synonyms [WORD] - Get synonyms from Dictionary. -➛ antonyms [WORD] - Get antonyms from Dictionary. -➛ country [QUERY] - Get Information about given country. -➛ cs - Gathers Cricket info (Globally). -➛ covid [COUNTRY] - Get covid updates of given country. -➛ fakegen - Gathers fake information. -➛ weather [QUERY] - Get weather information. -➛ datetime [QUERY] - Get Date & time information of given country/region. -➛ app [QUERY] - Search for apps in playstore. -➛ gh [QUERY] - Search github. -➛ so [QUERY] - Search stack overflow. -➛ wiki [QUERY] - Search wikipedia. -➛ ping - Check ping rate. -➛ pokedex [TEXT]: Pokemon Search -""" - -__MODULE__ = "Inline" -__HELP__ = f""" - ==>> **INLINE BOT SERVICE OF @{BOT_USERNAME}** <<== -`I'm more efficient when added as group admin. By the way these commands can be used by anyone in a group via inline.` - >> Syntax << -@{BOT_USERNAME} [command] [query] - >> Commands Available << -- **alive** - __Check Bot's Stats.__ -- **yt [query]** - __Youtube Search.__ -- **tr [LANGUAGE_CODE] [QUERY]** - __Translate Text.__ -- **ud [QUERY]** - __Urban Dictionary Query.__ -- **google [QUERY]** - __Google Search.__ -- **modapk [name]** - __Give you direct link of mod apk__ -- **webss [URL]** - __Take Screenshot Of A Website.__ -- **bitly [URL]** - __Shorten A Link.__ -- **wall [Query]** - __Find Wallpapers.__ -- **pic [Query]** - __Find pictures.__ -- **saavn [SONG_NAME]** - __Get Songs From Saavn.__ -- **deezer [SONG_NAME]** - __Get Songs From Deezer.__ -- **torrent [QUERY]** - __Torrent Search.__ -- **reddit [QUERY]** - __Get memes from redit.__ -- **imdb [QUERY]** - __Search movies on imdb.__ -- **spaminfo [id]** - __Get spam info of the user.__ -- **lyrics [QUERY]** - __Get lyrics of given song.__ -- **paste [TEXT]** - __Paste text on pastebin.__ -- **define [WORD]** - __Get definition from Dictionary.__ -- **synonyms [WORD]** - __Get synonyms from Dictionary.__ -- **antonyms [WORD]** - __Get antonyms from Dictionary.__ -- **country [QUERY]** - __Get Information about given country.__ -- **cs** - __Gathers Cricket info (Globally).__ -- **covid [COUNTRY]** - __Get covid updates of given country.__ -- **fakegen** - __Gathers fake information.__ -- **weather [QUERY]** - __Get weather information.__ -- **datetime [QUERY]** - __Get Date & time information of given country/region.__ -- **app [QUERY]** - __Search for apps on playstore. -- **gh [QUERY]** - __Search github.__ -- **so [QUERY]** - __Search stack overfolw.__ -- **wiki [QUERY]** - __Search wikipedia.__ -- **ping** - __Check ping rate.__ -- **pokedex [TEXT]** - __Pokemon Search.__ -""" - - -@pbot.on_message(filters.command("inline")) -async def inline_help(_, message): - await pbot.send_message(message.chat.id, text=__HELP__) - - -@pbot.on_inline_query() -async def inline_query_handler(client, query): - try: - text = query.query.lower() - answers = [] - if text.strip() == "": - answerss = await inline_help_func(__HELP__) - await client.answer_inline_query(query.id, results=answerss, cache_time=10) - return - if text.split()[0] == "alive": - answerss = await alive_function(answers) - await client.answer_inline_query(query.id, results=answerss, cache_time=10) - elif text.split()[0] == "tr": - lang = text.split()[1] - tex = text.split(None, 2)[2] - answerss = await translate_func(answers, lang, tex) - await client.answer_inline_query(query.id, results=answerss, cache_time=10) - elif text.split()[0] == "ud": - tex = text.split(None, 1)[1] - answerss = await urban_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss, cache_time=10) - elif text.split()[0] == "google": - tex = text.split(None, 1)[1] - answerss = await google_search_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss, cache_time=10) - elif text.split()[0] == "webss": - tex = text.split(None, 1)[1] - answerss = await webss(tex) - await client.answer_inline_query(query.id, results=answerss, cache_time=2) - elif text.split()[0] == "bitly": - tex = text.split(None, 1)[1] - answerss = await shortify(tex) - await client.answer_inline_query(query.id, results=answerss, cache_time=2) - elif text.split()[0] == "wiki": - if len(text.split()) < 2: - await client.answer_inline_query( - query.id, - results=answers, - switch_pm_text="Wikipedia | wiki [QUERY]", - switch_pm_parameter="inline", - ) - return - tex = text.split(None, 1)[1].strip() - answerss = await wiki_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss, cache_time=2) - - elif text.split()[0] == "ping": - answerss = await ping_func(answers) - await client.answer_inline_query(query.id, results=answerss, cache_time=2) - return - - elif text.split()[0] == "yt": - answers = [] - search_query = text.split(None, 1)[1] - search_query = query.query.lower().strip().rstrip() - - if search_query == "": - await client.answer_inline_query( - query.id, - results=answers, - switch_pm_text="Type a YouTube video name...", - switch_pm_parameter="help", - cache_time=0, - ) - else: - search = VideosSearch(search_query, limit=50) - - for result in search.result()["result"]: - answers.append( - InlineQueryResultArticle( - title=result["title"], - description="{}, {} views.".format( - result["duration"], result["viewCount"]["short"] - ), - input_message_content=InputTextMessageContent( - "https://www.youtube.com/watch?v={}".format( - result["id"] - ) - ), - thumb_url=result["thumbnails"][0]["url"], - ) - ) - - try: - await query.answer(results=answers, cache_time=0) - except errors.QueryIdInvalid: - await query.answer( - results=answers, - cache_time=0, - switch_pm_text="Error: Search timed out", - switch_pm_parameter="", - ) - - elif text.split()[0] == "wall": - tex = text.split(None, 1)[1] - answerss = await wall_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss) - - elif text.split()[0] == "pic": - tex = text.split(None, 1)[1] - answerss = await wall_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss) - - elif text.split()[0] == "saavn": - tex = text.split(None, 1)[1] - answerss = await saavn_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss) - - elif text.split()[0] == "deezer": - tex = text.split(None, 1)[1] - answerss = await deezer_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss) - - elif text.split()[0] == "torrent": - tex = text.split(None, 1)[1] - answerss = await torrent_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss, cache_time=10) - elif text.split()[0] == "modapk": - sgname = text.split(None, 1)[1] - PabloEscobar = ( - f"https://an1.com/tags/MOD/?story={sgname}&do=search&subaction=search" - ) - r = requests.get(PabloEscobar) - results = [] - soup = BeautifulSoup(r.content, "html5lib") - mydivs = soup.find_all("div", {"class": "search-results"}) - Pop = soup.find_all("div", {"class": "title"}) - cnte = len(mydivs) - for cnt in range(cnte): - sucker = mydivs[cnt] - pH9 = sucker.find("a").contents[0] - file_name = pH9 - pH = sucker.findAll("img") - imme = pH[0]["src"] - Pablo = Pop[0].a["href"] - ro = requests.get(Pablo) - soupe = BeautifulSoup(ro.content, "html5lib") - myopo = soupe.find_all("div", {"class": "item"}) - capt = f"**{file_name}** \n** {myopo[0].text}**\n**{myopo[1].text}**\n**{myopo[2].text}**\n**{myopo[3].text}**" - mydis0 = soupe.find_all("a", {"class": "get-product"}) - Lol9 = mydis0[0] - lemk = "https://an1.com" + Lol9["href"] - rr = requests.get(lemk) - soup = BeautifulSoup(rr.content, "html5lib") - script = soup.find("script", type="text/javascript") - leek = re.search(r'href=[\'"]?([^\'" >]+)', script.text).group() - dl_link = leek[5:] - - results.append( - InlineQueryResultPhoto( - photo_url=imme, - title=file_name, - caption=capt, - reply_markup=InlineKeyboardMarkup( - [ - [InlineKeyboardButton("Download Link", url=lemk)], - [ - InlineKeyboardButton( - "Direct Download Link", url=dl_link - ) - ], - ] - ), - ) - ) - - await client.answer_inline_query(query.id, cache_time=0, results=results) - elif text.split()[0] == "reddit": - subreddit = text.split(None, 1)[1] - results = [] - reddit = await arq.reddit(subreddit) - sreddit = reddit.subreddit - title = reddit.title - image = reddit.url - link = reddit.postLink - caption = f"""**Title:** `{title}` - Subreddit: `{sreddit}`""" - results.append( - InlineQueryResultPhoto( - photo_url=image, - title="Meme Search", - caption=caption, - reply_markup=InlineKeyboardMarkup( - [ - [InlineKeyboardButton("PostLink", url=link)], - ] - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - elif text.split()[0] == "imdb": - movie_name = text.split(None, 1)[1] - results = [] - remove_space = movie_name.split(" ") - final_name = "+".join(remove_space) - page = requests.get( - "https://www.imdb.com/find?ref_=nv_sr_fn&q=" + final_name + "&s=all" - ) - str(page.status_code) - soup = BeautifulSoup(page.content, "lxml") - odds = soup.findAll("tr", "odd") - mov_title = odds[0].findNext("td").findNext("td").text - mov_link = ( - "http://www.imdb.com/" + odds[0].findNext("td").findNext("td").a["href"] - ) - page1 = requests.get(mov_link) - soup = BeautifulSoup(page1.content, "lxml") - if soup.find("div", "poster"): - poster = soup.find("div", "poster").img["src"] - else: - poster = "" - if soup.find("div", "title_wrapper"): - pg = soup.find("div", "title_wrapper").findNext("div").text - mov_details = re.sub(r"\s+", " ", pg) - else: - mov_details = "" - credits = soup.findAll("div", "credit_summary_item") - director = credits[0].a.text - if len(credits) == 1: - writer = "Not available" - stars = "Not available" - elif len(credits) > 2: - writer = credits[1].a.text - actors = [x.text for x in credits[2].findAll("a")] - actors.pop() - stars = actors[0] + "," + actors[1] + "," + actors[2] - else: - writer = "Not available" - actors = [] - for x in credits[1].findAll("a"): - actors.append(x.text) - actors.pop() - stars = actors[0] + "," + actors[1] + "," + actors[2] - if soup.find("div", "inline canwrap"): - story_line = soup.find("div", "inline canwrap").findAll("p")[0].text - else: - story_line = "Not available" - info = soup.findAll("div", "txt-block") - if info: - mov_country = [] - mov_language = [] - for node in info: - a = node.findAll("a") - for i in a: - if "country_of_origin" in i["href"]: - mov_country.append(i.text) - elif "primary_language" in i["href"]: - mov_language.append(i.text) - if soup.findAll("div", "ratingValue"): - for r in soup.findAll("div", "ratingValue"): - mov_rating = r.strong["title"] - else: - mov_rating = "Not available" - lol = f"Movie - {mov_title}\n Click to see more" - msg = ( - "" - "Title : " - + mov_title - + "\n" - + mov_details - + "\nRating : " - + mov_rating - + "\nCountry : " - + mov_country[0] - + "\nLanguage : " - + mov_language[0] - + "\nDirector : " - + director - + "\nWriter : " - + writer - + "\nStars : " - + stars - + "\nIMDB Url : " - + mov_link - + "\nStory Line : " - + story_line - ) - results.append( - InlineQueryResultArticle( - title="Imdb Search", - description=lol, - input_message_content=InputTextMessageContent( - msg, disable_web_page_preview=False, parse_mode="HTML" - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - elif text.split()[0] == "spaminfo": - cmd = text.split(None, 1)[1] - results = [] - url = f"https://api.intellivoid.net/spamprotection/v1/lookup?query={cmd}" - a = await AioHttp().get_json(url) - response = a["success"] - if response is True: - date = a["results"]["last_updated"] - stats = "**◢ Intellivoid• SpamProtection Info**:\n" - stats += f' ❍ **Updated on**: `{datetime.fromtimestamp(date).strftime("%Y-%m-%d %I:%M:%S %p")}`\n' - stats += f" ❍ **Chat Info**: [Link](https://telegram.dog/SpamProtectionBot/?start=00_{cmd})\n" - - if a["results"]["attributes"]["is_potential_spammer"] is True: - stats += " ❍ **User**: `USERxSPAM`\n" - elif a["results"]["attributes"]["is_operator"] is True: - stats += " ❍ **User**: `USERxOPERATOR`\n" - elif a["results"]["attributes"]["is_agent"] is True: - stats += " ❍ **User**: `USERxAGENT`\n" - elif a["results"]["attributes"]["is_whitelisted"] is True: - stats += " ❍ **User**: `USERxWHITELISTED`\n" - - stats += f' ❍ **Type**: `{a["results"]["entity_type"]}`\n' - stats += f' ❍ **Language**: `{a["results"]["language_prediction"]["language"]}`\n' - stats += f' ❍ **Language Probability**: `{a["results"]["language_prediction"]["probability"]}`\n' - stats += "**Spam Prediction**:\n" - stats += f' ❍ **Ham Prediction**: `{a["results"]["spam_prediction"]["ham_prediction"]}`\n' - stats += f' ❍ **Spam Prediction**: `{a["results"]["spam_prediction"]["spam_prediction"]}`\n' - stats += f'**Blacklisted**: `{a["results"]["attributes"]["is_blacklisted"]}`\n' - if a["results"]["attributes"]["is_blacklisted"] is True: - stats += f' ❍ **Reason**: `{a["results"]["attributes"]["blacklist_reason"]}`\n' - stats += f' ❍ **Flag**: `{a["results"]["attributes"]["blacklist_flag"]}`\n' - stats += f'**PTID**:\n`{a["results"]["private_telegram_id"]}`\n' - results.append( - InlineQueryResultArticle( - title="Spam Info", - description="Search Users spam info", - input_message_content=InputTextMessageContent( - stats, disable_web_page_preview=True - ), - ) - ) - await client.answer_inline_query( - query.id, cache_time=0, results=results - ) - elif text.split()[0] == "lyrics": - cmd = text.split(None, 1)[1] - results = [] - - song = "" - song = Song.find_song(cmd) - if song: - if song.lyrics: - reply = song.format() - else: - reply = "Couldn't find any lyrics for that song! try with artist name along with song if still doesnt work try `.glyrics`" - else: - reply = "lyrics not found! try with artist name along with song if still doesnt work try `.glyrics`" - - if len(reply) > 4095: - reply = "lyrics too big, Try using /lyrics" - - results.append( - InlineQueryResultArticle( - title="Song Lyrics", - description="Click here to see lyrics", - input_message_content=InputTextMessageContent( - reply, disable_web_page_preview=False - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - elif text.split()[0] == "pokedex": - if len(text.split()) < 2: - await client.answer_inline_query( - query.id, - results=answers, - switch_pm_text="Pokemon [text]", - switch_pm_parameter="pokedex", - ) - return - pokedex = text.split(None, 1)[1].strip() - Pokedex = await pokedexinfo(answers, pokedex) - await client.answer_inline_query(query.id, results=Pokedex, cache_time=2) - elif text.split()[0] == "paste": - tex = text.split(None, 1)[1] - answerss = await paste_func(answers, tex) - await client.answer_inline_query(query.id, results=answerss, cache_time=2) - - elif text.split()[0] == "covid": - lel = text.split(None, 1)[1] - results = [] - country = lel.replace(" ", "") - data = await fetch(f"https://corona.lmao.ninja/v2/countries/{country}") - data = await json_prettify(data) - results.append( - InlineQueryResultArticle( - title="Covid Info Gathered succesfully", - description=data, - input_message_content=InputTextMessageContent( - data, disable_web_page_preview=False - ), - ) - ) - await client.answer_inline_query(query.id, results=results, cache_time=2) - elif text.split()[0] == "country": - lel = text.split(None, 1)[1] - results = [] - country = CountryInfo(lel) - try: - a = country.info() - except: - a = "Country Not Avaiable Currently" - name = a.get("name") - bb = a.get("altSpellings") - hu = "" - for p in bb: - hu += p + ", " - - area = a.get("area") - borders = "" - hell = a.get("borders") - for fk in hell: - borders += fk + ", " - - call = "" - WhAt = a.get("callingCodes") - for what in WhAt: - call += what + " " - - capital = a.get("capital") - currencies = "" - fker = a.get("currencies") - for FKer in fker: - currencies += FKer + ", " - - HmM = a.get("demonym") - geo = a.get("geoJSON") - pablo = geo.get("features") - Pablo = pablo[0] - PAblo = Pablo.get("geometry") - EsCoBaR = PAblo.get("type") - iso = "" - iSo = a.get("ISO") - for hitler in iSo: - po = iSo.get(hitler) - iso += po + ", " - fla = iSo.get("alpha2") - fla.upper() - - languages = a.get("languages") - lMAO = "" - for lmao in languages: - lMAO += lmao + ", " - - nonive = a.get("nativeName") - waste = a.get("population") - reg = a.get("region") - sub = a.get("subregion") - tik = a.get("timezones") - tom = "" - for jerry in tik: - tom += jerry + ", " - - GOT = a.get("tld") - lanester = "" - for targaryen in GOT: - lanester += targaryen + ", " - - wiki = a.get("wiki") - - caption = f"""Information Gathered Successfully - - Country Name:- {name} - Alternative Spellings:- {hu} - Country Area:- {area} square kilometers - Borders:- {borders} - Calling Codes:- {call} - Country's Capital:- {capital} - Country's currency:- {currencies} - Demonym:- {HmM} - Country Type:- {EsCoBaR} - ISO Names:- {iso} - Languages:- {lMAO} - Native Name:- {nonive} - population:- {waste} - Region:- {reg} - Sub Region:- {sub} - Time Zones:- {tom} - Top Level Domain:- {lanester} - wikipedia:- {wiki} - Gathered By @{BOT_USERNAME}. - """ - results.append( - InlineQueryResultArticle( - title=f"Infomation of {name}", - description=f""" - Country Name:- {name} - Alternative Spellings:- {hu} - Country Area:- {area} square kilometers - Borders:- {borders} - Calling Codes:- {call} - Country's Capital:- {capital} - - Touch for more info - """, - input_message_content=InputTextMessageContent( - caption, parse_mode="HTML", disable_web_page_preview=True - ), - ) - ) - await client.answer_inline_query(query.id, results=results, cache_time=2) - - elif text.split()[0] == "fakegen": - results = [] - fake = Faker() - name = str(fake.name()) - fake.add_provider(internet) - address = str(fake.address()) - ip = fake.ipv4_private() - cc = fake.credit_card_full() - email = fake.ascii_free_email() - job = fake.job() - android = fake.android_platform_token() - pc = fake.chrome() - res = 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}" - results.append( - InlineQueryResultArticle( - title="Fake infomation gathered", - description="Click here to see them", - input_message_content=InputTextMessageContent( - res, parse_mode="HTML", disable_web_page_preview=True - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - elif text.split()[0] == "cs": - results = [] - score_page = "http://static.cricinfo.com/rss/livescores.xml" - page = urllib.request.urlopen(score_page) - soup = BeautifulSoup(page, "html.parser") - result = soup.find_all("description") - Sed = "" - for match in result: - Sed += match.get_text() + "\n\n" - res = f"Match information gathered successful\n\n\n{Sed}" - results.append( - InlineQueryResultArticle( - title="Match information gathered", - description="Click here to see them", - input_message_content=InputTextMessageContent( - res, parse_mode="HTML", disable_web_page_preview=False - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - elif text.split()[0] == "antonyms": - results = [] - lel = text.split(None, 1)[1] - word = f"{lel}" - let = dictionary.antonym(word) - set = str(let) - jet = set.replace("{", "") - net = jet.replace("}", "") - got = net.replace("'", "") - results.append( - InlineQueryResultArticle( - title=f"antonyms for {lel}", - description=got, - input_message_content=InputTextMessageContent( - got, disable_web_page_preview=False - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - elif text.split()[0] == "synonyms": - results = [] - lel = text.split(None, 1)[1] - word = f"{lel}" - let = dictionary.synonym(word) - set = str(let) - jet = set.replace("{", "") - net = jet.replace("}", "") - got = net.replace("'", "") - results.append( - InlineQueryResultArticle( - title=f"antonyms for {lel}", - description=got, - input_message_content=InputTextMessageContent( - got, disable_web_page_preview=False - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - elif text.split()[0] == "define": - results = [] - lel = text.split(None, 1)[1] - word = f"{lel}" - let = dictionary.meaning(word) - set = str(let) - jet = set.replace("{", "") - net = jet.replace("}", "") - got = net.replace("'", "") - results.append( - InlineQueryResultArticle( - title=f"Definition for {lel}", - description=got, - input_message_content=InputTextMessageContent( - got, disable_web_page_preview=False - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - elif text.split()[0] == "weather": - results = [] - sample_url = "https://api.openweathermap.org/data/2.5/weather?q={}&APPID={}&units=metric" - input_str = text.split(None, 1)[1] - async with aiohttp.ClientSession() as session: - response_api_zero = await session.get( - sample_url.format(input_str, API_WEATHER) - ) - response_api = await response_api_zero.json() - if response_api["cod"] == 200: - country_code = response_api["sys"]["country"] - country_time_zone = int(response_api["timezone"]) - sun_rise_time = int(response_api["sys"]["sunrise"]) + country_time_zone - sun_set_time = int(response_api["sys"]["sunset"]) + country_time_zone - lol = """ - WEATHER INFO GATHERED - Location: {} - Temperature ☀️: {}°С - minimium: {}°С - maximum : {}°С - Humidity 🌤**: {}% - Wind 💨: {}m/s - Clouds ☁️: {}hpa - Sunrise 🌤: {} {} - Sunset 🌝: {} {}""".format( - input_str, - response_api["main"]["temp"], - response_api["main"]["temp_min"], - response_api["main"]["temp_max"], - response_api["main"]["humidity"], - response_api["wind"]["speed"], - response_api["clouds"]["all"], - # response_api["main"]["pressure"], - time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(sun_rise_time)), - country_code, - time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(sun_set_time)), - country_code, - ) - results.append( - InlineQueryResultArticle( - title="Weather Information", - description=lol, - input_message_content=InputTextMessageContent( - lol, disable_web_page_preview=True - ), - ) - ) - await client.answer_inline_query( - query.id, cache_time=0, results=results - ) - - elif text.split()[0] == "datetime": - results = [] - gay = text.split(None, 1)[1] - lel = gay - query_timezone = lel.lower() - if len(query_timezone) == 2: - result = generate_time(query_timezone, ["countryCode"]) - else: - result = generate_time(query_timezone, ["zoneName", "countryName"]) - - if not result: - result = f"Timezone info not available for {lel}" - - results.append( - InlineQueryResultArticle( - title=f"Date & Time info of {lel}", - description=result, - input_message_content=InputTextMessageContent( - result, disable_web_page_preview=False, parse_mode="html" - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - elif text.split()[0] == "app": - rip = [] - app_name = text.split(None, 1)[1] - remove_space = app_name.split(" ") - final_name = "+".join(remove_space) - page = requests.get( - "https://play.google.com/store/search?q=" + final_name + "&c=apps" - ) - str(page.status_code) - soup = BeautifulSoup(page.content, "lxml", from_encoding="utf-8") - results = soup.findAll("div", "ZmHEEd") - app_name = ( - results[0] - .findNext("div", "Vpfmgd") - .findNext("div", "WsMG1c nnK0zc") - .text - ) - app_dev = ( - results[0].findNext("div", "Vpfmgd").findNext("div", "KoLSrc").text - ) - app_dev_link = ( - "https://play.google.com" - + results[0].findNext("div", "Vpfmgd").findNext("a", "mnKHRc")["href"] - ) - app_rating = ( - results[0] - .findNext("div", "Vpfmgd") - .findNext("div", "pf5lIe") - .find("div")["aria-label"] - ) - app_link = ( - "https://play.google.com" - + results[0] - .findNext("div", "Vpfmgd") - .findNext("div", "vU6FJ p63iDd") - .a["href"] - ) - app_icon = ( - results[0] - .findNext("div", "Vpfmgd") - .findNext("div", "uzcko") - .img["data-src"] - ) - app_details = "📲​" - app_details += " " + app_name + "" - app_details += ( - "\n\nDeveloper : " - + app_dev - + "" - ) - app_details += "\nRating : " + app_rating.replace( - "Rated ", "⭐ " - ).replace(" out of ", "/").replace(" stars", "", 1).replace( - " stars", "⭐ " - ).replace( - "five", "5" - ) - app_details += ( - "\nFeatures : View in Play Store" - ) - app_details += f"\n\n===> @{SUPPORT_CHAT} <===" - rip.append( - InlineQueryResultArticle( - title=f"Datails of {app_name}", - description=app_details, - input_message_content=InputTextMessageContent( - app_details, disable_web_page_preview=True, parse_mode="html" - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=rip) - - elif text.split()[0] == "gh": - results = [] - gett = text.split(None, 1)[1] - text = gett + ' "site:github.com"' - gresults = await GoogleSearch().async_search(text, 1) - result = "" - for i in range(4): - try: - title = gresults["titles"][i].replace("\n", " ") - source = gresults["links"][i] - description = gresults["descriptions"][i] - result += f"[{title}]({source})\n" - result += f"`{description}`\n\n" - except IndexError: - pass - results.append( - InlineQueryResultArticle( - title=f"Results for {gett}", - description=f" Github info of {title}\n Touch to read", - input_message_content=InputTextMessageContent( - result, disable_web_page_preview=True - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - elif text.split()[0] == "so": - results = [] - gett = text.split(None, 1)[1] - text = gett + ' "site:stackoverflow.com"' - gresults = await GoogleSearch().async_search(text, 1) - result = "" - for i in range(4): - try: - title = gresults["titles"][i].replace("\n", " ") - source = gresults["links"][i] - description = gresults["descriptions"][i] - result += f"[{title}]({source})\n" - result += f"`{description}`\n\n" - except IndexError: - pass - results.append( - InlineQueryResultArticle( - title=f"Stack overflow saerch - {title}", - description=f" Touch to view search results on {title}", - input_message_content=InputTextMessageContent( - result, disable_web_page_preview=True - ), - ) - ) - await client.answer_inline_query(query.id, cache_time=0, results=results) - - except (IndexError, TypeError, KeyError, ValueError): - return - - -def generate_time(to_find: str, findtype: List[str]) -> str: - data = requests.get( - f"http://api.timezonedb.com/v2.1/list-time-zone" - f"?key={TIME_API_KEY}" - f"&format=json" - f"&fields=countryCode,countryName,zoneName,gmtOffset,timestamp,dst" - ).json() - - for zone in data["zones"]: - for eachtype in findtype: - if to_find in zone[eachtype].lower(): - country_name = zone["countryName"] - country_zone = zone["zoneName"] - country_code = zone["countryCode"] - - if zone["dst"] == 1: - daylight_saving = "Yes" - else: - daylight_saving = "No" - - date_fmt = r"%d-%m-%Y" - time_fmt = r"%H:%M:%S" - day_fmt = r"%A" - gmt_offset = zone["gmtOffset"] - timestamp = datetime.datetime.now( - datetime.timezone.utc - ) + datetime.timedelta(seconds=gmt_offset) - current_date = timestamp.strftime(date_fmt) - current_time = timestamp.strftime(time_fmt) - current_day = timestamp.strftime(day_fmt) - - break - - try: - result = ( - f" DATE AND TIME OF COUNTRY" - f"🌍Country :{country_name}\n" - f"⏳Zone Name : {country_zone}\n" - f"🗺Country Code: {country_code}\n" - f"🌞Daylight saving : {daylight_saving}\n" - f"🌅Day : {current_day}\n" - f"⌚Current Time : {current_time}\n" - f"📆Current Date :{current_date}" - ) - except BaseException: - result = None - - return result diff --git a/Shikimori/modules/json.py b/Shikimori/modules/json.py index fc48782c..564c907e 100644 --- a/Shikimori/modules/json.py +++ b/Shikimori/modules/json.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import io from Shikimori.events import register from Shikimori import telethn as tbot diff --git a/Shikimori/modules/karma.py b/Shikimori/modules/karma.py index 57aa93f1..d66517b0 100644 --- a/Shikimori/modules/karma.py +++ b/Shikimori/modules/karma.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import asyncio from pyrogram import filters diff --git a/Shikimori/modules/locks.py b/Shikimori/modules/locks.py index 7def7b68..faad8e77 100644 --- a/Shikimori/modules/locks.py +++ b/Shikimori/modules/locks.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import Shikimori.modules.sql.locks_sql as sql import html import ast diff --git a/Shikimori/modules/log_channel.py b/Shikimori/modules/log_channel.py index 76f6ecb3..16da47fe 100644 --- a/Shikimori/modules/log_channel.py +++ b/Shikimori/modules/log_channel.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from datetime import datetime from functools import wraps from telegram.ext import CallbackContext diff --git a/Shikimori/modules/logomaker.py b/Shikimori/modules/logomaker.py index a274b2e7..16c4eb80 100644 --- a/Shikimori/modules/logomaker.py +++ b/Shikimori/modules/logomaker.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + Mizuhara Team + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori.events import register from Shikimori import OWNER_ID, BOT_USERNAME, SUPPORT_CHAT, dispatcher from Shikimori import telethn as tbot diff --git a/Shikimori/modules/math.py b/Shikimori/modules/math.py deleted file mode 100644 index d37215ae..00000000 --- a/Shikimori/modules/math.py +++ /dev/null @@ -1,132 +0,0 @@ -import math - -import pynewtonmath as newton -from Shikimori import dispatcher -from Shikimori.modules.disable import DisableAbleCommandHandler -from telegram import Update -from telegram.ext import CallbackContext - - -def simplify(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(newton.simplify("{}".format(args[0]))) - - -def factor(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(newton.factor("{}".format(args[0]))) - - -def derive(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(newton.derive("{}".format(args[0]))) - - -def integrate(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(newton.integrate("{}".format(args[0]))) - - -def zeroes(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(newton.zeroes("{}".format(args[0]))) - - -def tangent(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(newton.tangent("{}".format(args[0]))) - - -def area(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(newton.area("{}".format(args[0]))) - - -def cos(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(math.cos(int(args[0]))) - - -def sin(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(math.sin(int(args[0]))) - - -def tan(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(math.tan(int(args[0]))) - - -def arccos(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(math.acos(int(args[0]))) - - -def arcsin(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(math.asin(int(args[0]))) - - -def arctan(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(math.atan(int(args[0]))) - - -def abs(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(math.fabs(int(args[0]))) - - -def log(update: Update, context: CallbackContext): - args = context.args - message = update.effective_message - message.reply_text(math.log(int(args[0]))) - - -__mod_name__ = "Math" - -SIMPLIFY_HANDLER = DisableAbleCommandHandler("math", simplify, run_async=True) -FACTOR_HANDLER = DisableAbleCommandHandler("factor", factor, run_async=True) -DERIVE_HANDLER = DisableAbleCommandHandler("derive", derive, run_async=True) -INTEGRATE_HANDLER = DisableAbleCommandHandler("integrate", integrate, run_async=True) -ZEROES_HANDLER = DisableAbleCommandHandler("zeroes", zeroes, run_async=True) -TANGENT_HANDLER = DisableAbleCommandHandler("tangent", tangent, run_async=True) -AREA_HANDLER = DisableAbleCommandHandler("area", area, run_async=True) -COS_HANDLER = DisableAbleCommandHandler("cos", cos, run_async=True) -SIN_HANDLER = DisableAbleCommandHandler("sin", sin, run_async=True) -TAN_HANDLER = DisableAbleCommandHandler("tan", tan, run_async=True) -ARCCOS_HANDLER = DisableAbleCommandHandler("arccos", arccos, run_async=True) -ARCSIN_HANDLER = DisableAbleCommandHandler("arcsin", arcsin, run_async=True) -ARCTAN_HANDLER = DisableAbleCommandHandler("arctan", arctan, run_async=True) -ABS_HANDLER = DisableAbleCommandHandler("abs", abs, run_async=True) -LOG_HANDLER = DisableAbleCommandHandler("log", log, run_async=True) - -dispatcher.add_handler(SIMPLIFY_HANDLER) -dispatcher.add_handler(FACTOR_HANDLER) -dispatcher.add_handler(DERIVE_HANDLER) -dispatcher.add_handler(INTEGRATE_HANDLER) -dispatcher.add_handler(ZEROES_HANDLER) -dispatcher.add_handler(TANGENT_HANDLER) -dispatcher.add_handler(AREA_HANDLER) -dispatcher.add_handler(COS_HANDLER) -dispatcher.add_handler(SIN_HANDLER) -dispatcher.add_handler(TAN_HANDLER) -dispatcher.add_handler(ARCCOS_HANDLER) -dispatcher.add_handler(ARCSIN_HANDLER) -dispatcher.add_handler(ARCTAN_HANDLER) -dispatcher.add_handler(ABS_HANDLER) -dispatcher.add_handler(LOG_HANDLER) diff --git a/Shikimori/modules/misc.py b/Shikimori/modules/misc.py index a8945473..39de9634 100644 --- a/Shikimori/modules/misc.py +++ b/Shikimori/modules/misc.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import re from random import randint from Shikimori.modules.helper_funcs.chat_status import user_admin diff --git a/Shikimori/modules/modules.py b/Shikimori/modules/modules.py index 6ee7be2e..3f9b7f3d 100644 --- a/Shikimori/modules/modules.py +++ b/Shikimori/modules/modules.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import importlib import collections diff --git a/Shikimori/modules/muting.py b/Shikimori/modules/muting.py index 1d33bc42..bfe3cf08 100644 --- a/Shikimori/modules/muting.py +++ b/Shikimori/modules/muting.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import re from typing import Optional diff --git a/Shikimori/modules/nightmode.py b/Shikimori/modules/nightmode.py deleted file mode 100644 index 965a66ce..00000000 --- a/Shikimori/modules/nightmode.py +++ /dev/null @@ -1,193 +0,0 @@ -""" -BSD 2-Clause License - -Copyright (C) 2017-2019, Paul Larsen -Copyright (C) 2021-2022, Awesome-RJ, [ https://github.com/Awesome-RJ ] -Copyright (c) 2021-2022, Yūki • Black Knights Union, [ https://github.com/Awesome-RJ/CutiepiiRobot ] - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" - -from telethon.tl.types import ChatBannedRights -from telethon import * -from telethon import types -from telethon.tl import functions -from apscheduler.schedulers.asyncio import AsyncIOScheduler - - -from Shikimori.modules.sql.night_mode_sql import add_nightmode, rmnightmode, get_all_chat_id, is_nightmode_indb -from Shikimori.events import register -from Shikimori import OWNER_ID, telethn, LOGGER - -hehes = ChatBannedRights( - until_date=None, - send_messages=True, - send_media=True, - send_stickers=True, - send_gifs=True, - send_games=True, - send_inline=True, - send_polls=True, - invite_users=True, - pin_messages=True, - change_info=True, -) - -openhehe = ChatBannedRights( - until_date=None, - send_messages=False, - send_media=False, - send_stickers=False, - send_gifs=False, - send_games=False, - send_inline=False, - send_polls=False, - invite_users=True, - pin_messages=True, - change_info=True, -) - -async def is_register_admin(chat, user): - if isinstance(chat, (types.InputPeerChannel, types.InputChannel)): - return isinstance( - ( - await telethn(functions.channels.GetParticipantRequest(chat, user)) - ).participant, - (types.ChannelParticipantAdmin, types.ChannelParticipantCreator), - ) - if isinstance(chat, types.InputPeerUser): - return True - -async def can_change_info(message): - result = await telethn( - functions.channels.GetParticipantRequest( - channel=message.chat_id, - user_id=message.sender_id, - ) - ) - p = result.participant - return isinstance(p, types.ChannelParticipantCreator) or ( - isinstance(p, types.ChannelParticipantAdmin) and p.admin_rights.change_info - ) - -@register(pattern="^/(nightmode|Nightmode|NightMode) ?(.*)") -async def profanity(event): - if event.fwd_from: - return - if event.is_private: - return - input = event.pattern_match.group(2) - if event.sender_id != OWNER_ID: - if not await is_register_admin(event.input_chat, event.sender_id): - await event.reply("Only admins can execute this command!") - return - if not await can_change_info(message=event): - await event.reply("You are missing the following rights to use this command:CanChangeinfo") - return - if not input: - if is_nightmode_indb(str(event.chat_id)): - await event.reply( - "Currently NightMode is Enabled for this Chat" - ) - return - await event.reply( - "Currently NightMode is Disabled for this Chat" - ) - return - if "on" in input and event.is_group: - if is_nightmode_indb(str(event.chat_id)): - await event.reply( - "Night Mode is Already Turned ON for this Chat" - ) - return - add_nightmode(str(event.chat_id)) - await event.reply("NightMode turned on for this chat.") - if "off" in input: - if ( - event.is_group - and not is_nightmode_indb(str(event.chat_id)) - ): - await event.reply( - "Night Mode is Already Off for this Chat" - ) - return - rmnightmode(str(event.chat_id)) - await event.reply("NightMode Disabled!") - if "off" not in input and "on" not in input: - await event.reply("Please Specify On or Off!") - return - - -async def job_close(): - chats = get_all_chat_id() - if len(chats) == 0: - return - for pro in chats: - try: - await telethn.send_message( - int(pro.chat_id), "12:00 Am, Group Is Closing Till 6 Am. Night Mode Started ! \n**Powered By Yūki Network**" - ) - await telethn( - functions.messages.EditChatDefaultBannedRightsRequest( - peer=int(pro.chat_id), banned_rights=hehes - ) - ) - except Exception as e: - LOGGER.info(f"Unable To Close Group {pro.chat_id} - {e}") - -#Run everyday at 12am -scheduler = AsyncIOScheduler(timezone="Asia/Kolkata") -scheduler.add_job(job_close, trigger="cron", hour=23, minute=59) -scheduler.start() - -async def job_open(): - chats = get_all_chat_id() - if len(chats) == 0: - return - for pro in chats: - try: - await telethn.send_message( - int(pro.chat_id), "06:00 Am, Group Is Opening.\n**Powered By Yūki Network**" - ) - await telethn( - functions.messages.EditChatDefaultBannedRightsRequest( - peer=int(pro.chat_id), banned_rights=openhehe - ) - ) - except Exception as e: - LOGGER.info(f"Unable To Open Group {pro.chat_id} - {e}") - -# Run everyday at 06 -scheduler = AsyncIOScheduler(timezone="Asia/Kolkata") -scheduler.add_job(job_open, trigger="cron", hour=5, minute=58) -scheduler.start() - -__help__ = """ -➛ /nightmode*:* on/off - -**Note:** Night Mode chats get Automatically closed at 12pm(IST) -and Automatically openned at 6am(IST) To Prevent Night Spams. -""" - -__mod_name__ = "NightMode" diff --git a/Shikimori/modules/notes.py b/Shikimori/modules/notes.py index c9cb3678..b9cf16c4 100644 --- a/Shikimori/modules/notes.py +++ b/Shikimori/modules/notes.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import re, ast from io import BytesIO import random diff --git a/Shikimori/modules/paste.py b/Shikimori/modules/paste.py index 9fc4658a..e2c0003e 100644 --- a/Shikimori/modules/paste.py +++ b/Shikimori/modules/paste.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import asyncio import os import re diff --git a/Shikimori/modules/pfp.py b/Shikimori/modules/pfp.py index 728a9438..caa06ece 100644 --- a/Shikimori/modules/pfp.py +++ b/Shikimori/modules/pfp.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from telethon import * from telethon.tl.functions.account import * from telethon.tl.functions.channels import * diff --git a/Shikimori/modules/phone.py b/Shikimori/modules/phone.py deleted file mode 100644 index 406b1aa4..00000000 --- a/Shikimori/modules/phone.py +++ /dev/null @@ -1,98 +0,0 @@ -""" -BSD 2-Clause License - -Copyright (C) 2017-2019, Paul Larsen -Copyright (C) 2021-2022, Awesome-RJ, [ https://github.com/Awesome-RJ ] -Copyright (c) 2021-2022, Yūki • Black Knights Union, [ https://github.com/Awesome-RJ/CutiepiiRobot ] - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" - -import json -import requests - -from telethon import types -from telethon.tl import functions - -from Shikimori.events import register,telethn - - -async def is_register_admin(chat, user): - if isinstance(chat, (types.InputPeerChannel, types.InputChannel)): - - return isinstance( - ( - await telethn(functions.channels.GetParticipantRequest(chat, user)) - ).participant, - (types.ChannelParticipantAdmin, types.ChannelParticipantCreator), - ) - if isinstance(chat, types.InputPeerChat): - - ui = await telethn.get_peer_id(user) - ps = ( - await telethn(functions.messages.GetFullChatRequest(chat.chat_id)) - ).full_chat.participants.participants - return isinstance( - next((p for p in ps if p.user_id == ui), None), - (types.ChatParticipantAdmin, types.ChatParticipantCreator), - ) - return None - - -@register(pattern=r"^/phone (.*)") -async def phone(event): - if ( - event.is_group - and not await is_register_admin(event.input_chat, event.message.sender_id) - ): - await event.reply("☎️ You are not admin 🚶‍♀️") - return - information = event.pattern_match.group(1) - number = information - key = "fe65b94e78fc2e3234c1c6ed1b771abd" - api = ( - "http://apilayer.net/api/validate?access_key=" - + key - + "&number=" - + number - + "&country_code=&format=1" - ) - output = requests.get(api) - content = output.text - obj = json.loads(content) - country_code = obj["country_code"] - country_name = obj["country_name"] - location = obj["location"] - carrier = obj["carrier"] - line_type = obj["line_type"] - validornot = obj["valid"] - aa = f"Valid: {str(validornot)}" - a = f"Phone number: {str(number)}" - b = f"Country: {str(country_code)}" - c = f"Country Name: {str(country_name)}" - d = f"Location: {str(location)}" - e = f"Carrier: {str(carrier)}" - f = f"Device: {str(line_type)}" - g = f"{aa}\n{a}\n{b}\n{c}\n{d}\n{e}\n{f}" - await event.reply(g) diff --git a/Shikimori/modules/purge.py b/Shikimori/modules/purge.py index 2b1d4d7a..d3928ad0 100644 --- a/Shikimori/modules/purge.py +++ b/Shikimori/modules/purge.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import time from telethon import events diff --git a/Shikimori/modules/quotes.py b/Shikimori/modules/quotes.py index 06a34cd4..821f55d1 100644 --- a/Shikimori/modules/quotes.py +++ b/Shikimori/modules/quotes.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from PIL import Image, ImageDraw, ImageFont, ImageOps from telethon.tl import types, functions from fontTools.ttLib import TTFont diff --git a/Shikimori/modules/reactions.py b/Shikimori/modules/reactions.py index d0ccc93f..b7495fa9 100644 --- a/Shikimori/modules/reactions.py +++ b/Shikimori/modules/reactions.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import random from Shikimori import dispatcher diff --git a/Shikimori/modules/redis/afk_redis.py b/Shikimori/modules/redis/afk_redis.py index 72e44919..408e3f97 100644 --- a/Shikimori/modules/redis/afk_redis.py +++ b/Shikimori/modules/redis/afk_redis.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import REDIS # AFK diff --git a/Shikimori/modules/reporting.py b/Shikimori/modules/reporting.py index f534bf4e..9b854eeb 100644 --- a/Shikimori/modules/reporting.py +++ b/Shikimori/modules/reporting.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html from Shikimori import LOGGER, DRAGONS, TIGERS, WOLVES, dispatcher diff --git a/Shikimori/modules/reverse.py b/Shikimori/modules/reverse.py index f9941c4f..e35e145b 100644 --- a/Shikimori/modules/reverse.py +++ b/Shikimori/modules/reverse.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os import re import requests diff --git a/Shikimori/modules/rss_feed.py b/Shikimori/modules/rss_feed.py index a775a1f1..1acb9b35 100644 --- a/Shikimori/modules/rss_feed.py +++ b/Shikimori/modules/rss_feed.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import re diff --git a/Shikimori/modules/rules.py b/Shikimori/modules/rules.py index f1d5032d..c276e35c 100644 --- a/Shikimori/modules/rules.py +++ b/Shikimori/modules/rules.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from typing import Optional import Shikimori.modules.sql.rules_sql as sql diff --git a/Shikimori/modules/send.py b/Shikimori/modules/send.py index a5fe08da..dac5c1f1 100644 --- a/Shikimori/modules/send.py +++ b/Shikimori/modules/send.py @@ -1,9 +1,35 @@ -from typing import Optional +""" +STATUS: Code is working. ✅ +""" -from telegram import Message, Update, Bot, User -from telegram import MessageEntity -from telegram.error import BadRequest -from telegram.ext import Filters, MessageHandler, run_async +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" from Shikimori import dispatcher from Shikimori.modules.disable import DisableAbleCommandHandler @@ -15,9 +41,6 @@ def send(update, context): args = update.effective_message.text.split(None, 1) creply = args[1] send_message(update.effective_message, creply) - - - __help__ = """The Send Module Allows you to send a custom message to users in a chat `/snd` :Send the given message diff --git a/Shikimori/modules/shell.py b/Shikimori/modules/shell.py index bec9840d..eeca0c2e 100644 --- a/Shikimori/modules/shell.py +++ b/Shikimori/modules/shell.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import subprocess from Shikimori import LOGGER, dispatcher diff --git a/Shikimori/modules/shippering.py b/Shikimori/modules/shippering.py index 67374234..a40705c7 100644 --- a/Shikimori/modules/shippering.py +++ b/Shikimori/modules/shippering.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import pbot as app from Shikimori.utils.errors import capture_err from Shikimori.Extras.dbfunctions import get_couple, save_couple diff --git a/Shikimori/modules/snipe.py b/Shikimori/modules/snipe.py index f61bf9f9..007b5d26 100644 --- a/Shikimori/modules/snipe.py +++ b/Shikimori/modules/snipe.py @@ -1,3 +1,38 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" from telegram import TelegramError from telegram import Update diff --git a/Shikimori/modules/speed_test.py b/Shikimori/modules/speed_test.py index bc38b040..530494c0 100644 --- a/Shikimori/modules/speed_test.py +++ b/Shikimori/modules/speed_test.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import speedtest from Shikimori import DEV_USERS, dispatcher from Shikimori.modules.disable import DisableAbleCommandHandler diff --git a/Shikimori/modules/sql/__init__.py b/Shikimori/modules/sql/__init__.py index cdf5b4ce..25d6e11c 100644 --- a/Shikimori/modules/sql/__init__.py +++ b/Shikimori/modules/sql/__init__.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import DB_URL from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base diff --git a/Shikimori/modules/sql/antichannel_sql.py b/Shikimori/modules/sql/antichannel_sql.py deleted file mode 100644 index 1d815251..00000000 --- a/Shikimori/modules/sql/antichannel_sql.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -BSD 2-Clause License - -Copyright (C) 2017-2019, Paul Larsen -Copyright (C) 2021-2022, Awesome-RJ, [ https://github.com/Awesome-RJ ] -Copyright (c) 2021-2022, Yūki • Black Knights Union, [ https://github.com/Awesome-RJ/CutiepiiRobot ] - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" -import threading - -from sqlalchemy import Boolean -from sqlalchemy.sql.sqltypes import String -from sqlalchemy import Column - -from Shikimori.modules.sql import BASE, SESSION - - -class AntiChannelSettings(BASE): - __tablename__ = "anti_channel_settings" - - chat_id = Column(String(14), primary_key=True) - setting = Column(Boolean, default=False, nullable=False) - - def __init__(self, chat_id: int, disabled: bool): - self.chat_id = str(chat_id) - self.setting = disabled - - def __repr__(self): - return f"" - - -AntiChannelSettings.__table__.create(checkfirst=True) -ANTICHANNEL_SETTING_LOCK = threading.RLock() - -def enable_antichannel(chat_id: int): - with ANTICHANNEL_SETTING_LOCK: - chat = SESSION.query(AntiChannelSettings).get(str(chat_id)) - if not chat: - chat = AntiChannelSettings(str(chat_id), True) - - chat.setting = True - SESSION.add(chat) - SESSION.commit() - - -def disable_antichannel(chat_id: int): - with ANTICHANNEL_SETTING_LOCK: - chat = SESSION.query(AntiChannelSettings).get(str(chat_id)) - if not chat: - chat = AntiChannelSettings(str(chat_id), False) - - chat.setting = False - SESSION.add(chat) - SESSION.commit() - - -def antichannel_status(chat_id: int) -> bool: - with ANTICHANNEL_SETTING_LOCK: - d = SESSION.query(AntiChannelSettings).get(str(chat_id)) - if not d: - return False - return d.setting - - - - -def migrate_chat(old_chat_id, new_chat_id): - with ANTICHANNEL_SETTING_LOCK: - if chat := SESSION.query(AntiChannelSettings).get(str(old_chat_id)): - chat.chat_id = new_chat_id - SESSION.add(chat) - - SESSION.commit() diff --git a/Shikimori/modules/sql/antichannel_sql.py.txt b/Shikimori/modules/sql/antichannel_sql.py.txt deleted file mode 100644 index 56ef3377..00000000 --- a/Shikimori/modules/sql/antichannel_sql.py.txt +++ /dev/null @@ -1,65 +0,0 @@ -import threading - -from sqlalchemy import Boolean -from sqlalchemy.sql.sqltypes import String -from sqlalchemy import Column - -from Shikimori.modules.sql import BASE, SESSION - - -class AntiChannelSettings(BASE): - __tablename__ = "anti_channel_settings" - - chat_id = Column(String(14), primary_key=True) - setting = Column(Boolean, default=False, nullable=False) - - def __init__(self, chat_id: int, disabled: bool): - self.chat_id = str(chat_id) - self.setting = disabled - - def __repr__(self): - return "".format(self.chat_id, self.setting) - - -AntiChannelSettings.__table__.create(checkfirst=True) -ANTICHANNEL_SETTING_LOCK = threading.RLock() - - -def enable_antichannel(chat_id: int): - with ANTICHANNEL_SETTING_LOCK: - chat = SESSION.query(AntiChannelSettings).get(str(chat_id)) - if not chat: - chat = AntiChannelSettings(chat_id, True) - - chat.setting = True - SESSION.add(chat) - SESSION.commit() - - -def disable_antichannel(chat_id: int): - with ANTICHANNEL_SETTING_LOCK: - chat = SESSION.query(AntiChannelSettings).get(str(chat_id)) - if not chat: - chat = AntiChannelSettings(chat_id, False) - - chat.setting = False - SESSION.add(chat) - SESSION.commit() - - -def antichannel_status(chat_id: int) -> bool: - with ANTICHANNEL_SETTING_LOCK: - d = SESSION.query(AntiChannelSettings).get(str(chat_id)) - if not d: - return False - return d.setting - - -def migrate_chat(old_chat_id, new_chat_id): - with ANTICHANNEL_SETTING_LOCK: - chat = SESSION.query(AntiChannelSettings).get(str(old_chat_id)) - if chat: - chat.chat_id = new_chat_id - SESSION.add(chat) - - SESSION.commit() diff --git a/Shikimori/modules/sql/antiflood_sql.py b/Shikimori/modules/sql/antiflood_sql.py index 1823f640..e6bc7180 100644 --- a/Shikimori/modules/sql/antiflood_sql.py +++ b/Shikimori/modules/sql/antiflood_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from sqlalchemy import String, Column, Integer, BigInteger, UnicodeText diff --git a/Shikimori/modules/sql/approve_sql.py b/Shikimori/modules/sql/approve_sql.py index d187b0da..67d2d2c7 100644 --- a/Shikimori/modules/sql/approve_sql.py +++ b/Shikimori/modules/sql/approve_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from sqlalchemy import Column, String, UnicodeText, func, distinct from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/blacklist_sql.py b/Shikimori/modules/sql/blacklist_sql.py index 8ff0a991..9a3f309e 100644 --- a/Shikimori/modules/sql/blacklist_sql.py +++ b/Shikimori/modules/sql/blacklist_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from sqlalchemy import func, distinct, Column, String, UnicodeText, Integer diff --git a/Shikimori/modules/sql/blacklistusers_sql.py b/Shikimori/modules/sql/blacklistusers_sql.py index 33e0b298..0d2e8f90 100644 --- a/Shikimori/modules/sql/blacklistusers_sql.py +++ b/Shikimori/modules/sql/blacklistusers_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/blsticker_sql.py b/Shikimori/modules/sql/blsticker_sql.py index da2540ea..603755a8 100644 --- a/Shikimori/modules/sql/blsticker_sql.py +++ b/Shikimori/modules/sql/blsticker_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from sqlalchemy import Column, String, UnicodeText, distinct, func, Integer diff --git a/Shikimori/modules/sql/chatbot_sql.py b/Shikimori/modules/sql/chatbot_sql.py index 990b95e6..56ec9fd0 100644 --- a/Shikimori/modules/sql/chatbot_sql.py +++ b/Shikimori/modules/sql/chatbot_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from sqlalchemy import Column, String from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/cleaner_sql.py b/Shikimori/modules/sql/cleaner_sql.py index 65abfe27..bbe77816 100644 --- a/Shikimori/modules/sql/cleaner_sql.py +++ b/Shikimori/modules/sql/cleaner_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/connection_sql.py b/Shikimori/modules/sql/connection_sql.py index 328a8f77..1af6e7e3 100644 --- a/Shikimori/modules/sql/connection_sql.py +++ b/Shikimori/modules/sql/connection_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading import time from typing import Union diff --git a/Shikimori/modules/sql/cust_filters_sql.py b/Shikimori/modules/sql/cust_filters_sql.py index e219b51a..ebdb8814 100644 --- a/Shikimori/modules/sql/cust_filters_sql.py +++ b/Shikimori/modules/sql/cust_filters_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from sqlalchemy import Column, String, UnicodeText, Boolean, distinct, func, Integer from Shikimori.modules.helper_funcs.msg_types import Types diff --git a/Shikimori/modules/sql/disable_sql.py b/Shikimori/modules/sql/disable_sql.py index 6b0722af..9dbf39cf 100644 --- a/Shikimori/modules/sql/disable_sql.py +++ b/Shikimori/modules/sql/disable_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/feds_sql.py b/Shikimori/modules/sql/feds_sql.py index 66a79cb3..f4a0aec0 100644 --- a/Shikimori/modules/sql/feds_sql.py +++ b/Shikimori/modules/sql/feds_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import ast import threading from Shikimori import dispatcher diff --git a/Shikimori/modules/sql/forceSubscribe_sql.py b/Shikimori/modules/sql/forceSubscribe_sql.py index 6110ee90..04cdeae5 100644 --- a/Shikimori/modules/sql/forceSubscribe_sql.py +++ b/Shikimori/modules/sql/forceSubscribe_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from sqlalchemy import Column, String, Numeric, Boolean from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/global_bans_sql.py b/Shikimori/modules/sql/global_bans_sql.py index 4ef0e8b3..47c509e1 100644 --- a/Shikimori/modules/sql/global_bans_sql.py +++ b/Shikimori/modules/sql/global_bans_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION from sqlalchemy import Boolean, Column, String, UnicodeText diff --git a/Shikimori/modules/sql/locks_sql.py b/Shikimori/modules/sql/locks_sql.py index f2f5294d..b465d25a 100644 --- a/Shikimori/modules/sql/locks_sql.py +++ b/Shikimori/modules/sql/locks_sql.py @@ -1,4 +1,41 @@ # New chat added -> setup permissions + +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from sqlalchemy import Column, String, Boolean diff --git a/Shikimori/modules/sql/log_channel_sql.py b/Shikimori/modules/sql/log_channel_sql.py index 45a85ca2..fccb51f7 100644 --- a/Shikimori/modules/sql/log_channel_sql.py +++ b/Shikimori/modules/sql/log_channel_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/logger_sql.py b/Shikimori/modules/sql/logger_sql.py index bd188981..616a8092 100644 --- a/Shikimori/modules/sql/logger_sql.py +++ b/Shikimori/modules/sql/logger_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from sqlalchemy import Column, String, Boolean diff --git a/Shikimori/modules/sql/night_mode_sql.py b/Shikimori/modules/sql/night_mode_sql.py deleted file mode 100644 index 81c78d18..00000000 --- a/Shikimori/modules/sql/night_mode_sql.py +++ /dev/null @@ -1,70 +0,0 @@ -""" -BSD 2-Clause License - -Copyright (C) 2017-2019, Paul Larsen -Copyright (C) 2021-2022, Awesome-RJ, [ https://github.com/Awesome-RJ ] -Copyright (c) 2021-2022, Yūki • Black Knights Union, [ https://github.com/Awesome-RJ/CutiepiiRobot ] - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" - -from sqlalchemy import Column, String -from Shikimori.modules.sql import BASE, SESSION - - -class Nightmode(BASE): - __tablename__ = "nightmode" - chat_id = Column(String(14), primary_key=True) - - def __init__(self, chat_id): - self.chat_id = chat_id - - -Nightmode.__table__.create(checkfirst=True) - - -def add_nightmode(chat_id: str): - nightmoddy = Nightmode(chat_id) - SESSION.add(nightmoddy) - SESSION.commit() - - -def rmnightmode(chat_id: str): - if rmnightmoddy := SESSION.query(Nightmode).get(chat_id): - SESSION.delete(rmnightmoddy) - SESSION.commit() - - -def get_all_chat_id(): - stark = SESSION.query(Nightmode).all() - SESSION.close() - return stark - - -def is_nightmode_indb(chat_id: str): - try: - if s__ := SESSION.query(Nightmode).get(chat_id): - return str(s__.chat_id) - finally: - SESSION.close() diff --git a/Shikimori/modules/sql/notes_sql.py b/Shikimori/modules/sql/notes_sql.py index 5663162c..95a8ce07 100644 --- a/Shikimori/modules/sql/notes_sql.py +++ b/Shikimori/modules/sql/notes_sql.py @@ -1,4 +1,41 @@ # Note: chat_id's are stored as strings because the int is too large to be stored in a PSQL database. + +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.helper_funcs.msg_types import Types diff --git a/Shikimori/modules/sql/reporting_sql.py b/Shikimori/modules/sql/reporting_sql.py index cd9d5f21..34b3bc6d 100644 --- a/Shikimori/modules/sql/reporting_sql.py +++ b/Shikimori/modules/sql/reporting_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from typing import Union diff --git a/Shikimori/modules/sql/rss_sql.py b/Shikimori/modules/sql/rss_sql.py index 3b71681f..0e5ae101 100644 --- a/Shikimori/modules/sql/rss_sql.py +++ b/Shikimori/modules/sql/rss_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/rules_sql.py b/Shikimori/modules/sql/rules_sql.py index c43c3cf3..7bafaee1 100644 --- a/Shikimori/modules/sql/rules_sql.py +++ b/Shikimori/modules/sql/rules_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/userinfo_sql.py b/Shikimori/modules/sql/userinfo_sql.py index 801d10a6..c1e41059 100644 --- a/Shikimori/modules/sql/userinfo_sql.py +++ b/Shikimori/modules/sql/userinfo_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/users_sql.py b/Shikimori/modules/sql/users_sql.py index 05eb0187..70fccbf3 100644 --- a/Shikimori/modules/sql/users_sql.py +++ b/Shikimori/modules/sql/users_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori import dispatcher diff --git a/Shikimori/modules/sql/warns_sql.py b/Shikimori/modules/sql/warns_sql.py index 51dfe5d5..297ee088 100644 --- a/Shikimori/modules/sql/warns_sql.py +++ b/Shikimori/modules/sql/warns_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import threading from Shikimori.modules.sql import BASE, SESSION diff --git a/Shikimori/modules/sql/welcome_sql.py b/Shikimori/modules/sql/welcome_sql.py index 30b2c1b8..3ed7802c 100644 --- a/Shikimori/modules/sql/welcome_sql.py +++ b/Shikimori/modules/sql/welcome_sql.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import random import threading from typing import Union diff --git a/Shikimori/modules/stickers.py b/Shikimori/modules/stickers.py index eb7e8051..fd1a0a12 100644 --- a/Shikimori/modules/stickers.py +++ b/Shikimori/modules/stickers.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os import math import cloudscraper diff --git a/Shikimori/modules/styletext.py b/Shikimori/modules/styletext.py index 0fb2f958..ed8b9c15 100644 --- a/Shikimori/modules/styletext.py +++ b/Shikimori/modules/styletext.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import dispatcher from Shikimori.modules.disable import DisableAbleCommandHandler from Shikimori.modules.helper_funcs.alternate import typing_action diff --git a/Shikimori/modules/tagall.py b/Shikimori/modules/tagall.py index 5861a49b..6a80f057 100644 --- a/Shikimori/modules/tagall.py +++ b/Shikimori/modules/tagall.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori import telethn from Shikimori.events import register as tomori diff --git a/Shikimori/modules/telegraph.py b/Shikimori/modules/telegraph.py index f67b17b7..3b26e9af 100644 --- a/Shikimori/modules/telegraph.py +++ b/Shikimori/modules/telegraph.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from Shikimori.events import register from Shikimori import telethn as tbot from telegram import ParseMode diff --git a/Shikimori/modules/term_and_eval.py b/Shikimori/modules/term_and_eval.py index 91d629c2..b1b47a6d 100644 --- a/Shikimori/modules/term_and_eval.py +++ b/Shikimori/modules/term_and_eval.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import traceback import sys import os diff --git a/Shikimori/modules/tiny.py b/Shikimori/modules/tiny.py index d700e3b0..21d27b35 100644 --- a/Shikimori/modules/tiny.py +++ b/Shikimori/modules/tiny.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os import cv2 from PIL import Image diff --git a/Shikimori/modules/urbandictionary.py b/Shikimori/modules/urbandictionary.py index 43f6d708..b6dc17f3 100644 --- a/Shikimori/modules/urbandictionary.py +++ b/Shikimori/modules/urbandictionary.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import requests from Shikimori import dispatcher from Shikimori.modules.disable import DisableAbleCommandHandler diff --git a/Shikimori/modules/userinfo.py b/Shikimori/modules/userinfo.py index aacff69c..8d2e6ad9 100644 --- a/Shikimori/modules/userinfo.py +++ b/Shikimori/modules/userinfo.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import requests diff --git a/Shikimori/modules/users.py b/Shikimori/modules/users.py index 3a1532b7..8b08f487 100644 --- a/Shikimori/modules/users.py +++ b/Shikimori/modules/users.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from io import BytesIO from time import sleep diff --git a/Shikimori/modules/waifu.py b/Shikimori/modules/waifu.py index 05e7d192..effb06d0 100644 --- a/Shikimori/modules/waifu.py +++ b/Shikimori/modules/waifu.py @@ -7,9 +7,6 @@ Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] -Credits: - Void [https://github.com/Voidxtoxic/] - All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Shikimori/modules/warns.py b/Shikimori/modules/warns.py index f397382a..27a6a872 100644 --- a/Shikimori/modules/warns.py +++ b/Shikimori/modules/warns.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import re from typing import Optional diff --git a/Shikimori/modules/watchorder.py b/Shikimori/modules/watchorder.py index c0cadd6c..5dc9f739 100644 --- a/Shikimori/modules/watchorder.py +++ b/Shikimori/modules/watchorder.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import requests from Shikimori.events import register from Shikimori import telethn, SUPPORT_CHAT diff --git a/Shikimori/modules/welcome.py b/Shikimori/modules/welcome.py index 2478bb54..26340254 100644 --- a/Shikimori/modules/welcome.py +++ b/Shikimori/modules/welcome.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import html import random import re diff --git a/Shikimori/modules/whatanime.py b/Shikimori/modules/whatanime.py index 89388a4a..5708e496 100644 --- a/Shikimori/modules/whatanime.py +++ b/Shikimori/modules/whatanime.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import asyncio import datetime import html diff --git a/Shikimori/modules/whisper.py b/Shikimori/modules/whisper.py deleted file mode 100644 index 9c7b135b..00000000 --- a/Shikimori/modules/whisper.py +++ /dev/null @@ -1,97 +0,0 @@ -from telethon import events, Button -import logging -from telethon.tl.functions.users import GetFullUserRequest as us -from Shikimori import BOT_USERNAME, telethn as bot - -logging.basicConfig(level=logging.INFO) - - -db = {} - -@bot.on(events.NewMessage(pattern=f"^[!?@/]{BOT_USERNAME}$")) -async def stsrt(event): - await event.reply( - "**Heya, I am a Whisper Bot function for Cutiepii!**", - buttons=[ - [Button.switch_inline("Go Inline", query="")] - ] - ) - - -@bot.on(events.InlineQuery()) -async def die(event): - if len(event.text) != 0: - return - me = (await bot.get_me()).username - dn = event.builder.article( - title="It's a whisper bot!", - description="It's a whisper Bot function for Cutiepii!\n(c) Reeshuxd", - text=f"**It's a whisper bot**\n`@{me} wspr Username|Message`\n**(c) Reeshuxd**", - buttons=[ - [Button.switch_inline(" Go Inline ", query="wspr ")] - ] - ) - await event.answer([dn]) - -@bot.on(events.InlineQuery(pattern="wspr")) -async def inline(event): - me = (await bot.get_me()).username - try: - inp = event.text.split(None, 1)[1] - user, msg = inp.split("|") - except IndexError: - await event.answer( - [], - switch_pm=f"@{me} [Username]|[Message]", - switch_pm_param="whisper" - ) - except ValueError: - await event.answer( - [], - switch_pm="Give a message too!", - switch_pm_param="whisper" - ) - try: - ui = await bot(us(user)) - except BaseException: - await event.answer( - [], - switch_pm="Invalid User ID/Username", - switch_pm_param="whisper" - ) - return - db.update({"user_id": ui.user.id, "msg": msg, "self": event.sender.id}) - text = f""" -A Whisper Has Been Sent -To [{ui.user.first_name}](tg://user?id={ui.user.id})! -Click The Below Button To See The Message! -**Note:** __Only {ui.user.first_name} can open this!__ - """ - dn = event.builder.article( - title="Its a secret message! Sssh", - description="It's a secret message! Sssh!", - text=text, - buttons=[ - [Button.inline(" Show Message! ", data="wspr")] - ] - ) - await event.answer( - [dn], - switch_pm="It's a secret message! Sssh", - switch_pm_param="whisper" - ) - - -@bot.on(events.CallbackQuery(data="wspr")) -async def ws(event): - user = int(db["user_id"]) - lol = [int(db["self"]), user] - if event.sender.id not in lol: - await event.answer("🔐 This message is not for you!", alert=True) - return - msg = db["msg"] - if msg == []: - await event.anwswer( - "Oops!\nIt's looks like message got deleted from my server!", alert=True) - return - await event.answer(msg, alert=True) diff --git a/Shikimori/modules/wiki.py b/Shikimori/modules/wiki.py index 359d81cb..b4d02349 100644 --- a/Shikimori/modules/wiki.py +++ b/Shikimori/modules/wiki.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import wikipedia from Shikimori import dispatcher from Shikimori.modules.disable import DisableAbleCommandHandler diff --git a/Shikimori/modules/wish.py b/Shikimori/modules/wish.py deleted file mode 100644 index 51bd6a3a..00000000 --- a/Shikimori/modules/wish.py +++ /dev/null @@ -1,58 +0,0 @@ -""" -BSD 2-Clause License - -Copyright (C) 2017-2019, Paul Larsen -Copyright (C) 2021-2022, Awesome-RJ, [ https://github.com/Awesome-RJ ] -Copyright (c) 2021-2022, Yūki • Black Knights Union, [ https://github.com/Awesome-RJ/CutiepiiRobot ] - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" -import random - -from Shikimori import OWNER_ID, telethn - -from telethon import events, Button -from telegram import ParseMode - -BUTTON = [[Button.url("❓ What Is This", "https://t.me/Black_Knights_Union/195")]] -COMET = "https://telegra.ph/file/713fbfbdde25cc1726866.mp4" -STAR = "https://telegra.ph/file/ad90b44c551cec31df76b.mp4" -WISH = """ -**You can use** `/wish` **as a general Wishing Well of sorts** -**For example:** -`/wish I could date you 😍,` **or** -`/wish that sushi was 🍣 in /emojify, or -/wish I had someone to /cuddle at night...` -""" - -@telethn.on(events.NewMessage(pattern="/wish ?(.*)")) -async def wish(e): - quew = e.pattern_match.group(1) - if e.sender_id != OWNER_ID and not quew: - (await e.reply(WISH, parse_mode=ParseMode.MARKDOWN, buttons=BUTTON, file=STAR),) - return - if not e.is_reply: - mm = random.randint(1,100) - DREAM = f"**Your wish has been cast.✨**\n\n__chance of success {mm}%__" - await e.reply(DREAM, buttons=BUTTON, file=COMET ) diff --git a/Shikimori/modules/yts.py b/Shikimori/modules/yts.py index 38567b63..bb05cba0 100644 --- a/Shikimori/modules/yts.py +++ b/Shikimori/modules/yts.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import logging from pyrogram.types import Message from Shikimori.imports.youtube_search import YoutubeSearch diff --git a/Shikimori/modules/zip.py b/Shikimori/modules/zip.py index d424db42..101994c4 100644 --- a/Shikimori/modules/zip.py +++ b/Shikimori/modules/zip.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os import time import zipfile diff --git a/Shikimori/modules/zombies.py b/Shikimori/modules/zombies.py index ea903f33..7c0c3d87 100644 --- a/Shikimori/modules/zombies.py +++ b/Shikimori/modules/zombies.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from asyncio import sleep from telethon import events from telethon.errors import ChatAdminRequiredError, UserAdminInvalidError diff --git a/Shikimori/mongo.py b/Shikimori/mongo.py index d44a3972..ffccf262 100644 --- a/Shikimori/mongo.py +++ b/Shikimori/mongo.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import asyncio import sys diff --git a/Shikimori/pyrogramee/dark.py b/Shikimori/pyrogramee/dark.py index ec360564..10f489de 100644 --- a/Shikimori/pyrogramee/dark.py +++ b/Shikimori/pyrogramee/dark.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + def get_arg(message): msg = message.text msg = msg.replace(" ", "", 1) if msg[1] == " " else msg diff --git a/Shikimori/pyrogramee/errors.py b/Shikimori/pyrogramee/errors.py index 104366cd..7d704b3d 100644 --- a/Shikimori/pyrogramee/errors.py +++ b/Shikimori/pyrogramee/errors.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import sys import traceback from functools import wraps diff --git a/Shikimori/pyrogramee/pluginshelper.py b/Shikimori/pyrogramee/pluginshelper.py index 41dceb07..64871eae 100644 --- a/Shikimori/pyrogramee/pluginshelper.py +++ b/Shikimori/pyrogramee/pluginshelper.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import asyncio import math import shlex diff --git a/Shikimori/pyrogramee/pyrogram.py b/Shikimori/pyrogramee/pyrogram.py index 228551e3..745f76dd 100644 --- a/Shikimori/pyrogramee/pyrogram.py +++ b/Shikimori/pyrogramee/pyrogram.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import logging from pyrogram import Client diff --git a/Shikimori/pyrogramee/telethonbasics.py b/Shikimori/pyrogramee/telethonbasics.py index dbebee8e..3ae0424b 100644 --- a/Shikimori/pyrogramee/telethonbasics.py +++ b/Shikimori/pyrogramee/telethonbasics.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import os from telethon.tl.types import * diff --git a/Shikimori/utils/adminperms.py b/Shikimori/utils/adminperms.py index 2e188fd1..c01abd33 100644 --- a/Shikimori/utils/adminperms.py +++ b/Shikimori/utils/adminperms.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import asyncio from pyrogram import filters from pyrogram.types import ChatPermissions, Message diff --git a/Shikimori/utils/arqapi.py b/Shikimori/utils/arqapi.py index dd78d64b..7c4c40a4 100644 --- a/Shikimori/utils/arqapi.py +++ b/Shikimori/utils/arqapi.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from aiohttp import ClientSession from Python_ARQ import ARQ diff --git a/Shikimori/utils/captcha_mongo.py b/Shikimori/utils/captcha_mongo.py index c3149c84..4655b36e 100644 --- a/Shikimori/utils/captcha_mongo.py +++ b/Shikimori/utils/captcha_mongo.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from pymongo import MongoClient from Shikimori import MONGO_DB_URI diff --git a/Shikimori/utils/inlinefuncs.py b/Shikimori/utils/inlinefuncs.py index f50c1ff1..ba3f2cfc 100644 --- a/Shikimori/utils/inlinefuncs.py +++ b/Shikimori/utils/inlinefuncs.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import asyncio import os import sys diff --git a/Shikimori/utils/paste.py b/Shikimori/utils/paste.py index 1f5bb41d..f427e6c9 100644 --- a/Shikimori/utils/paste.py +++ b/Shikimori/utils/paste.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import socket from asyncio import get_running_loop from functools import partial diff --git a/Shikimori/utils/permissions.py b/Shikimori/utils/permissions.py index 6ad0f8a9..6ad7c933 100644 --- a/Shikimori/utils/permissions.py +++ b/Shikimori/utils/permissions.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + from functools import wraps from pyrogram.errors.exceptions.forbidden_403 import ChatWriteForbidden from pyrogram.types import Message diff --git a/Shikimori/utils/pluginhelper.py b/Shikimori/utils/pluginhelper.py index 86737b19..4c2ee580 100644 --- a/Shikimori/utils/pluginhelper.py +++ b/Shikimori/utils/pluginhelper.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import asyncio import math import shlex diff --git a/Shikimori/utils/uputils.py b/Shikimori/utils/uputils.py index 44a9aef1..39aff2a8 100644 --- a/Shikimori/utils/uputils.py +++ b/Shikimori/utils/uputils.py @@ -1,3 +1,39 @@ +""" +STATUS: Code is working. ✅ +""" + +""" +BSD 2-Clause License + +Copyright (C) 2022, SOME-1HING [https://github.com/SOME-1HING] + +Credits:- + I don't know who originally wrote this code. If you originally wrote this code, please reach out to me. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + import math import time