diff --git a/README.md b/README.md index feb99e5..0602f72 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ client = arc.GatewayClient(bot) # or arc.RESTClient @client.include @arc.slash_command(name="hi", description="Say hi!") async def ping( - ctx: arc.Context[arc.GatewayClient], + ctx: arc.GatewayContext, user: arc.Option[hikari.User, arc.UserParams(description="The user to say hi to.")] ) -> None: await ctx.respond(f"Hey {user.mention}!") diff --git a/arc/abc/client.py b/arc/abc/client.py index b888878..42091f4 100644 --- a/arc/abc/client.py +++ b/arc/abc/client.py @@ -360,7 +360,7 @@ def include_slash_group( @group.include @arc.slash_subcommand(name="Command", description="A command.") - async def cmd(ctx: arc.Context[arc.GatewayClient]) -> None: + async def cmd(ctx: arc.GatewayContext) -> None: await ctx.respond("Hello!") ``` """ @@ -443,7 +443,7 @@ def load_extension(self, path: str) -> te.Self: # In extension.py - plugin = arc.GatewayPlugin[arc.GatewayClient]("test_plugin") + plugin = arc.GatewayPlugin("test_plugin") @arc.loader def loader(client: arc.GatewayClient) -> None: @@ -590,7 +590,7 @@ def __init__(self, value: str): @client.include @arc.slash_command("cmd", "A command.") - async def cmd(ctx: arc.Context[arc.GatewayClient], dep: MyDependency = arc.inject()) -> None: + async def cmd(ctx: arc.GatewayContext, dep: MyDependency = arc.inject()) -> None: await ctx.respond(dep.value) ``` diff --git a/arc/abc/error_handler.py b/arc/abc/error_handler.py index 17e6ed1..3bb76d9 100644 --- a/arc/abc/error_handler.py +++ b/arc/abc/error_handler.py @@ -29,11 +29,11 @@ def set_error_handler(self, callback: ErrorHandlerCallbackT[ClientT]) -> ErrorHa ```py @client.include @arc.slash_command("foo", "Foo command description") - async def foo(ctx: arc.Context[ClientT]) -> None: + async def foo(ctx: arc.GatewayContext) -> None: raise Exception("foo") @foo.set_error_handler - async def foo_error_handler(ctx: arc.Context[ClientT], exc: Exception) -> None: + async def foo_error_handler(ctx: arc.GatewayContext, exc: Exception) -> None: await ctx.respond("foo failed") ``` """ diff --git a/arc/command/message.py b/arc/command/message.py index e6e9e41..b882ecf 100644 --- a/arc/command/message.py +++ b/arc/command/message.py @@ -96,7 +96,7 @@ def message_command( @client.include @arc.message_command(name="Say Hi", description="Say hi!") async def hi_msg( - ctx: arc.Context[arc.GatewayClient], message: hikari.Message + ctx: arc.GatewayContext, message: hikari.Message ) -> None: await ctx.respond(f"Hey {message.author}!") ``` diff --git a/arc/command/slash.py b/arc/command/slash.py index 148bad8..a588f89 100644 --- a/arc/command/slash.py +++ b/arc/command/slash.py @@ -635,7 +635,7 @@ def slash_command( @client.include @arc.slash_command(name="hi", description="Say hi!") async def hi_slash( - ctx: arc.Context[arc.GatewayClient], + ctx: arc.GatewayContext, user: arc.Option[hikari.User, arc.UserParams(description="The user to say hi to.")] ) -> None: await ctx.respond(f"Hey {user.mention}!") @@ -700,7 +700,7 @@ def slash_subcommand( @group.include @arc.slash_subcommand(name="hi", description="Say hi!") async def hi_slashsub( - ctx: arc.Context[arc.GatewayClient], + ctx: arc.GatewayContext, user: arc.Option[hikari.User, arc.UserParams(description="The user to say hi to.")] ) -> None: await ctx.respond(f"Hey {user.mention}!") diff --git a/arc/command/user.py b/arc/command/user.py index 8f80e6b..2e1b48f 100644 --- a/arc/command/user.py +++ b/arc/command/user.py @@ -98,7 +98,7 @@ def user_command( ```py @client.include @arc.user_command(name="Say Hi", description="Say hi!") - async def hi_user(ctx: arc.Context[arc.GatewayClient], user: hikari.User) -> None: + async def hi_user(ctx: arc.GatewayContext, user: hikari.User) -> None: await ctx.respond(f"Hey {user.mention}!") ``` """ diff --git a/arc/plugin.py b/arc/plugin.py index 1c1921e..26576fd 100644 --- a/arc/plugin.py +++ b/arc/plugin.py @@ -178,7 +178,7 @@ def include_slash_group( @group.include @arc.slash_subcommand(name="Command", description="A command.") - async def cmd(ctx: arc.Context[arc.GatewayClient]) -> None: + async def cmd(ctx: arc.GatewayContext) -> None: await ctx.respond("Hello!") ``` """ diff --git a/tests/test_sigparse.py b/tests/test_sigparse.py index 05bd088..21254a4 100644 --- a/tests/test_sigparse.py +++ b/tests/test_sigparse.py @@ -122,7 +122,7 @@ def __init__(self, val: int) -> None: async def di_annotation( - ctx: arc.Context[arc.GatewayClient], + ctx: arc.GatewayContext, a: arc.Option[int, arc.IntParams(description="foo", min=10)], c: arc.Option[str, arc.StrParams(name="b", description="bar", min_length=100)], b: MyType = arc.inject(),