|
51 | 51 | from twitchio.user import User |
52 | 52 |
|
53 | 53 | from .components import Component |
54 | | - from .types_ import AutoBotOptions, BotOptions |
| 54 | + from .types_ import AutoBotOptions, BotOptions, BotT |
55 | 55 |
|
56 | 56 | PrefixT: TypeAlias = str | Iterable[str] | Callable[["Bot", "ChatMessage"], Coroutine[Any, Any, str | Iterable[str]]] |
57 | 57 |
|
@@ -433,15 +433,15 @@ async def test(ctx: CustomContext) -> None: |
433 | 433 | async def _process_commands( |
434 | 434 | self, payload: ChatMessage | ChannelPointsRedemptionAdd | ChannelPointsRedemptionUpdate |
435 | 435 | ) -> None: |
436 | | - ctx: Context = self.get_context(payload) |
| 436 | + ctx = self.get_context(payload) |
437 | 437 | await self.invoke(ctx) |
438 | 438 |
|
439 | 439 | async def process_commands( |
440 | 440 | self, payload: ChatMessage | ChannelPointsRedemptionAdd | ChannelPointsRedemptionUpdate |
441 | 441 | ) -> None: |
442 | 442 | await self._process_commands(payload) |
443 | 443 |
|
444 | | - async def invoke(self, ctx: Context) -> None: |
| 444 | + async def invoke(self, ctx: Context[BotT]) -> None: |
445 | 445 | try: |
446 | 446 | await ctx.invoke() |
447 | 447 | except CommandError as e: |
@@ -482,7 +482,7 @@ async def event_command_error(self, payload: CommandErrorPayload) -> None: |
482 | 482 | msg = f'Ignoring exception in command "{payload.context.command}":\n' |
483 | 483 | logger.error(msg, exc_info=payload.exception) |
484 | 484 |
|
485 | | - async def before_invoke(self, ctx: Context) -> None: |
| 485 | + async def before_invoke(self, ctx: Context[BotT]) -> None: |
486 | 486 | """A pre invoke hook for all commands that have been added to the bot. |
487 | 487 |
|
488 | 488 | Commands from :class:`~.commands.Component`'s are included, however if you wish to control them separately, |
@@ -513,7 +513,7 @@ async def before_invoke(self, ctx: Context) -> None: |
513 | 513 | The context associated with command invocation, before being passed to the command. |
514 | 514 | """ |
515 | 515 |
|
516 | | - async def after_invoke(self, ctx: Context) -> None: |
| 516 | + async def after_invoke(self, ctx: Context[BotT]) -> None: |
517 | 517 | """A post invoke hook for all commands that have been added to the bot. |
518 | 518 |
|
519 | 519 | Commands from :class:`~.commands.Component`'s are included, however if you wish to control them separately, |
@@ -544,7 +544,7 @@ async def after_invoke(self, ctx: Context) -> None: |
544 | 544 | The context associated with command invocation, after being passed through the command. |
545 | 545 | """ |
546 | 546 |
|
547 | | - async def global_guard(self, ctx: Context, /) -> bool: |
| 547 | + async def global_guard(self, ctx: Context[BotT], /) -> bool: |
548 | 548 | """|coro| |
549 | 549 |
|
550 | 550 | A global guard applied to all commmands added to the bot. |
|
0 commit comments