mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
fix: Improve imports in archiver_commands.py
- Add missing redbot.core.commands import - Organize imports into standard library, discord, and local groups - Fix CommandContext.__aenter__ to use self.ctx instead of global ctx
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
"""Module for core archiver commands"""
|
"""Module for core archiver commands"""
|
||||||
|
|
||||||
import discord
|
|
||||||
from redbot.core.commands import Context, hybrid_group, guild_only, admin_or_permissions
|
|
||||||
from discord import app_commands
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Optional, Any, Dict, TypedDict, Callable, Awaitable
|
|
||||||
from enum import Enum, auto
|
from enum import Enum, auto
|
||||||
|
from typing import Optional, Any, Dict, TypedDict, Callable, Awaitable
|
||||||
|
|
||||||
|
import discord
|
||||||
|
from discord import app_commands
|
||||||
|
from redbot.core import commands
|
||||||
|
from redbot.core.commands import Context, hybrid_group, guild_only, admin_or_permissions
|
||||||
|
|
||||||
from ..response_handler import handle_response, ResponseType
|
from ..response_handler import handle_response, ResponseType
|
||||||
from ...utils.exceptions import (
|
from ...utils.exceptions import (
|
||||||
@@ -44,7 +46,7 @@ class CommandContext:
|
|||||||
|
|
||||||
async def __aenter__(self) -> 'CommandContext':
|
async def __aenter__(self) -> 'CommandContext':
|
||||||
"""Set up command context"""
|
"""Set up command context"""
|
||||||
self.start_time = ctx.message.created_at
|
self.start_time = self.ctx.message.created_at
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Starting command {self.operation} in category {self.category.name}"
|
f"Starting command {self.operation} in category {self.category.name}"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user