From fb3e291d77a0418ff205a7effc34fa8f547e9408 Mon Sep 17 00:00:00 2001 From: profitroll Date: Wed, 19 Apr 2023 14:23:41 +0200 Subject: [PATCH] Sorted imports and removed unused ones --- cogs/cogCategory.py | 3 ++- cogs/cogChannel.py | 5 +++-- cogs/cogLocale.py | 2 ++ cogs/cogUtility.py | 4 +++- functions.py | 25 +++++++++++++------------ yusarin.py | 11 ++--------- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/cogs/cogCategory.py b/cogs/cogCategory.py index ba36a0e..a680c23 100644 --- a/cogs/cogCategory.py +++ b/cogs/cogCategory.py @@ -1,5 +1,6 @@ -from discord import ApplicationContext, Option, SlashCommandGroup, CategoryChannel +from discord import ApplicationContext, CategoryChannel, Option, SlashCommandGroup from discord.ext import commands + from functions import ( getMsg, guildConfGet, diff --git a/cogs/cogChannel.py b/cogs/cogChannel.py index ed9aefd..170fffe 100644 --- a/cogs/cogChannel.py +++ b/cogs/cogChannel.py @@ -1,14 +1,15 @@ from discord import ( ApplicationContext, + Cog, + Member, SlashCommandGroup, VoiceChannel, - Member, VoiceState, - Cog, option, utils, ) from discord.ext import commands + from functions import ( appendLog, changeNomicPerms, diff --git a/cogs/cogLocale.py b/cogs/cogLocale.py index ddb7dda..3e1e3eb 100644 --- a/cogs/cogLocale.py +++ b/cogs/cogLocale.py @@ -1,6 +1,8 @@ from os import listdir + from discord import ApplicationContext, Option, SlashCommandGroup from discord.ext import commands + from functions import ( appendLog, getMsg, diff --git a/cogs/cogUtility.py b/cogs/cogUtility.py index 14d8be2..d4e67c1 100644 --- a/cogs/cogUtility.py +++ b/cogs/cogUtility.py @@ -1,7 +1,9 @@ from os import getpid, makedirs, system from shutil import rmtree -from discord import ApplicationContext, slash_command, Cog, Guild + +from discord import ApplicationContext, Cog, Guild, slash_command from discord.ext import commands + from functions import appendLog, getMsg, loadJson, makeEmbed, saveJson, strToColor diff --git a/functions.py b/functions.py index 8088925..7d6b713 100644 --- a/functions.py +++ b/functions.py @@ -1,26 +1,27 @@ -from gzip import open as gzipopen from datetime import datetime -from os import listdir, makedirs, remove, stat, path +from gzip import open as gzipopen +from os import listdir, makedirs, path, remove, stat from shutil import copyfileobj from typing import Any, Literal, Union + from discord import ( - utils, + ApplicationContext, + CategoryChannel, + Client, Embed, + Guild, + Member, + Message, + PermissionOverwrite, TextChannel, VoiceChannel, - PermissionOverwrite, - Guild, - CategoryChannel, - Member, - Client, - ApplicationContext, - Message, + utils, ) try: - from ujson import loads, dumps + from ujson import dumps, loads except ImportError: - from json import loads, dumps + from json import dumps, loads # path = Path(__file__).resolve().parent diff --git a/yusarin.py b/yusarin.py index 3de3857..3c7d759 100644 --- a/yusarin.py +++ b/yusarin.py @@ -1,13 +1,6 @@ try: + from discord import Activity, ActivityType, ApplicationContext, Bot, Intents from requests import get - from discord import ( - ApplicationContext, - Intents, - Bot, - ActivityType, - Activity, - VoiceState, - ) except Exception as exp: print( f"Dependencies not installed. Make sure to run 'pip install -r requirements.txt' before first start" @@ -15,7 +8,7 @@ except Exception as exp: exit() from os import getpid -from shutil import rmtree + from functions import * pid = getpid()