Skip to content

Commit 4ffa826

Browse files
committed
✨ Add custom_attrs dict to custom context
1 parent 2278d52 commit 4ffa826

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/custom/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def __init__(self, bot: "Bot", interaction: discord.Interaction) -> None:
2828
self.bot: Bot
2929
self.user_obj: User | None = None
3030
self.guild_obj: Guild | None = None
31+
self.custom_attrs: dict[str, Any] = {}
3132

3233
@override
3334
def __setattr__(self, key: Any, value: Any) -> None:
@@ -50,6 +51,7 @@ def __init__(self, **kwargs: Any) -> None:
5051
self.bot: Bot
5152
self.user_obj: User | None = None
5253
self.guild_obj: Guild | None = None
54+
self.custom_attrs: dict[str, Any] = {}
5355

5456
def load_translations(self) -> None:
5557
if hasattr(self.command, "translations") and self.command.translations: # pyright: ignore[reportUnknownArgumentType,reportOptionalMemberAccess,reportAttributeAccessIssue]
@@ -132,7 +134,8 @@ async def get_context(
132134
return ctx
133135

134136

135-
Context: ApplicationContext = ApplicationContext # pyright: ignore [reportRedeclaration]
137+
if not TYPE_CHECKING:
138+
Context: ApplicationContext = ApplicationContext # pyright: ignore [reportRedeclaration]
136139

137140
if TYPE_CHECKING: # temp fix for https://github.com/Pycord-Development/pycord/pull/2611
138141
type Context = ExtContext | ApplicationContext

0 commit comments

Comments
 (0)