File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -27,27 +27,21 @@ async def food_autocomplete(
27
27
28
28
class FoodCog (commands .Cog ):
29
29
@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 ):
39
36
await ctx .respond (f"You picked: { choice } " )
40
37
41
38
@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 ):
51
45
await ctx .respond (f"You picked: { choice } " )
52
46
53
47
You can’t perform that action at this time.
0 commit comments