Skip to content

Commit 0a35940

Browse files
committed
fix(wraps): make bot generic on Context
1 parent 6c209d5 commit 0a35940

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

botbase/wraps/context.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING
3+
from typing import TYPE_CHECKING, Generic
44

55
from nextcord.ext.commands import Context
66

7+
78
from . import wrap
89

910
if TYPE_CHECKING:
1011
from ..botbase import BotBase
12+
from typing import TypeVar
13+
14+
B = TypeVar("B", bound=BotBase)
1115

1216

13-
class MyContext(Context, wrap.Wrap):
14-
bot: BotBase
17+
class MyContext(Context, wrap.Wrap, Generic["B"]):
18+
bot: B
1519

1620
def __init__(self, *args, **kwargs):
1721
super().__init__(*args, **kwargs)

0 commit comments

Comments
 (0)