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(
2727
2828class 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
You can’t perform that action at this time.
0 commit comments