Skip to content

Commit 9121251

Browse files
committed
🩹 Make CI pass
1 parent ebb1904 commit 9121251

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

examples/app_commands/slash_partial_autocomplete.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,21 @@ async def food_autocomplete(
2727

2828
class FoodCog(commands.Cog):
2929
@commands.slash_command(name="fruit")
30-
async def get_fruit(
31-
self,
32-
ctx: discord.ApplicationContext,
33-
choice: discord.Option(
34-
str,
35-
"Pick a fruit",
36-
autocomplete=partial(food_autocomplete, food_type="fruit"),
37-
),
38-
):
30+
@discord.option(
31+
"choice",
32+
"Pick a fruit",
33+
autocomplete=partial(food_autocomplete, food_type="fruit"),
34+
)
35+
async def get_fruit(self, ctx: discord.ApplicationContext, choice: str):
3936
await ctx.respond(f"You picked: {choice}")
4037

4138
@commands.slash_command(name="vegetable")
42-
async def get_vegetable(
43-
self,
44-
ctx: discord.ApplicationContext,
45-
choice: discord.Option(
46-
str,
47-
"Pick a vegetable",
48-
autocomplete=partial(food_autocomplete, food_type="vegetable"),
49-
),
50-
):
39+
@discord.option(
40+
"choice",
41+
"Pick a vegetable",
42+
autocomplete=partial(food_autocomplete, food_type="vegetable"),
43+
)
44+
async def get_vegetable(self, ctx: discord.ApplicationContext, choice: str):
5145
await ctx.respond(f"You picked: {choice}")
5246

5347

0 commit comments

Comments
 (0)