diff --git a/cogs/skyfun.py b/cogs/skyfun.py index 6b9e5a8..8261676 100644 --- a/cogs/skyfun.py +++ b/cogs/skyfun.py @@ -1,23 +1,23 @@ -# ______ __ __ __ __ ______ ______ -# /\ ___\ /\ \/ / /\ \_\ \ /\ ___\ /\ == \ -# \ \___ \ \ \ _--. \ \____ \ \ \___ \ \ \ __< +# ______ __ __ __ __ ______ ______ +# /\ ___\ /\ \/ / /\ \_\ \ /\ ___\ /\ == \ +# \ \___ \ \ \ _--. \ \____ \ \ \___ \ \ \ __< # \/\_____\ \ \_\ \_\ \/\_____\ \/\_____\ \ \_____\ # \/_____/ \/_/\/_/ \/_____/ \/_____/ \/_____/ -# +# # AGPL-3.0 license import random -import string import discord from discord.ext import commands as skySB import utils + class Fun(skySB.Cog): def __init__(self, bot): self.bot = bot self.langpack = utils.Langs.getcurrent()['fun'] - + @skySB.command( description=utils.Langs.getcurrent()['fun']['dick']['description'] ) @@ -26,10 +26,10 @@ async def dick(self, ctx, user: discord.User = None): mention = user.mention else: mention = self.bot.user - + size = random.randint(1, 1000) await utils.answer( - ctx, + ctx, self.langpack['dick']['text'].format(mention, size)) @skySB.command( @@ -40,12 +40,12 @@ async def iq(self, ctx, user: discord.User = None): mention = user.mention else: mention = self.bot.user - + iq = random.randint(1, 1000) await utils.answer( - ctx, + ctx, self.langpack['iq']['text'].format(mention, iq)) - + @skySB.command( description=utils.Langs.getcurrent()['fun']['gay']['description'] ) @@ -54,11 +54,12 @@ async def gay(self, ctx, user: discord.User = None): mention = user.mention else: mention = self.bot.user - + percent = random.randint(0, 101) await utils.answer( - ctx, + ctx, self.langpack['gay']['text'].format(mention, percent)) - + + async def setup(bot): - await bot.add_cog(Fun(bot)) \ No newline at end of file + await bot.add_cog(Fun(bot)) diff --git a/skySB.py b/skySB.py index f405834..19698d7 100644 --- a/skySB.py +++ b/skySB.py @@ -1,20 +1,19 @@ -# ______ __ __ __ __ ______ ______ -# /\ ___\ /\ \/ / /\ \_\ \ /\ ___\ /\ == \ -# \ \___ \ \ \ _--. \ \____ \ \ \___ \ \ \ __< +# ______ __ __ __ __ ______ ______ +# /\ ___\ /\ \/ / /\ \_\ \ /\ ___\ /\ == \ +# \ \___ \ \ \ _--. \ \____ \ \ \___ \ \ \ __< # \/\_____\ \ \_\ \_\ \/\_____\ \/\_____\ \ \_____\ # \/_____/ \/_/\/_/ \/_____/ \/_____/ \/_____/ -# +# # AGPL-3.0 license import os - -import discord from utils import config, motd, bot, logger from colored import Fore, Style print(motd) logger.warning(f'status: {Fore.YELLOW}loading...{Style.RESET}') + @bot.event async def on_ready(): os.system('clear') @@ -23,7 +22,7 @@ async def on_ready(): logger.warning(f'connected: {Style.BOLD}{bot.user}{Style.RESET}') logger.warning(f'prefix: {Style.BOLD}{config.get("prefix")}{Style.RESET}') print("-" * 45) - + for file in os.listdir(f"{os.path.realpath(os.path.dirname(__file__))}/cogs"): if file.startswith("_"): pass @@ -36,4 +35,4 @@ async def on_ready(): logger.error(f'{extension}: {exception}') while True: - bot.run(config.get('token'), log_handler=None) \ No newline at end of file + bot.run(config.get('token'), log_handler=None) diff --git a/utils.py b/utils.py index 5b778d1..1d2c504 100644 --- a/utils.py +++ b/utils.py @@ -1,25 +1,22 @@ -# ______ __ __ __ __ ______ ______ -# /\ ___\ /\ \/ / /\ \_\ \ /\ ___\ /\ == \ -# \ \___ \ \ \ _--. \ \____ \ \ \___ \ \ \ __< +# ______ __ __ __ __ ______ ______ +# /\ ___\ /\ \/ / /\ \_\ \ /\ ___\ /\ == \ +# \ \___ \ \ \ _--. \ \____ \ \ \___ \ \ \ __< # \/\_____\ \ \_\ \_\ \/\_____\ \/\_____\ \ \_____\ # \/_____/ \/_/\/_/ \/_____/ \/_____/ \/_____/ -# +# # AGPL-3.0 license import json import logging import asyncio import os -import io - -import discord from discord.ext import commands from colored import Fore, Style -from types import FunctionType # Logging -logging.basicConfig(format=f"%(asctime)s | [{Fore.CYAN}%(levelname)s{Style.RESET}] %(message)s", level=logging.WARNING, datefmt='%H:%M') +logging.basicConfig( + format=f"%(asctime)s | [{Fore.CYAN}%(levelname)s{Style.RESET}] %(message)s", level=logging.WARNING, datefmt='%H:%M') logger = logging.getLogger(__name__) @@ -34,34 +31,35 @@ ) bot.remove_command('help') + class Langs: @staticmethod def all() -> list: """ Get all langpacks - + Returns: List - list all langpacks in directory. """ return os.listdir('./langs/') - + @staticmethod def getcurrent() -> dict: """ Get current langpack - + Returns: Dict - langpack JSON data """ with open(config.get('language')) as f: langpack = json.load(f) return langpack - + @staticmethod def get(file: str) -> dict: """ Get langpack - + Parameters: file (String) - file path Returns: @@ -69,9 +67,10 @@ def get(file: str) -> dict: """ with open(file) as f: langpack = json.load(f) - + return langpack + # MOTD motd = """ ______ __ __ __ __ ______ ______ @@ -81,8 +80,9 @@ def get(file: str) -> dict: \/_____/ \/_/\/_/ \/_____/ \/_____/ \/_____/ """ + async def answer( - ctx, + ctx, message: str, photo: bool = False, document: bool = False, @@ -90,11 +90,11 @@ async def answer( ) -> str: """ Answer text - + Parameters: ctx (Content), message (String) - + Returns: String - message text """ @@ -108,19 +108,20 @@ async def answer( responses.append(await ctx.message.edit(message)) except: responses.append(await ctx.reply(message)) - + await asyncio.sleep(config.get('deletetimer')) - + for response in responses: await response.delete() return responses + def get_ram() -> float: """ ! from teagram - + Get your ram usage - + Returns: Float - ram usage """ @@ -134,10 +135,11 @@ def get_ram() -> float: except: return 0 + def get_cpu() -> float: """ ! from teagram - + Get CPU usage as a percentage Returns: @@ -157,10 +159,11 @@ def get_cpu() -> float: except: return 0 + def get_platform() -> str: """ ! from teagram - + Get the platform information Returns: @@ -190,4 +193,4 @@ def get_platform() -> str: elif IS_ZACHOST: return "❔ Zachem㉿Host" else: - return "🖥️ VDS" \ No newline at end of file + return "🖥️ VDS"