From ad3ff4191e39a76c7b7d434bc0f02a271481564e Mon Sep 17 00:00:00 2001 From: Heet Patel Date: Sun, 31 Dec 2023 12:08:10 +0000 Subject: [PATCH] Update RESTPlugin instantiation in latex.py and unit_convert.py --- FormulaForge/Extensions/latex.py | 4 ++-- FormulaForge/Extensions/unit_convert.py | 12 ++++++------ FormulaForge/bot.py | 2 +- requirements.txt | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/FormulaForge/Extensions/latex.py b/FormulaForge/Extensions/latex.py index 2ee504c..e2368af 100644 --- a/FormulaForge/Extensions/latex.py +++ b/FormulaForge/Extensions/latex.py @@ -10,12 +10,12 @@ -latex_images = arc.RESTPlugin[arc.RESTClient]("latex_images") +latex_images = arc.RESTPlugin("latex_images") @latex_images.include @arc.slash_command(name="latex_to_image", description="Convert LaTeX (Math Mode) to an image.") async def latex_to_image( - ctx: arc.Context[arc.RESTClient], + ctx: arc.RESTContext, is_transparent: arc.Option[ bool, arc.BoolParams( diff --git a/FormulaForge/Extensions/unit_convert.py b/FormulaForge/Extensions/unit_convert.py index 5ab87a0..42d1efa 100644 --- a/FormulaForge/Extensions/unit_convert.py +++ b/FormulaForge/Extensions/unit_convert.py @@ -9,7 +9,7 @@ -unit_converter = arc.RESTPlugin[arc.RESTClient]("unit_converter") +unit_converter = arc.RESTPlugin("unit_converter") unit_convert_group = unit_converter.include_slash_group("unit_convert", "Unit Converter Commands. (Temperature, Speed, Mass, Energy, Length)") @@ -53,7 +53,7 @@ def embed_builder(value, from_unit, to_unit, converted_value): @unit_convert_group.include @arc.slash_subcommand(name="temperature", description="Convert temperature.") async def temperature( - ctx: arc.Context[arc.RESTClient], + ctx: arc.RESTContext, temperature: arc.Option[ float, arc.FloatParams( @@ -84,7 +84,7 @@ async def temperature( @unit_convert_group.include @arc.slash_subcommand(name="speed", description="Convert speed.") async def speed( - ctx: arc.Context[arc.RESTClient], + ctx: arc.RESTContext, speed: arc.Option[ float, arc.FloatParams( @@ -115,7 +115,7 @@ async def speed( @unit_convert_group.include @arc.slash_subcommand(name="mass", description="Convert mass.") async def mass( - ctx: arc.Context[arc.RESTClient], + ctx: arc.RESTContext, mass: arc.Option[ float, arc.FloatParams( @@ -146,7 +146,7 @@ async def mass( @unit_convert_group.include @arc.slash_subcommand(name="energy", description="Convert energy.") async def energy( - ctx: arc.Context[arc.RESTClient], + ctx: arc.RESTContext, energy: arc.Option[ float, arc.FloatParams( @@ -177,7 +177,7 @@ async def energy( @unit_convert_group.include @arc.slash_subcommand(name="length", description="Convert length.") async def length( - ctx: arc.Context[arc.RESTClient], + ctx: arc.RESTContext, length: arc.Option[ float, arc.FloatParams( diff --git a/FormulaForge/bot.py b/FormulaForge/bot.py index cdf4bfb..24533c3 100644 --- a/FormulaForge/bot.py +++ b/FormulaForge/bot.py @@ -28,7 +28,7 @@ async def callback(self, context: miru.ModalContext[miru.REST]) -> None: @client.include @arc.slash_command(name="ping", description="Ping the bot.") -async def ping_slash(ctx: arc.Context[arc.RESTClient]) -> None: +async def ping_slash(ctx: arc.RESTContext) -> None: await ctx.respond("Pong!") diff --git a/requirements.txt b/requirements.txt index 8f6e37f..cb194d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ aiohttp==3.9.1 certifi==2023.11.17 +fastapi==0.108.0 hikari[server]==2.0.0.dev122 -hikari-arc @ git+https://github.com/hypergonial/hikari-arc@d9ec882e30f1522eddbd59b9f3a077122e77f212 +hikari-arc @ git+https://github.com/hypergonial/hikari-arc@beb023a396c8bb42c1d32a1f1ef06df6e0dad815 hikari-miru @ git+https://github.com/hypergonial/hikari-miru.git@7e706d0894a02e5837ec817d66bc385024c62b09 +matplotlib==3.8.2 python-dotenv==1.0.0 -uvicorn==0.25.0 -fastapi==0.108.0 -matplotlib==3.8.2 \ No newline at end of file +uvicorn==0.25.0 \ No newline at end of file