Improved type-hinting for loggers and removed legacy
This commit is contained in:
parent
7a64e334d2
commit
ce57755eee
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from logging import Logger
|
||||
from typing import Any, Dict
|
||||
|
||||
from bson import ObjectId
|
||||
@ -8,7 +9,7 @@ from libbot.utils import config_get
|
||||
from errors import UserNotFoundError
|
||||
from modules.database import col_warnings, sync_col_users, sync_col_warnings, col_users
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger: Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class HoloUser:
|
||||
@ -123,8 +124,3 @@ class HoloUser:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
# def purge(self) -> None:
|
||||
# """Completely remove data from database. Will not remove transactions logs and warnings."""
|
||||
# col_users.delete_one(filter={"_id": self.db_id})
|
||||
# self.unauthorize()
|
||||
|
@ -1,5 +1,6 @@
|
||||
import logging
|
||||
import sys
|
||||
from logging import Logger
|
||||
|
||||
from discord import (
|
||||
ApplicationContext,
|
||||
@ -20,7 +21,7 @@ from modules.scheduler import scheduler
|
||||
from modules.utils_sync import guild_name
|
||||
from modules.waifu_pics import waifu_pics
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger: Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Admin(commands.Cog):
|
||||
|
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from logging import Logger
|
||||
from typing import Dict, List, Any
|
||||
|
||||
from discord import Cog, Message
|
||||
@ -7,7 +8,7 @@ from discord.ext import commands
|
||||
from classes.holo_bot import HoloBot
|
||||
from modules.database import col_analytics
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger: Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Analytics(commands.Cog):
|
||||
|
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from logging import Logger
|
||||
from typing import Any, Dict
|
||||
|
||||
from discord import ApplicationContext, Embed, option, TextChannel, Role
|
||||
@ -14,7 +15,7 @@ from enums import Color
|
||||
from modules.database import col_users
|
||||
from modules.utils_sync import guild_name
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger: Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CustomChannels(commands.Cog):
|
||||
|
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from logging import Logger
|
||||
|
||||
from discord import ApplicationContext, Embed, User, option, slash_command
|
||||
from discord.ext import commands
|
||||
@ -8,7 +9,7 @@ from classes.holo_bot import HoloBot
|
||||
from modules.utils_sync import guild_name
|
||||
from modules.waifu_pics import waifu_pics
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger: Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Fun(commands.Cog):
|
||||
|
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from logging import Logger
|
||||
from typing import Dict, Any
|
||||
|
||||
from discord import Member, Message, TextChannel, MessageType
|
||||
@ -9,7 +10,7 @@ from libbot.utils import config_get
|
||||
from classes.holo_bot import HoloBot
|
||||
from modules.database import col_users
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger: Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Logger(commands.Cog):
|
||||
|
Loading…
Reference in New Issue
Block a user