__version__ = (1, 4, 8, 8) # This file is a part of Hikka Userbot # Code is NOT licensed under CC-BY-NC-ND 4.0 unless otherwise specified. # 🌐 https://github.com/hikariatama/Hikka # You CAN edit this file without direct permission from the author. # You can redistribute this file with any modifications. # meta developer: @yg_modules # scope: hikka_only # scope: hikka_min 1.6.3 # █▄█ █░█ █▀▄▀█ █▀▄▀█ █▄█   █▀▄▀█ █▀█ █▀▄ █▀ # ░█░ █▄█ █░▀░█ █░▀░█ ░█░   █░▀░█ █▄█ █▄▀ ▄█ import base64 from .. import loader, utils @loader.tds class yg_base64(loader.Module): """Encode and decode text using Base64""" strings = {"name": "yg_base64"} async def encodecmd(self, message): """ encode the provided text using Base64""" text = utils.get_args_raw(message) if not text: await utils.answer(message, "No text provided to encode.") return encoded_text = base64.b64encode(text.encode("utf-8")).decode("utf-8") await utils.answer(message, f"Encoded text: {encoded_text}") async def decodecmd(self, message): """ decode the provided Base64 encoded text""" text = utils.get_args_raw(message) if not text: await utils.answer(message, "No encoded text provided to decode") return try: decoded_text = base64.b64decode(text).decode("utf-8") await utils.answer(message, f"Decoded text: {decoded_text}") except Exception as e: await utils.answer(message, f"Error decoding text: {str(e)}")